Uboot Stand Alone Application Apalis + imx6

Hi all!

I’m trying to make a uboot stand alone application following manual items (5.12.1 e 5.12.3) without success.


I’m using yocto:

bitbake u-boot-toradex

Generating hello_world , hello_world.bin , hello_world.srec files automatically in u-boot/apalis_imx6_it_defconfig/examples/standalone folder.

I’ve used lots of configs combination because I don’t know correct memory entry point and load address.

The files are saved in pendrive and I’m using the following commands :

usb start fatload usb 0:0 0x12000000 hello_world.bin go 0x12000000

## Starting application at 0x12000000 ... undefined instruction pc : [<8df58bc4>]          lr : [<8ff5f29b>] ..........

Following manual item 5.12.3 , I’ve also created an image file from executable ELF hello_world:

../../tools/mkimage -A arm -T standalone -C none -a 0x0c100000 -e 0x0c100000 -n hello_world -d hello_world hello_world.img

Resulting in:

Image Name:   hello_world Created:     Tue Jun 13 18:30:14 2017 Image Type:   ARM Linux Standalone Program (uncompressed) Data Size:    546 Bytes
= 0.53 kB = 0.00 MB Load Address: 0c100000 Entry Point:  0c100000

fatload usb 0:0 0x12000000 hello_world.img reading hello_world.img 73232 bytes read in 32 ms (2.2 MiB/s) ART HMI # bootm 12000000
## Booting kernel from Legacy Image at 12000000 ...    Image Name:   hello_world    Image Type:   ARM Linux Standalone Program (uncompressed)    Data Size:    73168 Bytes = 71.5 KiB   Load Address: 0c100000    Entry Point: 0c100000    Verifying Checksum ... OK  Loading Standalone Program ...

After that it returns to u-boot without executing the program.

How can I proceed?
Which are the correct addresses to use for load and execution entry point ?

Appreciate any tips!


I tried to use the hello_world standalone application with similar results.

The entry point used is defined in arch/arm/config.mk CONFIG_STANDALONE_LOAD_ADDR.
Changing that to $(CONFIG_LOADADDR) is probably a more universal setting.

After changing that the standalone application still fails. I found that to be caused by the i.MX6 SPL and U-Boot being compiled for the thumb instruction set, but the go command jumping in a way which requires the entry point to have ARM instructions.

That could be overcome with a small assembler intro in the standalone application which calls the real entry point in a way dependent on the then known instruction set.

Finally I found that when switching back to ARM instruction set that the binary failed for reason still unknown to me. Adding an initialized variable did work around that issue. While I didn’t see this when compiling for thumb it may be a hidden bug and with a slight change in code it may pop up. So adding such a variable is probably a good thing to do.
(I suspect the __bss_start symbol which is not aligned to 4 byte in the ARM binary to be the culprit, adding that variable aligns that)
(Instruction set is forced to thumb mode with CONFIG_SYS_THUMB_BUILD in include/configs/apalis_imx6.h,

The following three patches address the issues.