Reputation: 1765
I was reading this:
https://balau82.wordpress.com/2010/03/10/u-boot-for-arm-on-qemu/
Baremtal programming
QEMU + baremetal application (Makefile below):
prepimg:
~/Downloads/gcc-arm-none-eabi-5_4-2016q3/bin/arm-none-eabi-as -g comm.ml -o comm.o
~/Downloads/gcc-arm-none-eabi-5_4-2016q3/bin/arm-none-eabi-ld -T test.ld comm.o -o test.elf
~/Downloads/gcc-arm-none-eabi-5_4-2016q3/bin/arm-none-eabi-objcopy -O binary test.elf test.bin
mkimg:
mkimage -A arm -C none -T kernel -O linux -d test.bin -a 0x0010000 -e 0x0010000 test.uimg
launch_test:
qemu-system-arm -m 128M -M vexpress-a9 -nographic -monitor telnet:127.0.0.1:1234,server,nowait -kernel test.uimg
It works. Code is executed at the correct address (r15 proves it).
QEMU + baremetal + U-boot
prepimg:
~/Downloads/gcc-arm-none-eabi-5_4-2016q3/bin/arm-none-eabi-as -g comm.ml -o comm.o
~/Downloads/gcc-arm-none-eabi-5_4-2016q3/bin/arm-none-eabi-ld -T test.ld comm.o -o test.elf
~/Downloads/gcc-arm-none-eabi-5_4-2016q3/bin/arm-none-eabi-objcopy -O binary test.elf test.bin
mkimg:
mkimage -A arm -C none -T kernel -O linux -d test.bin -a 0x0010000 -e 0x0010000 test.uimg
cat_them:
cat u-boot-2016.07/u-boot test.uimg > u-boot-2016.07/flash.bin
launch_qemu:
qemu-system-arm -m 128M -M vexpress-a9 -nographic -monitor telnet:127.0.0.1:1234,server,nowait -kernel u-boot-2016.07/flash.bin
Then, I get:
Wrong Image Format for bootm command
ERROR: can't get kernel image!
I don't know what is going on.
Upvotes: 1
Views: 1262