Test tftp connection in u-boot

Hello,

is it possible to detect working tftp transfer via U-Boot scripts ? (something like test -e usb 0:1 updateMe)

Background:

i want to change bootorder to tftp/nfs; usb; emmc. If tftp transfer fails (Timeout), it stay there and wait for connection (Loading: T T T T).

Best regards

Lars

Hi Lars

You’re trying something unusual.
Maybe you could try to ping the server before starting the TFTP transaction, however there is also a seconds long timeout in which U-Boot waits for the answer to ping.
E.g. with echo as a surrogate to tftpboot:

Colibri iMX6 # ping 192.168.10.100 && echo up
Using FEC device
ping failed; host 192.168.10.100 is not alive

Colibri iMX6 # ping 192.168.10.1 && echo up
Using FEC device
host 192.168.10.1 is alive
up

Additionally you could break the restart loop:

Colibri iMX6 # setenv netretry once

Additionally you could influence the timeout counts by changing the U-Boot configuration and recompile.

Regards
Max

You can make a test with ping to verify that the host is alive, positive ae case forward if it fails go to the next boot.

Update variable environment U-boot bootcmd for this, something like:

setenv trytftp ping 192.168.0.1

setenv bootcmd if run tryftp; then "COMMAND TFTP BOOT"; else "OTHER BOOT; fi;

Then of course save this changes if it works with saveenv.

I not tested, but I have done something and it worked fine.


Cleiton Bueno

Blog | Linkedin | B2Open