Developping U-Boot standalone programs
From ArmadeusWiki
Introduction
Fed up with Linux tons of useful librairies, memory protection to avoid programs to crash your system and facilities to launch multiple executables at the same time ? Then U-Boot offers you the possibility to develop and run "standalone" applications inside U-Boot. Here you will learn how to get back hands on the possibility to crash your APF with your own software ;-).
Installation/Launching
- An example is compiled with U-Boot and you will find it in U-Boot sources at examples/standalone/hello_world.bin. Copy it to your /tftpboot/ directory:
$ . armadeus_env.sh $ cp $ARMADEUS_UBOOT_DIR/examples/standalone/hello_world.bin /tftpboot/
- In U-Boot, load the binary through TFTP:
BIOS> tftp ${loadaddr} hello_world.bin
- All Armadeus board's U-Boot are configured to generate standalone apps relocable to ${loadaddr}, thanks to CONFIG_STANDALONE_LOAD_ADDR config option. So don't load your program anywhere else unless you changed this option !!
- Then launch your program (here example is given on APF6 where loadaddr is 0x01200000. Explanation why loadaddr+0x1 is used as jump address is given [1]):
BIOS> go 0x01200001 (on APF6 only !!)
Developping your own app
- At first sight, all this might be considered as bare-metal development, but you will see that you are still closely linked to U-Boot and may even access to some (most ?!) of its useful API.
- For the moment we can only advise you to hack examples/standalone/hello_world.c in U-Boot sources...
- More to come soon...
Tips
- Showing assembler code of your app:
$ /xxx/buildroot/output/host/usr/bin/arm-linux-gnueabihf-objdump -d examples/standalone/hello_world