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.

AM335x EVM unable to boot linux from tftp NFS using ti-sdk-am335x-evm-05.04.00.00

This is my 2nd day with an AM335x EVM, it can boot from the SD card provided by TI, but now I'd like to boot the EVM from my computer using tftp and NFS.

I installed ti-sdk-am335x-evm-05.04.00.00 in Ubuntu 10.04 LTS in a real computer, not a virtual machine, and run /home/user/ti-sdk-am335x-evm-05.04.00.00/setup.sh several times to boot from tftp or SD card. It boots correctly from SD card, but I have problems to boot from tftp.

My computer IP is 11.0.0.139

Gateway/DHCP/DNS server IP is 11.0.0.1

EVM IP is 11.0.0.138

setup.sh creates and runs with minicom the file /home/user/ti-sdk-am335x-evm-05.04.00.00/bin/setupBoard.minicom:

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

expect {
    "U-Boot#"
}
send "setenv serverip 11.0.0.139"

expect {
    "U-Boot#"
}
send "setenv rootpath /home/user/ti-sdk-am335x-evm-05.04.00.00/targetNFS"

expect {
    "U-Boot#"
}
send "setenv bootfile uImage-am335x-evm.bin"

expect {
    "U-Boot#"
}
send "setenv ip_method dhcp"

expect {
    "U-Boot#"
}
send "setenv bootcmd 'setenv autoload no;dhcp "$\{bootfile\}";tftp "$\{loadaddr\}" "$\{bootfile\}";run net_args;bootm "$\{loadaddr\}"'"

expect {
    "U-Boot#"
}
send "saveenv"

expect {
    "U-Boot#"
}
send "boot"

! killall -s SIGHUP minicom

I also run this script with minicom:

user@user:~/ti-sdk-am335x-evm-05.04.00.00$ minicom -S ./bin/setupBoard.minicom

Welcome to minicom 2.4

OPCIONES: I18n
Compilado en Jan 25 2010, 06:49:09.
Port /dev/ttyS0

Presione CTRL-A Z para obtener ayuda sobre teclas especiales

CCCCCCCC
U-Boot SPL 2011.09 (Feb 09 2012 - 15:38:59)
Texas Instruments Revision detection unimplemented
OMAP SD/MMC: 0
reading u-boot.img
reading u-boot.img


U-Boot 2011.09 (Feb 09 2012 - 15:11:31)

I2C:   ready
DRAM:  256 MiB
WARNING: Caches not enabled
Found a daughter card connected
NAND:  HW ECC Hamming Code selected
256 MiB
MMC:   OMAP SD/MMC: 0
Net:   cpsw
Hit any key to stop autobo 0
U-Boot#setenv serverip 11.0.0.139
U-Boot#setenv rootpath /home/user/ti-sdk-am335x-evm-05.04.00.00/targetNFS
U-Boot#setenv bootfile uImage-am335x-evm.bin
U-Boot#setenv ip_method dhcp
U-Boot#setenv bootcmd 'setenv autoload no;dhcp  ${bootfile};tftp  ${loadaddr}  ${bootfile};run net_args;bootm  ${loadaddr}'
U-Boot#saveenv
Saving Environment to NAND...
Erasing Nand...
Erasing at 0x260000 -- 100% complete.
Writing to Nand... done
U-Boot#

Minicom is closed automatically.

I open minicom and reset the EVM, it should boot from tftps, but U-Boot does not find the kernel image because the server IP is wrong, it is trying to get the file from my router (11.0.0.1), not my computer (11.0.0.139).

Welcome to minicom 2.4

OPCIONES: I18n
Compilado en Jan 25 2010, 06:49:09.
Port /dev/ttyS0

Presione CTRL-A Z para obtener ayuda sobre teclas especiales

CCCCCCCC
U-Boot SPL 2011.09 (Feb 09 2012 - 15:38:59)
Texas Instruments Revision detection unimplemented
OMAP SD/MMC: 0
reading u-boot.img
reading u-boot.img


U-Boot 2011.09 (Feb 09 2012 - 15:11:31)

I2C:   ready
DRAM:  256 MiB
WARNING: Caches not enabled
Found a daughter card connected
NAND:  HW ECC Hamming Code selected
256 MiB
MMC:   OMAP SD/MMC: 0
Net:   cpsw
Hit any key to stop autoboot:  0
link up on port 0, speed 1000, full duplex
BOOTP broadcast 1
BOOTP broadcast 2
DHCP client bound to address 11.0.0.138
link up on port 0, speed 1000, full duplex
Using cpsw device
TFTP from server 11.0.0.1; our IP address is 11.0.0.138
Filename 'uImage-am335x-evm.bin'.
Load address: 0x82000000
Loading: T
TFTP error: 'File not found' (1)
Not retrying...
Wrong Image Format for bootm command
ERROR: can't get kernel image!
U-Boot#

I do some checks:

U-Boot# printenv
autoload=no
baudrate=115200
bootargs=console=ttyO0,115200n8 root=/dev/nfs nfsroot=11.0.0.1:/home/user/ti-sdk-am335x-evm-05.04.00.00/targetNFS,nolock rw ip=dhcp
bootargs_defaults=setenv bootargs console=${console} ${optargs}
bootcmd=setenv autoload no;dhcp  ${bootfile};tftp  ${loadaddr}  ${bootfile};run net_args;bootm  ${loadaddr}
bootdelay=3
bootenv=uEnv.txt
bootfile=uImage-am335x-evm.bin
console=ttyO0,115200n8
dnsip=11.0.0.1
ethact=cpsw
ethaddr=d4:94:a1:91:6b:aa
gatewayip=11.0.0.1
importbootenv=echo Importing environment from mmc ...; env import -t $loadaddr $filesize
ip_method=dhcp
ipaddr=11.0.0.138
kloadaddr=0x80007fc0
loadaddr=0x82000000
loadbootenv=fatload mmc ${mmc_dev} ${loadaddr} ${bootenv}
mmc_args=run bootargs_defaults;setenv bootargs ${bootargs} root=${mmc_root} rootfstype=${mmc_root_fs_type} ip=${ip_method}
mmc_boot=run mmc_args; run mmc_load_uimage; bootm ${kloadaddr}
mmc_dev=0
mmc_load_uimage=fatload mmc ${mmc_dev} ${kloadaddr} ${bootfile}
mmc_root=/dev/mmcblk0p2 rw
mmc_root_fs_type=ext3 rootwait
nand_args=run bootargs_defaults;setenv bootargs ${bootargs} root=${nand_root} noinitrd rootfstype=${nand_root_fs_type} ip=${ip_method}
nand_boot=echo Booting from nand ...; run nand_args; nandecc hw 2; nand read.i ${kloadaddr} ${nand_src_addr} ${nand_img_siz}; bootm ${kloadaddr}
nand_img_siz=0x500000
nand_root=ubi0:rootfs rw ubi.mtd=7,2048
nand_root_fs_type=ubifs rootwait=1
nand_src_addr=0x280000
net_args=run bootargs_defaults;setenv bootargs ${bootargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=dhcp
net_boot=echo Booting from network ...; setenv autoload no; dhcp; tftp ${kloadaddr} ${bootfile}; run net_args; bootm ${kloadaddr}
netmask=255.255.255.0
nfsopts=nolock
nor_args=run bootargs_defaults;setenv bootargs ${bootargs} root={nor_root} rootfstype=${nor_root_fs_type} ip=${ip_method}
nor_boot=echo Booting from NOR ...; run nor_args; cp.b ${0x08080000} ${kloadaddr} ${nor_img_siz}; bootm ${kloadaddr}
nor_img_siz=0x280000
nor_root=/dev/mtdblock3 rw
nor_root_fs_type=jffs2
nor_src_addr=0x08080000
rootpath=/home/user/ti-sdk-am335x-evm-05.04.00.00/targetNFS
script_addr=0x81900000
serverip=11.0.0.1
spi_args=run bootargs_defaults;setenv bootargs ${bootargs} root=${spi_root} rootfstype=${spi_root_fs_type} ip=${ip_method}
spi_boot=echo Booting from spi ...; run spi_args; sf probe ${spi_bus_no}:0; sf read ${kloadaddr} ${spi_src_addr} ${spi_img_siz}; bootm ${kloadaddr}
spi_bus_no=0
spi_img_siz=0x280000
spi_root=/dev/mtdblock4 rw
spi_root_fs_type=jffs2
spi_src_addr=0x62000
static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off
stderr=serial
stdin=serial
stdout=serial
Environment size: 2762/8188 bytes

nfsroot and serverip are wrong, correct it:

U-Boot# setenv serverip 11.0.0.139
U-Boot# setenv bootargs console=ttyO0,115200n8 root=/dev/nfs nfsroot=11.0.0.139:/home/user/ti-sdk-am335x-evm-05.04.00.00/targetNFS,nolock rw
U-Boot# saveenv
Saving Environment to NAND...
Erasing Nand...
Erasing at 0x260000 -- 100% complete.
Writing to Nand... done
U-Boot# printenv

autoload=no
baudrate=115200
bootargs=console=ttyO0,115200n8 root=/dev/nfs nfsroot=11.0.0.139:/home/user/ti-sdk-am335x-evm-05.04.00.00/targetNFS,nolock rw ip=dhcp
bootargs_defaults=setenv bootargs console=${console} ${optargs}
bootcmd=setenv autoload no;dhcp  ${bootfile};tftp  ${loadaddr}  ${bootfile};run net_args;bootm  ${loadaddr}
bootdelay=3
bootenv=uEnv.txt
bootfile=uImage-am335x-evm.bin
console=ttyO0,115200n8
dnsip=11.0.0.1
ethact=cpsw
ethaddr=d4:94:a1:91:6b:aa
gatewayip=11.0.0.1
importbootenv=echo Importing environment from mmc ...; env import -t $loadaddr $filesize
ip_method=dhcp
ipaddr=11.0.0.138
kloadaddr=0x80007fc0
loadaddr=0x82000000
loadbootenv=fatload mmc ${mmc_dev} ${loadaddr} ${bootenv}
mmc_args=run bootargs_defaults;setenv bootargs ${bootargs} root=${mmc_root} rootfstype=${mmc_root_fs_type} ip=${ip_method}
mmc_boot=run mmc_args; run mmc_load_uimage; bootm ${kloadaddr}
mmc_dev=0
mmc_load_uimage=fatload mmc ${mmc_dev} ${kloadaddr} ${bootfile}
mmc_root=/dev/mmcblk0p2 rw
mmc_root_fs_type=ext3 rootwait
nand_args=run bootargs_defaults;setenv bootargs ${bootargs} root=${nand_root} noinitrd rootfstype=${nand_root_fs_type} ip=${ip_method}
nand_boot=echo Booting from nand ...; run nand_args; nandecc hw 2; nand read.i ${kloadaddr} ${nand_src_addr} ${nand_img_siz}; bootm ${kloadaddr}
nand_img_siz=0x500000
nand_root=ubi0:rootfs rw ubi.mtd=7,2048
nand_root_fs_type=ubifs rootwait=1
nand_src_addr=0x280000
net_args=run bootargs_defaults;setenv bootargs ${bootargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=dhcp
net_boot=echo Booting from network ...; setenv autoload no; dhcp; tftp ${kloadaddr} ${bootfile}; run net_args; bootm ${kloadaddr}
netmask=255.255.255.0
nfsopts=nolock
nor_args=run bootargs_defaults;setenv bootargs ${bootargs} root={nor_root} rootfstype=${nor_root_fs_type} ip=${ip_method}
nor_boot=echo Booting from NOR ...; run nor_args; cp.b ${0x08080000} ${kloadaddr} ${nor_img_siz}; bootm ${kloadaddr}
nor_img_siz=0x280000
nor_root=/dev/mtdblock3 rw
nor_root_fs_type=jffs2
nor_src_addr=0x08080000
rootpath=/home/user/ti-sdk-am335x-evm-05.04.00.00/targetNFS
script_addr=0x81900000
serverip=11.0.0.139
spi_args=run bootargs_defaults;setenv bootargs ${bootargs} root=${spi_root} rootfstype=${spi_root_fs_type} ip=${ip_method}
spi_boot=echo Booting from spi ...; run spi_args; sf probe ${spi_bus_no}:0; sf read ${kloadaddr} ${spi_src_addr} ${spi_img_siz}; bootm ${kloadaddr}
spi_bus_no=0
spi_img_siz=0x280000
spi_root=/dev/mtdblock4 rw
spi_root_fs_type=jffs2
spi_src_addr=0x62000
static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off
stderr=serial
stdin=serial
stdout=serial

Now I think everything is OK, try boot again:

U-Boot# boot
link up on port 0, speed 1000, full duplex
BOOTP broadcast 1
BOOTP broadcast 2
DHCP client bound to address 11.0.0.138
link up on port 0, speed 1000, full duplex
Using cpsw device
TFTP from server 11.0.0.1; our IP address is 11.0.0.138
Filename 'uImage-am335x-evm.bin'.
Load address: 0x82000000
Loading: T
TFTP error: 'File not found' (1)
Not retrying...
Wrong Image Format for bootm command
ERROR: can't get kernel image!


It is trying again to get the kernel from my router (11.0.0.1), not my computer (11.0.0.139). boot modifies nfsroot and serverip, why?

U-Boot# printenv
autoload=no
baudrate=115200
bootargs=console=ttyO0,115200n8 root=/dev/nfs nfsroot=11.0.0.1:/home/user/ti-sdk-am335x-evm-05.04.00.00/targetNFS,nolock rw ip=dhcp
bootargs_defaults=setenv bootargs console=${console} ${optargs}
bootcmd=setenv autoload no;dhcp  ${bootfile};tftp  ${loadaddr}  ${bootfile};run net_args;bootm  ${loadaddr}
bootdelay=3
bootenv=uEnv.txt
bootfile=uImage-am335x-evm.bin
console=ttyO0,115200n8
dnsip=11.0.0.1
ethact=cpsw
ethaddr=d4:94:a1:91:6b:aa
gatewayip=11.0.0.1
importbootenv=echo Importing environment from mmc ...; env import -t $loadaddr $filesize
ip_method=dhcp
ipaddr=11.0.0.138
kloadaddr=0x80007fc0
loadaddr=0x82000000
loadbootenv=fatload mmc ${mmc_dev} ${loadaddr} ${bootenv}
mmc_args=run bootargs_defaults;setenv bootargs ${bootargs} root=${mmc_root} rootfstype=${mmc_root_fs_type} ip=${ip_method}
mmc_boot=run mmc_args; run mmc_load_uimage; bootm ${kloadaddr}
mmc_dev=0
mmc_load_uimage=fatload mmc ${mmc_dev} ${kloadaddr} ${bootfile}
mmc_root=/dev/mmcblk0p2 rw
mmc_root_fs_type=ext3 rootwait
nand_args=run bootargs_defaults;setenv bootargs ${bootargs} root=${nand_root} noinitrd rootfstype=${nand_root_fs_type} ip=${ip_method}
nand_boot=echo Booting from nand ...; run nand_args; nandecc hw 2; nand read.i ${kloadaddr} ${nand_src_addr} ${nand_img_siz}; bootm ${kloadaddr}
nand_img_siz=0x500000
nand_root=ubi0:rootfs rw ubi.mtd=7,2048
nand_root_fs_type=ubifs rootwait=1
nand_src_addr=0x280000
net_args=run bootargs_defaults;setenv bootargs ${bootargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=dhcp
net_boot=echo Booting from network ...; setenv autoload no; dhcp; tftp ${kloadaddr} ${bootfile}; run net_args; bootm ${kloadaddr}
netmask=255.255.255.0
nfsopts=nolock
nor_args=run bootargs_defaults;setenv bootargs ${bootargs} root={nor_root} rootfstype=${nor_root_fs_type} ip=${ip_method}
nor_boot=echo Booting from NOR ...; run nor_args; cp.b ${0x08080000} ${kloadaddr} ${nor_img_siz}; bootm ${kloadaddr}
nor_img_siz=0x280000
nor_root=/dev/mtdblock3 rw
nor_root_fs_type=jffs2
nor_src_addr=0x08080000
rootpath=/home/user/ti-sdk-am335x-evm-05.04.00.00/targetNFS
script_addr=0x81900000
serverip=11.0.0.1
spi_args=run bootargs_defaults;setenv bootargs ${bootargs} root=${spi_root} rootfstype=${spi_root_fs_type} ip=${ip_method}
spi_boot=echo Booting from spi ...; run spi_args; sf probe ${spi_bus_no}:0; sf read ${kloadaddr} ${spi_src_addr} ${spi_img_siz}; bootm ${kloadaddr}
spi_bus_no=0
spi_img_siz=0x280000
spi_root=/dev/mtdblock4 rw
spi_root_fs_type=jffs2
spi_src_addr=0x62000
static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off
stderr=serial
stdin=serial
stdout=serial
Environment size: 2762/8188 bytes

Thank you in advance

  • I suspect that your DHCP command is overwriting the definition of serverip.  Could you try to run the commands in "bootcmd" one at a time instead of just typing "boot".  After you do the " dhcp  ${bootfile} " do a printenv and check the value of serverip.  You may need to modify the definition of "bootcmd" to something like the following...

     

    bootcmd=setenv autoload no;dhcp  ${bootfile};setenv serverip 11.0.0.139;
    tftp  ${loadaddr}  ${bootfile};run net_args;bootm  ${loadaddr}

     

    Hope that helps.

    Greg

  • Hi Fordfairlane,

    Why are you making the things complicated? Use these boot args, from the commands I have spend almost 5mins to understand what is your bootargs. Using so many variables and from the bootargs what I understood that you are adding bootargs multiple times.

    set autoload no

    set bootargs 'console=ttyO0,115200n8 noinitrd rw root=/dev/nfs nfsroot=<nfs server>:/home/user/ti-sdk-am335x-evm-05.04.00.00/targetNFS,nolock ip=dhcp earlyprintk' (nfs server means the file system located machine)

    set bootcmd 'dhcp; tftp 0x82000000 uImage-am335x-evm.bin;bootm 0x82000000'

    set serverip <tftp server ip> (contains the uImage-am335x-evm.bin)

    Note: Make sure that NFS server is running

    Regards

    AnilKumar

    Please mark this Forum post as answered via the Verify Answer button below if it helps answer your question.  Thanks!

  • Thank you very much, Greg and Anil

    Greg, you are right, dhdp modifies serverip. I have run the commands manually and the Linux Kernel boots ok, it runs Matrix from my computer.

    Anil, I'm not making things complicated, actually very simple:

    - Get my new EVM out of the box, insert TI Linux SD card and power on, I can see the demo applications on the EVM screen.

    - Install Linux and TI Linux SDK on my new computer.

    - While installing TI Linux SDK, I select boot from tftp/NFS, not SD card, because I'd like to add my application in the future to the TI demo and I don't want to modify the TI's EVM SD Card

    - The EVM does not boot and I think I have broken the EVM.

    - I try to learn (I'm a newbie) Linux, U-Boot, EVM, minicom... read during many hours.

    - I discover that I can see U-Boot output in minicom and try to understand what is happening and try to solve it.

    - I think the EVM and Linux SDK were tested using a virtual machine, where the tftp, NFS and DHCP server IP are the same, but it fails to boot when the tftp server and dhcp server are not the same.

    - Finally I think it's worth asking experienced users.

    That's all. If you think it is very complicated say it to the TI guys ;), because I just selected tftp/NFS instead of SD card when the TI Linux SDK setup script asked me.

    Thank you very much again

    CCCCCCCC
    U-Boot SPL 2011.09 (Feb 09 2012 - 15:38:59)
    Texas Instruments Revision detection unimplemented
    OMAP SD/MMC: 0
    reading u-boot.img
    reading u-boot.img


    U-Boot 2011.09 (Feb 09 2012 - 15:11:31)

    I2C:   ready
    DRAM:  256 MiB
    WARNING: Caches not enabled
    Found a daughter card connected
    NAND:  HW ECC Hamming Code selected
    256 MiB
    MMC:   OMAP SD/MMC: 0
    Net:   cpsw
    Hit any key to stop autoboot:  0
    link up on port 0, speed 1000, full duplex
    BOOTP broadcast 1
    BOOTP broadcast 2
    DHCP client bound to address 11.0.0.138
    link up on port 0, speed 1000, full duplex
    Using cpsw device
    TFTP from server 11.0.0.1; our IP address is 11.0.0.138
    Filename 'uImage-am335x-evm.bin'.
    Load address: 0x82000000
    Loading: T
    TFTP error: 'File not found' (1)
    Not retrying...
    Wrong Image Format for bootm command
    ERROR: can't get kernel image!
    U-Boot# setenv serverip 11.0.0.139
    U-Boot# setenv bootargs 'console=ttyO0,115200n8 noinitrd rw root=/dev/nfs nfsroot=11.0.0.139:/home/user/ti-sdk-am335x-evm-05.04.00.00/targetNFS,nolock ip=dhcp
    U-Boot# tftp 0x82000000 uImage-am335x-evm.bin
    link up on port 0, speed 1000, full duplex
    Using cpsw device
    TFTP from server 11.0.0.139; our IP address is 11.0.0.138
    Filename 'uImage-am335x-evm.bin'.
    Load address: 0x82000000
    Loading: T #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #
    done
    Bytes transferred = 2995272 (2db448 hex)
    U-Boot# run net_args
    U-Boot# bootm 0x82000000
    ## Booting kernel from Legacy Image at 82000000 ...
       Image Name:   Arago/3.2/am335x-evm
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    2995208 Bytes = 2.9 MiB
       Load Address: 80008000
       Entry Point:  80008000
       Verifying Checksum ... OK
       Loading Kernel Image ... OK
    OK

    Starting kernel ...

    Uncompressing Linux... done, booting the kernel.
    [    0.000000] Linux version 3.2.0 (jenkins@sdit-build01) (gcc version 4.5.3 20110311 (prerelease) (GCC) ) #1 Sun Mar 25 16:21:58 CDT 2012
    [    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7d
    [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
    [    0.000000] Machine: am335xevm
    [    0.000000] Memory policy: ECC disabled, Data cache writeback
    [    0.000000] AM335X ES1.0 (sgx neon )
    [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 65024
    [    0.000000] Kernel command line: console=ttyO0,115200n8 root=/dev/nfs nfsroot=11.0.0.139:/home/user/ti-sdk-am335x-evm-05.04.00.00/targetNFS,nolock rw ip=dhcp
    [    0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)

    ...

    ***************************************************************
    ***************************************************************

     _____                    _____           _         _   
    |  _  |___ ___ ___ ___   |  _  |___ ___  |_|___ ___| |_
    |     |  _| .'| . | . |  |   __|  _| . | | | -_|  _|  _|
    |__|__|_| |__,|_  |___|  |__|  |_| |___|_| |___|___|_|  
                  |___|                    |___|            

    Arago Project http://arago-project.org am335x-evm ttyO0

    Arago 2011.09 am335x-evm ttyO0

    am335x-evm login:


  • Hi Fordfairlane,

    Have you tried these simple steps? You are using the variables that is the reason why things getting replaced (because of dhcp). Any way you resolved the problem.

    set autoload no

    set bootargs 'console=ttyO0,115200n8 noinitrd rw root=/dev/nfs nfsroot=<nfs server>:/home/user/ti-sdk-am335x-evm-05.04.00.00/targetNFS,nolock ip=dhcp earlyprintk' (nfs server means the file system located machine)

    set bootcmd 'dhcp; tftp 0x82000000 uImage-am335x-evm.bin;bootm 0x82000000'

    set serverip <tftp server ip> (contains the uImage-am335x-evm.bin)

    Note: Make sure that NFS server is running

    Regards

    AnilKumar

  • Hi Anil

    Yes, I tried, but it does not work because dhcp sets serverip to 11.0.0.1

    setenv bootcmd 'dhcp; tftp 0x82000000 uImage-am335x-evm.bin;bootm 0x82000000'

    Now there is a variable named bootcmd and contents 'dhcp; tftp 0x82000000 uImage-am335x-evm.bin;bootm 0x82000000'

    setenv serverip 11.0.0.139

    Now there is another variable named serverip and contents 11.0.0.139

    boot

    U-Boot executes the bootcmd variable:

    dhcp

    tftp 0x82000000 uImage-am335x-evm.bin

    bootm 0x82000000

    serverip=11.0.0.139 before boot, but it is 11.0.0.1 after dhcp and before tftp, so tftp tries to download the image from 11.0.0.1.

    Regards

  • I ran across this issue when setting up my environment for dev work on a AM437X Starter Kit. There are a number of posts that relate to this issue and I suspect that a few more people will run across this problem. I have a solution which feels less workaround-ish.

    As has been mentioned previously the problem arises because either the dhcp server is sending bootp/dhcp-boot parameters for tftp server settings or u-boot is interpreting something incorrectly about these settings.

    I performed a quick packet capture and I'm not sure I found anything specifically that showed my dhcp server sending tftp settings. I'm not an expert though so be that as it may. I suspect that u-boot is filling in some blanks here - possibly incorrectly or with incorrect assumptions.

    Anyway - on to the fix:

    in the SDK under bin/setup-uboot-env.sh on line 144 and 154 (or near there in case this file changes in new versions of the SDK) change the following:

    LINE 144:

    do_expect "\"U-Boot#\"" "send setenv bootcmd 'run findfdt; run getuenv; setenv autoload no;dhcp ; tftp \${loadaddr} $kernelimage; tftp \${fdtaddr} \${fdtfile}; run netargs; bootz \${loadaddr} - \${fdtaddr}'" $cwd/setupBoard.minicom

    AND LINE 154:

    do_expect "\"U-Boot#\"" "send setenv bootcmd 'run findfdt; run getuenv; setenv autoload no; dhcp ; tftp \${loadaddr} $kernelimage; tftp \${fdtaddr} \${fdtfile}; run mmcargs; bootz \${loadaddr} - \${fdtaddr}'" $cwd/setupBoard.minicom

    to:

    LINE 144:

    do_expect "\"U-Boot#\"" "send setenv bootcmd 'run findfdt; run getuenv; setenv autoload no;dhcp ;setenv serverip ${ipdefault}; tftp \${loadaddr} $kernelimage; tftp \${fdtaddr} \${fdtfile}; run netargs; bootz \${loadaddr} - \${fdtaddr}'" $cwd/setupBoard.minicom

    AND LINE 154:

    do_expect "\"U-Boot#\"" "send setenv bootcmd 'run findfdt; run getuenv; setenv autoload no; dhcp ; setenv serverip ${ipdefault}; tftp \${loadaddr} $kernelimage; tftp \${fdtaddr} \${fdtfile}; run mmcargs; bootz \${loadaddr} - \${fdtaddr}'" $cwd/setupBoard.minicom

    This will at least make sure that serverip gets set correctly after being changed from the dhcp command. It'd be great to see this incorporated into the SDK (or a better fix?) since it appears so many people have this problem and it doesn't appear to be caused by incorrect dhcp server settings.