arm: hello_world example application not working on RPI1

Patrick Zacharias littlefighter19 at web.de
Tue Oct 25 18:06:13 CEST 2022


Hello,

I tried getting examples/standalone/hello_world to run as of
1e892ef0b59a4a04971ac23619b95917020b3e18

I installed the Ubuntu (20.04 LTS) ARM toolchain (I tried it with a
Linaro toolchain as well) and built the source code using

"make rpi_defconfig"

Afterwards, I used menuconfig to enable the build of the examples.

I created a boot.scr file using following script:

"fatload mmc 0:1 $loadaddr /uEnv.txt
env import -t $loadaddr $filesize
run bootcmd"

and converted it using mkimage.

The content of the uEnv.txt is as following:

"bootcmd=mmc rescan; echo Test ${loadaddr} end; load mmc 0:1 0x0c100000
hello_world.bin; go 0x0c100000"

I copied u-boot.bin, boot.scr and uEnv.txt to the SD card (over the
existing parition created by Raspbian). And adjusted the config.txt to read:

"kernel=u-boot.bin"

U-Boot shows up, however after the program loaded (and go is executed),
the Raspberry Pi freezes.

I tried this with tftp as well and with and without ELF files (using
"bootelf"). The result remains the same.

Booting the EFI applications using "bootefi" works.

Additionally, when trying to build U-Boot using clang-12, I ran into two
errors.

The first one was in arch/arm/lib/relocate.S,
where it complains about the symbol "relocate_vectors" first being
declared as weak, then again as global.

"error: relocate_vectors changed binding to STB_GLOBAL"

To fix this, I removed the .weak line and renamed ENTRY to WEAK.

Afterwards, U-Boot itself built, but the hello_world application didn't
find any of the exported functions. (EXPORT_FUNC is probably just a stub
for clang?)

Greetings,
Patrick


More information about the U-Boot mailing list