Loading...
 

Booting initramfs image via TFTP

This page will show you how to setup a TFTP server on your local Linux machine and boot images via TFTP. Trivial File Transfer Protocol (TFTP) is a simple File Transfer Protocol for transferring files onto a remote host. The protocol is primarily used in early stages of nodes booting from a local network.

Example covered in this tutorial shows how to transfer an OpenWrt initramfs image (generated in Build From Source - OpenWrt) from a local Linux machine (host) to the client (ESPRESSObin board). Steps related to setting up a TFTP server and transferring images to ESSPRESSObin from it via local network work for other uses as well.

Requirements:

  • initramfs image and dtb file (openwrt-armada-ESPRESSObin-Image-initramfs and armada-3720-community.dtb)
  • Installed TFTP server
  • Both the host (laptop) and the client (board) connected to the same IP switch or router (that is, they both must be on the same subnet).


To setup TFTP on your Linux machine, install tftp-hpa package (the package name might differ depending on your distribution so check your distribution's official documentation).

Server


Navigate to where the initramfs image and dtb files are located (bin/mvebu64/ directory) and start the TFTP server:

espressobin@buildserver:~/bin/mvebu64/$ sudo in.tftpd -L -s .

 

Client


Connect via serial (see section Serial Connection in Quick User Guide) to the ESPRESSObin board. When the boot starts, hit any key to stop autoboot and you should get to the Marvell prompt:

Hit any key to stop autoboot:
Marvell>>


Here, we must set the correct IP addresses of the TFTP server and of the ESPRESSObin board. If, for example, the IP address of the Linux machine (TFTP server) is 192.168.50.100 we must set it so in the U-Boot using setenv serverip:

Marvell>> setenv serverip 192.168.50.100


and we set the IP address of the ESPRESSObin board to an address in the same subnet (e.g. 192.168.50.120) using setenv ipaddr:

Marvell>> setenv ipaddr 192.168.50.120


If we run printenv, we will see that these values were added/changed (truncated output):

Marvell>> printenv
...
serverip=192.168.50.100
ipaddr=192.168.50.120
...


Now we must define the memory location where to transfer the images (you will see the images downloading):

Marvell>> tftpboot 0x200000 openwrt-armada-ESPRESSObin-Image-initramfs
Marvell>> tftpboot 0x2000000 armada-3720-community.dtb


The tftpboot command is used to boot image via network using TFTP protocol. Lastly we boot using the booti command and specifying the defined memory locations for initramfs and dtb file:

Marvell>> booti 0x200000 - 0x2000000

 

The second argument '-' implies that we boot the kernel without an initrd image (see 'help booti' for more info). If all went well, OpenWrt should start booting on your ESPRESSObin.

Troubleshooting

 

eth0 link down
FAIL
dup 1 speed 1000
Using eth1 device
TFTP from server 192.168.0.231; our IP address is 192.168.0.50
Load address: 0xa0800000
Loading: T T T T


this is a timeout waiting for the link to come up. Potential problems causing this issue:

  • Check that the name of the images are spelled correctly.
  • Check that the server and/or client IP are set correctly.
  • Check that the TFTP server is running on the laptop/PC.
  • Check that the image exists (although then you should see a "no such file" error).
  • Check that the Ethernet cables are plugged in correctly.
  • Check that the connection is alive by trying to ping the devices.
  • Check if your firewall is blocking traffic on port 69.