Loading RTEMS-application with U-boot on Raspberry Pi or MicroZed
Jan Sommer
soja-lists at aries.uberspace.de
Mon Apr 11 13:43:52 UTC 2016
TOFU:
I just tried the same setup with the Xilinx MicroZed board at work.
There, the same behaviour appears.
If I compile a simple bare metal application I can load the binary to
the correct address and run it or load the elf-file somewhere into the
memory and use the bootelf-command to start the application.
If I try to do the same with a compiled RTEMS-application, it won't
work. The same RTEMS-application runs if I put it directly into the
bootimage (without using u-boot).
How does it work on other ARM-boards? The BeagleBone uses u-boot to load
all its binaries, doesn't it?
Best regards,
Jan
Am 2016-04-07 00:33, schrieb Jan Sommer:
> Hello,
>
> I tried (and failed) again to start an RTEMS-application for the
> raspberry pi using u-boot.
> If I start the same binary file directly from the sd-card (i.e.
> renaming it to kernel.img) it works fine.
> In order to test my u-boot I compiled some of the baremetal programs
> from [1].
>
> There, I can load the binary directly to address 0x8000 and start it
> with go and I can load the elf-file somewhere into the memory (e.g.
> 0x100000) and use bootelf to run the program. Both works fine.
>
> However as soon as I try the same mechanisms with a similar
> RTEMS-application which simply blinks an LED the program never starts.
>
> If I look at the output of readelf for the RTEMS-program [2] I noticed
> that the entry point address is not 0x8000, but 0x8040.
> In comparison the elf-file of the baremetal program [3] has entry
> point address 0x8000 and under "Flags" it says "has entry point".
> I am not very experienced when it comes to linker scripts and
> elf-format, so I am not sure how to interpret all the different
> information. Am I on the right track at all here?
>
> Has someone else managed to run RTEMS-applications using u-boot (even
> on a different platform)?
>
> Best regards,
>
> Jan
>
>
> [1] https://github.com/dwelch67/raspberrypi
>
> [2] blinker-rtems/o-optimize$ arm-rtems4.12-readelf -e
> blinker-rtems.exe
> ELF Header:
> Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
> Class: ELF32
> Data: 2's complement, little endian
> Version: 1 (current)
> OS/ABI: UNIX - System V
> ABI Version: 0
> Type: EXEC (Executable file)
> Machine: ARM
> Version: 0x1
> Entry point address: 0x8040
> Start of program headers: 52 (bytes into file)
> Start of section headers: 3492848 (bytes into file)
> Flags: 0x5000200, Version5 EABI,
> soft-float ABI
> Size of this header: 52 (bytes)
> Size of program headers: 32 (bytes)
> Number of program headers: 4
> Size of section headers: 40 (bytes)
> Number of section headers: 34
> Section header string table index: 31
>
> Section Headers:
> [Nr] Name Type Addr Off Size ES Flg
> Lk Inf Al
> [ 0] NULL 00000000 000000 000000 00
> 0 0 0
> [ 1] .start PROGBITS 00008000 0000b4 000348 00 AX
> 0 0 4
> [ 2] .xbarrier PROGBITS 00000000 010640 000000 00 W
> 0 0 1
> [ 3] .text PROGBITS 00008348 0003fc 00ef88 00 WAX
> 0 0 4
> [ 4] .init PROGBITS 000172d0 00f384 000018 00 AX
> 0 0 4
> [ 5] .fini PROGBITS 000172e8 00f39c 000018 00 AX
> 0 0 4
> [ 6] .robarrier NOBITS 00017300 00f3b4 0e8d00 00 WA
> 0 0 1
> [ 7] .rodata PROGBITS 00100000 00f3c0 000c51 00 A
> 0 0 4
> [ 8] .ARM.exidx ARM_EXIDX 00100c54 010014 000008 00 AL
> 3 0 4
> [ 9] .eh_frame PROGBITS 00100c5c 01001c 000004 00 A
> 0 0 4
> [10] .init_array INIT_ARRAY 00100c60 010020 000004 00 WA
> 0 0 4
> [11] .fini_array FINI_ARRAY 00100c64 010024 000004 00 WA
> 0 0 4
> [12] .jcr PROGBITS 00100c68 010028 000004 00 WA
> 0 0 4
> [13] .rtemsroset PROGBITS 00100c6c 01002c 000038 00 WA
> 0 0 4
> [14] .rwbarrier PROGBITS 00100ca4 010640 000000 00 W
> 0 0 1
> [15] .vector NOBITS 00000000 0000b4 001440 00 WA
> 0 0 1
> [16] .data PROGBITS 00100ca8 010068 0005d8 00 WA
> 0 0 8
> [17] .bss NOBITS 00101280 010640 0018f0 00 WA
> 0 0 32
> [18] .work NOBITS 00102b70 010640 7ef9490 00
> WA 0 0 1
> [19] .stack PROGBITS 07ffc000 010640 000000 00 W
> 0 0 1
> [20] .nocachenoload PROGBITS 07ffc000 010640 000000 00 W
> 0 0 1
> [21] .comment PROGBITS 00000000 010640 000075 01 MS
> 0 0 1
> [22] .debug_aranges PROGBITS 00000000 0106b8 002cf8 00
> 0 0 8
> [23] .debug_info PROGBITS 00000000 0133b0 27217b 00
> 0 0 1
> [24] .debug_abbrev PROGBITS 00000000 28552b 03004c 00
> 0 0 1
> [25] .debug_line PROGBITS 00000000 2b5577 050cb6 00
> 0 0 1
> [26] .debug_frame PROGBITS 00000000 306230 0051c8 00
> 0 0 4
> [27] .debug_str PROGBITS 00000000 30b3f8 0152f2 01 MS
> 0 0 1
> [28] .debug_loc PROGBITS 00000000 3206ea 020a63 00
> 0 0 1
> [29] .debug_ranges PROGBITS 00000000 34114d 0059e0 00
> 0 0 1
> [30] .ARM.attributes ARM_ATTRIBUTES 00000000 346b2d 000036 00
> 0 0 1
> [31] .shstrtab STRTAB 00000000 354aa8 000148 00
> 0 0 1
> [32] .symtab SYMTAB 00000000 346b64 008ab0 10
> 33 1649 4
> [33] .strtab STRTAB 00000000 34f614 005494 00
> 0 0 1
> Key to Flags:
> W (write), A (alloc), X (execute), M (merge), S (strings)
> I (info), L (link order), G (group), T (TLS), E (exclude), x
> (unknown)
> O (extra OS processing required) o (OS specific), p (processor
> specific)
>
> Program Headers:
> Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg
> Align
> EXIDX 0x010014 0x00100c54 0x00100c54 0x00008 0x00008 R 0x4
> LOAD 0x0000b4 0x00000000 0x00000000 0x00000 0x01440 RW 0x1
> LOAD 0x0000b4 0x00008000 0x00008000 0x0f300 0xf8000 RWE 0x4
> LOAD 0x00f3c0 0x00100000 0x00100000 0x01280 0x7efc000 RW
> 0x20
>
> Section to Segment mapping:
> Segment Sections...
> 00 .ARM.exidx
> 01 .vector
> 02 .start .text .init .fini .robarrier
> 03 .rodata .ARM.exidx .eh_frame .init_array .fini_array .jcr
> .rtemsroset .data .bss .work
>
> ============================================================================
>
> [3] blinker02/plus$ arm-none-eabi-readelf -e blinker02.elf
> ELF Header:
> Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
> Class: ELF32
> Data: 2's complement, little endian
> Version: 1 (current)
> OS/ABI: UNIX - System V
> ABI Version: 0
> Type: EXEC (Executable file)
> Machine: ARM
> Version: 0x1
> Entry point address: 0x8000
> Start of program headers: 52 (bytes into file)
> Start of section headers: 33424 (bytes into file)
> Flags: 0x5000202, has entry point,
> Version5 EABI, soft-float ABI
> Size of this header: 52 (bytes)
> Size of program headers: 32 (bytes)
> Number of program headers: 1
> Size of section headers: 40 (bytes)
> Number of section headers: 7
> Section header string table index: 4
>
> Section Headers:
> [Nr] Name Type Addr Off Size ES Flg
> Lk Inf Al
> [ 0] NULL 00000000 000000 000000 00
> 0 0 0
> [ 1] .text PROGBITS 00008000 008000 0000bc 00 AX
> 0 0 4
> [ 2] .ARM.attributes ARM_ATTRIBUTES 00000000 0080bc 00002b 00
> 0 0 1
> [ 3] .comment PROGBITS 00000000 0080e7 000038 01 MS
> 0 0 1
> [ 4] .shstrtab STRTAB 00000000 00811f 00003a 00
> 0 0 1
> [ 5] .symtab SYMTAB 00000000 00815c 0000f0 10
> 6 10 4
> [ 6] .strtab STRTAB 00000000 00824c 000043 00
> 0 0 1
> Key to Flags:
> W (write), A (alloc), X (execute), M (merge), S (strings)
> I (info), L (link order), G (group), T (TLS), E (exclude), x
> (unknown)
> O (extra OS processing required) o (OS specific), p (processor
> specific)
>
> Program Headers:
> Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg
> Align
> LOAD 0x000000 0x00000000 0x00000000 0x080bc 0x080bc R E
> 0x10000
>
> Section to Segment mapping:
> Segment Sections...
> 00 .text
>
> _______________________________________________
> users mailing list
> users at rtems.org
> http://lists.rtems.org/mailman/listinfo/users
More information about the users
mailing list