This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA4VMXEVM: Doesn't keep mincom port number in setup.sh

Part Number: TDA4VMXEVM

setup.sh doesn't keep minicom port device as blow.
I set the right device "/dev/ttyUSB0" in setup.sh, but the script detect incorrect device "/dev/ttyUSB2" automatically.

Can I keep the right device name in setup.sh?

----------------------------------------------------

$ ./setup.sh
-------------------------------------------------------------------------------
TISDK setup script
This script will set up your development host for SDK development.
Parts of this script require administrator priviliges (sudo access).
-------------------------------------------------------------------------------

(nip)

--------------------------------------------------------------------------------"
This step will set up minicom (serial communication application) for
SDK development


For boards that contain a USB-to-Serial converter on the board such as:
* BeagleBone
* Beaglebone Black
* AM335x EVM-SK
* AM57xx EVM
* K2H, K2L, and K2E EVMs

the port used for minicom will be automatically detected. By default Ubuntu
will not recognize this device. Setup will add a udev rule to
/etc/udev/ so that from now on it will be recognized as soon as the board is
plugged in.

For other boards, the serial will defualt to /dev/ttyS0. Please update based
on your setup.

--------------------------------------------------------------------------------


NOTE: If your using any of the above boards simply hit enter
and the correct port will be determined automatically at a
later step. For all other boards select the serial port
that the board is connected to.
Which serial port do you want to use with minicom?
[ /dev/ttyS0 ] /dev/ttyUSB0

Copied existing /home/XX/.minirc.dfl to /home/XX/.minirc.dfl.old

Configuration saved to /home/XX/.minirc.dfl. You can change it further from inside
minicom, see the Software Development Guide for more information.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
This step will set up the u-boot variables for booting the EVM.
--------------------------------------------------------------------------------
Autodetected the following ip address of your host, correct it if necessary
[ ] XX.XX.XX.XX

Select Linux kernel location:
1: TFTP
2: SD card

[ 1 ]

Select root file system location:
1: NFS
2: SD card

[ 1 ]

Available kernel images in /tftproot:
Image-j7-evm.bin
backup_06_01_01_02
k3-j721e-common-proc-board-infotainment-display-sharing.dtbo
k3-j721e-common-proc-board-infotainment.dtbo
k3-j721e-common-proc-board-jailhouse.dtbo
k3-j721e-common-proc-board.dtb
k3-j721e-pcie-backplane.dtbo
k3-j721e-proc-board-tps65917.dtb
k3-j721e-vision-apps.dtbo
ti-sci-firmware-j721e-gp.bin

Which kernel image do you want to boot from TFTP?
[ Image-j7-evm.bin ]
--------------------------------------------------------------------------------
Would you like to create a minicom script with the above parameters (y/n)?
[ y ]

Successfully wrote /home/XX/ti-processor-sdk-linux-automotive-j7-evm-06_02_00/bin/setupBoard.minicom

Detecting connection to board... Couldn't open device, some information will be missing
/dev/ttyUSB2

--------------------------------------------------------------------------------
Would you like to run the setup script now (y/n)?

Please connect the ethernet cable as described in the Quick Start Guide.
Once answering 'y' on the prompt below, you will have 300 seconds to connect
the board and power cycle it before the setup times out

After successfully executing this script, your EVM will be set up. You will be
able to connect to it by executing 'minicom -w' or if you prefer a windows host
you can set up Tera Term as explained in the Software Developer's Guide.
If you connect minicom or Tera Term and power cycle the board Linux will boot.

[ y ]

  • Hi,

    Can you dump the contents of the file bin/setupBoard.minicom?

    Regards,

    Nikhil D

  • Hi Nikhil,

    I attached the setupBoard.minicom.  IP address masked.

    ----------------------------------------------------------
    $ cat bin/setupBoard.minicom

    timeout 300
    verbose on
    expect {
    "stop autoboot:"
    }
    send " "

    expect {
    "=>"
    }
    send "env default -f -a"

    expect {
    "=>"
    }
    send "saveenv"

    expect {
    "=>"
    }
    send "reset"

    expect {
    "stop autoboot:"
    }
    send " "

    expect {
    "=>"
    }
    send "setenv serverip XX.XX.XX.XX"

    expect {
    "=>"
    }
    send "setenv nfs_root /home/csbd/ti_tda/ti-processor-sdk-linux-automotive-j7-evm-06_02_00/targetNFS"

    expect {
    "=>"
    }
    send "setenv name_kern Image-j7-evm.bin"

    expect {
    "=>"
    }
    send "setenv bootcmd 'run findfdt; run envboot; run setup_${kern_boot}; run init_${rootfs_boot}; run get_kern_${kern_boot}; run get_fdt_${kern_boot}; run get_overlay_${kern_boot}; run run_kern'"

    expect {
    "=>"
    }
    send "setenv init_net 'run args_all args_net; setenv autoload no; dhcp'"

    expect {
    "=>"
    }
    send "setenv args_net 'setenv bootargs console=${console} ${optargs} rootfstype=nfs root=/dev/nfs rw nfsroot=${serverip}:${nfs_root},${nfs_options} ip=dhcp'"

    expect {
    "=>"
    }
    send "setenv get_kern_net 'tftp ${loadaddr} ${name_kern}'"

    expect {
    "=>"
    }
    send "setenv get_fdt_net 'tftp ${fdtaddr} ${name_fdt}'"

    expect {
    "=>"
    }
    send "setenv get_overlay_net 'fdt address ${fdtaddr};fdt resize 0x100000;for overlay in ${overlay_files};do;tftp ${overlayaddr} ${overlay};fdt apply ${overlayaddr}; done'"

    expect {
    "=>"
    }
    send "setenv nfs_options 'nolock,v3,tcp,rsize=4096,wsize=4096'"

    expect {
    "=>"
    }
    send "setenv setup_mmc ''"

    expect {
    "=>"
    }
    send "setenv setup_net 'setenv autoload no; dhcp'"

    expect {
    "=>"
    }
    send "setenv kern_boot net"

    expect {
    "=>"
    }
    send "setenv rootfs_boot net"

    expect {
    "=>"
    }
    send "saveenv"

    expect {
    "=>"
    }
    send "boot"

  • Hi Hirokazu Hashimoto san,

    The problem is because the command "lsusb" cannot get the iSerial number when run without sudo. [1]

    See the difference between the two commands:

    lsusb -v -d 0403:6011 | grep iSerial | awk '{ print $NF }'
    sudo lsusb -v -d 0403:6011 | grep iSerial | awk '{ print $NF }'

    The right solution would be to modify the script bin/setup-uboot-env.sh such that the lsusb command is run with sudo prefix as below:

    diff --git a/bin/setup-uboot-env.sh b/bin/setup-uboot-env.sh
    index b6e043b..30ce932 100755
    --- a/bin/setup-uboot-env.sh
    +++ b/bin/setup-uboot-env.sh
    @@ -219,7 +219,7 @@ if [ "$minicom" = "y" ]; then
    echo ""
    echo -n "Detecting connection to board... "
    loopCount=0
    - serial_number=`lsusb -v -d 0403:6011 | grep iSerial | awk '{ print $NF }'`
    + serial_number=`sudo lsusb -v -d 0403:6011 | grep iSerial | awk '{ print $NF }'`
    usb_id=`dmesg | grep "SerialNumber: $serial_number" | tail -1 | awk '{ print $3 }'`
    port=`dmesg | grep FTDI | grep "tty" | grep "$usb_id" | tail -4 | head -1 | grep "attached" | awk '{ print $NF }'`
    while [ -z "$port" ] && [ "$loopCount" -ne "10" ]
    @@ -228,7 +228,7 @@ if [ "$minicom" = "y" ]; then
    loopCount=$((loopCount+1))

    sleep 1
    - serial_number=`lsusb -v -d 0403:6011 | grep iSerial | awk '{ print $NF }'`
    + serial_number=`sudo lsusb -v -d 0403:6011 | grep iSerial | awk '{ print $NF }'`
    usb_id=`dmesg | grep "SerialNumber: $sn" | tail -1 | awk '{ print $3 }'`
    port=`dmesg | grep FTDI | grep "tty" | grep "usb $usb_id" | tail -4 | head -1 | grep "attached" | awk '{ print $NF }'`
    done

    [1] - https://askubuntu.com/questions/1153207/lsusb-i-get-always-couldnt-open-device-is-this-normal

    Regards,

    Nikhil D

  • Hi Nikhil,

    I add "sudo" before "lsusb", but it doesn't change.  "setup.sh" detected "/dev/ttyUSB2" automatically and write "/dev/ttyUSB2" to "~/.minirc.dfl".

    Thanks,
    Hiro

  • Hi,

    Can you please provide the output of two commands:

    lsusb -v -d 0403:6011 | grep iSerial
    sudo lsusb -v -d 0403:6011 | grep iSerial

    Regards,

    Nikhil D