U-Boot

Environment Variables

To print an environment variable, use the printenv command:

To set an environment variable, use the setenv command:

You don’t actually need the equals sign! This works also:

If you want to set a variable to something which includes special characters, such as spaces or semi-colons, you can enclose the value in single quotes:

The above variable, when executed, runs several commands.

Booting Via TFTP

TFTP is a great way to boot Linux on your board when developing, because it is quick and requires no physical medium to be moved from your computer to the board (unlike the SD card option).

Setting TFTP Up On Development Computer

This following guide assumes you are running Ubuntu (this was tested on Ubuntu v14.04 64-bit):

Install the following packages:

Create a file called /etc/xinetd.d/tftp and save the text below inside it:

Create a folder called /ftpboot:

Restart the TFTP server:

The TFTP server should now be up and running!

Setting TFTP Up On Embedded Device

U-Boot needs to be told about the address of the TFTP server (this will be the IP address of your computer you are building the Linux image on):

We normally want to disable autoload, as this causes U-Boot to try and automatically download an image and boot from it as soon as we type dhcp:

Then we can force U-Boot to look for a DHCP server and request an IP address:

We can then use tftpload commands to download files over TFTP and place them at specific locations in memory.