Using TFTP to load the kernel

When working with real hardware such as the BeagleBone Black, it is best to load the kernel over the network, especially when the root filesystem is mounted via NFS. In this way, you are not using any local storage on the device. It saves time if you don't have to keep re-flashing the memory and means that you can get work done while the flash storage drivers are still being developed (it happens).

U-Boot has supported the Trivial File Transfer Protocol (TFTP) for many years. Firstly, you need to install a tftp daemon on your development machine. On Ubuntu, you would install the tftpd-hpa package, which grants read access to files in the directory /var/lib/tftpboot to tftp clients like U-Boot.

Assuming that you have copied zImage and am335x-boneblack.dtb into /var/lib/tftpboot, enter these commands into U-Boot to load and boot:

setenv serverip 192.168.1.1
setenv ipaddr 192.168.1.101
tftpboot 0x80200000 zImage
tftpboot 0x80f00000 am335x-boneblack.dtb
setenv npath [path to staging]
setenv bootargs console=ttyO0,115200 root=/dev/nfs rw nfsroot=${serverip}:${npath} ip=${ipaddr}
bootz 0x80200000 - 0x80f00000

It is fairly common for the response to tftpboot to look like this:

setenv ipaddr 192.168.1.101
nova!> setenv serverip 192.168.1.1
nova!> tftpboot 0x80200000 zImage
link up on port 0, speed 100, full duplex
Using cpsw device
TFTP from server 192.168.1.1; our IP address is 192.168.1.101
Filename 'zImage'.
Load address: 0x80200000
Loading: T T T T

The row of T characters on the last line indicate that there is something wrong and the TFTP requests are timing out. The most common reasons are as follows:

  • Incorrect IP address for server.
  • TFTP daemon not running on server.
  • Firewall on server is blocking the TFTP protocol. Most firewalls do indeed block the TFTP port, 69, by default.

In this case, the tftp daemon was not running, so I started it with the following command:

$ sudo service tftpd-hpa restart
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.77.208