September 14, 2018

The Nanopi Fire3 - Configuring U-Boot for network booting

I tried this over a month ago, with no success. The standard Friendly Arm U-Boot had no network support whatever. After quite a lot of work (described elsewhere), I got a version of U-Boot for the Samsung Artik 710 configured with a working network driver, and this note describes the process of configuring that U-Boot to network boot binary files.
artik710# version

U-Boot 2016.01-00004-g860b3724b5-dirty (Sep 14 2018 - 13:30:17 -0700)
aarch64-linux-gnu-gcc (GCC) 7.2.1 20170915 (Red Hat Cross 7.2.1-1)
GNU ld version 2.29.1-1.fc27
I added the DHCP option to the configuration file as the last step of rebuilding the above. Now the game is as follows: For some reason this build of U-Boot has different ideas about double quotes on command definitions and semicolons between commands on a single line. Double quotes must be avoided and semicolons must be escaped with a backslash. With this in mind, the following commands add environment variables that do what we want:
setenv bootaddr 0x40000000
setenv boot_kyu echo Booting Kyu via dhcp \; dhcp ${bootaddr} \; go ${bootaddr}
setenv bootcmd run boot_kyu
saveenv
This can be tested as follows:
run bootcmd
Booting Kyu via dhcp
Speed: 1000, full duplex
BOOTP broadcast 1
DHCP client bound to address 192.168.0.67 (1 ms)
Using ethernet@c0060000 device
TFTP from server 192.168.0.5; our IP address is 192.168.0.67
Filename 'fire3.bin'.
Load address: 0x40000000
Loading: #
	 654.3 KiB/s
done
Bytes transferred = 4696 (1258 hex)
## Starting application at 0x40000000 ...

Hello world
It works fine!


Have any comments? Questions? Drop me a line!

Tom's electronics pages / [email protected]