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 300verbose onexpect { "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.4OPCIONES: I18n Compilado en Jan 25 2010, 06:49:09.Port /dev/ttyS0Presione CTRL-A Z para obtener ayuda sobre teclas especiales
CCCCCCCCU-Boot SPL 2011.09 (Feb 09 2012 - 15:38:59)Texas Instruments Revision detection unimplementedOMAP SD/MMC: 0reading u-boot.imgreading u-boot.imgU-Boot 2011.09 (Feb 09 2012 - 15:11:31)I2C: readyDRAM: 256 MiBWARNING: Caches not enabledFound a daughter card connectedNAND: HW ECC Hamming Code selected256 MiBMMC: OMAP SD/MMC: 0Net: cpswHit any key to stop autobo 0 U-Boot#setenv serverip 11.0.0.139U-Boot#setenv rootpath /home/user/ti-sdk-am335x-evm-05.04.00.00/targetNFSU-Boot#setenv bootfile uImage-am335x-evm.binU-Boot#setenv ip_method dhcpU-Boot#setenv bootcmd 'setenv autoload no;dhcp ${bootfile};tftp ${loadaddr} ${bootfile};run net_args;bootm ${loadaddr}'U-Boot#saveenvSaving Environment to NAND...Erasing Nand...Erasing at 0x260000 -- 100% complete.Writing to Nand... doneU-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.4OPCIONES: I18n Compilado en Jan 25 2010, 06:49:09.Port /dev/ttyS0Presione CTRL-A Z para obtener ayuda sobre teclas especialesCCCCCCCCU-Boot SPL 2011.09 (Feb 09 2012 - 15:38:59)Texas Instruments Revision detection unimplementedOMAP SD/MMC: 0reading u-boot.imgreading u-boot.imgU-Boot 2011.09 (Feb 09 2012 - 15:11:31)I2C: readyDRAM: 256 MiBWARNING: Caches not enabledFound a daughter card connectedNAND: HW ECC Hamming Code selected256 MiBMMC: OMAP SD/MMC: 0Net: cpswHit any key to stop autoboot: 0 link up on port 0, speed 1000, full duplexBOOTP broadcast 1BOOTP broadcast 2DHCP client bound to address 11.0.0.138link up on port 0, speed 1000, full duplexUsing cpsw deviceTFTP from server 11.0.0.1; our IP address is 11.0.0.138Filename 'uImage-am335x-evm.bin'.Load address: 0x82000000Loading: T TFTP error: 'File not found' (1)Not retrying...Wrong Image Format for bootm commandERROR: can't get kernel image!U-Boot#
I do some checks:
U-Boot# printenvautoload=nobaudrate=115200bootargs=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=dhcpbootargs_defaults=setenv bootargs console=${console} ${optargs}bootcmd=setenv autoload no;dhcp ${bootfile};tftp ${loadaddr} ${bootfile};run net_args;bootm ${loadaddr}bootdelay=3bootenv=uEnv.txtbootfile=uImage-am335x-evm.binconsole=ttyO0,115200n8dnsip=11.0.0.1ethact=cpswethaddr=d4:94:a1:91:6b:aagatewayip=11.0.0.1importbootenv=echo Importing environment from mmc ...; env import -t $loadaddr $filesizeip_method=dhcpipaddr=11.0.0.138kloadaddr=0x80007fc0loadaddr=0x82000000loadbootenv=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=0mmc_load_uimage=fatload mmc ${mmc_dev} ${kloadaddr} ${bootfile}mmc_root=/dev/mmcblk0p2 rwmmc_root_fs_type=ext3 rootwaitnand_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=0x500000nand_root=ubi0:rootfs rw ubi.mtd=7,2048nand_root_fs_type=ubifs rootwait=1nand_src_addr=0x280000net_args=run bootargs_defaults;setenv bootargs ${bootargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=dhcpnet_boot=echo Booting from network ...; setenv autoload no; dhcp; tftp ${kloadaddr} ${bootfile}; run net_args; bootm ${kloadaddr}netmask=255.255.255.0nfsopts=nolocknor_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=0x280000nor_root=/dev/mtdblock3 rwnor_root_fs_type=jffs2nor_src_addr=0x08080000rootpath=/home/user/ti-sdk-am335x-evm-05.04.00.00/targetNFSscript_addr=0x81900000serverip=11.0.0.1spi_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=0spi_img_siz=0x280000spi_root=/dev/mtdblock4 rwspi_root_fs_type=jffs2spi_src_addr=0x62000static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::offstderr=serialstdin=serialstdout=serialEnvironment size: 2762/8188 bytes
nfsroot and serverip are wrong, correct it:
U-Boot# setenv serverip 11.0.0.139U-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 rwU-Boot# saveenvSaving Environment to NAND...Erasing Nand...Erasing at 0x260000 -- 100% complete.Writing to Nand... doneU-Boot# printenvautoload=nobaudrate=115200bootargs=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=dhcpbootargs_defaults=setenv bootargs console=${console} ${optargs}bootcmd=setenv autoload no;dhcp ${bootfile};tftp ${loadaddr} ${bootfile};run net_args;bootm ${loadaddr}bootdelay=3bootenv=uEnv.txtbootfile=uImage-am335x-evm.binconsole=ttyO0,115200n8dnsip=11.0.0.1ethact=cpswethaddr=d4:94:a1:91:6b:aagatewayip=11.0.0.1importbootenv=echo Importing environment from mmc ...; env import -t $loadaddr $filesizeip_method=dhcpipaddr=11.0.0.138kloadaddr=0x80007fc0loadaddr=0x82000000loadbootenv=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=0mmc_load_uimage=fatload mmc ${mmc_dev} ${kloadaddr} ${bootfile}mmc_root=/dev/mmcblk0p2 rwmmc_root_fs_type=ext3 rootwaitnand_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=0x500000nand_root=ubi0:rootfs rw ubi.mtd=7,2048nand_root_fs_type=ubifs rootwait=1nand_src_addr=0x280000net_args=run bootargs_defaults;setenv bootargs ${bootargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=dhcpnet_boot=echo Booting from network ...; setenv autoload no; dhcp; tftp ${kloadaddr} ${bootfile}; run net_args; bootm ${kloadaddr}netmask=255.255.255.0nfsopts=nolocknor_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=0x280000nor_root=/dev/mtdblock3 rwnor_root_fs_type=jffs2nor_src_addr=0x08080000rootpath=/home/user/ti-sdk-am335x-evm-05.04.00.00/targetNFSscript_addr=0x81900000serverip=11.0.0.139spi_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=0spi_img_siz=0x280000spi_root=/dev/mtdblock4 rwspi_root_fs_type=jffs2spi_src_addr=0x62000static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::offstderr=serialstdin=serialstdout=serial
Now I think everything is OK, try boot again:
U-Boot# bootlink up on port 0, speed 1000, full duplexBOOTP broadcast 1BOOTP broadcast 2DHCP client bound to address 11.0.0.138link up on port 0, speed 1000, full duplexUsing cpsw deviceTFTP from server 11.0.0.1; our IP address is 11.0.0.138Filename 'uImage-am335x-evm.bin'.Load address: 0x82000000Loading: T TFTP error: 'File not found' (1)Not retrying...Wrong Image Format for bootm commandERROR: 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?
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
CCCCCCCCU-Boot SPL 2011.09 (Feb 09 2012 - 15:38:59)Texas Instruments Revision detection unimplementedOMAP SD/MMC: 0reading u-boot.imgreading u-boot.imgU-Boot 2011.09 (Feb 09 2012 - 15:11:31)I2C: readyDRAM: 256 MiBWARNING: Caches not enabledFound a daughter card connectedNAND: HW ECC Hamming Code selected256 MiBMMC: OMAP SD/MMC: 0Net: cpswHit any key to stop autoboot: 0 link up on port 0, speed 1000, full duplexBOOTP broadcast 1BOOTP broadcast 2DHCP client bound to address 11.0.0.138link up on port 0, speed 1000, full duplexUsing cpsw deviceTFTP from server 11.0.0.1; our IP address is 11.0.0.138Filename 'uImage-am335x-evm.bin'.Load address: 0x82000000Loading: T TFTP error: 'File not found' (1)Not retrying...Wrong Image Format for bootm commandERROR: can't get kernel image!U-Boot# setenv serverip 11.0.0.139U-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=dhcpU-Boot# tftp 0x82000000 uImage-am335x-evm.binlink up on port 0, speed 1000, full duplexUsing cpsw deviceTFTP from server 11.0.0.139; our IP address is 11.0.0.138Filename 'uImage-am335x-evm.bin'.Load address: 0x82000000Loading: T ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# #doneBytes transferred = 2995272 (2db448 hex)U-Boot# run net_argsU-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 ... OKOKStarting 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 ttyO0Arago 2011.09 am335x-evm ttyO0am335x-evm login:
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.
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.