Tuesday, September 3, 2019

Linux: Implementing tftpboot with Linux u-boot

If your u-boot is not running tftpboot, for any reason as is the case with my board, you can always fool it into doing tftpboot for you by leveraging the run support in the u-boot bootloader.

U-boot is a very popular bootloader and you can learn more about it here: http://www.denx.de/wiki/U-Boot

Here is the trick to implement it:
setenv bootcmd 'dhcp; run cmd'
setenv cmd 'tftp LOADADDR PATH_TO_TFTPIMAGE'

 In the above set of commands you will have to replace LOADADDR with the correct address in memory where you want to load the image. The PATH_TO_TFTPIMAGE is the path to the image on the tftpserver.


You will also need to set the serverip:

setenv serverip IPADDR

Finally, save the environment

savenv
reset
These should work.

 Try the commands at your own risk. All info is provided for educational purposes only.