jeudi 2 juillet 2015

ARM bare metal (no OS), Eclipse, GDB and Segger J-Link

This is my first question on stackoverflow, so I'll give some background info. I have some experience with Cortex-M development and I'm now discovering Cortex-A8. I'm interessed in bare-metal programming without any OS running on the device. I'm comfortable with C and especially C++.

In contrast to the Cortex-M devices I used (Atmel SAM4s), which have flash memory to store exectuable code, the Cortex-A8 (TI AM3358) uses its own ROM code to boot. This rom code is responsible for loading code for a second boot step into on-chip RAM and executing this code. This second step usualy sets up peripherals etc, initializes external devices (external DDR3 memory), loads final code into this DDR3 memory and jumps to the entry point of this final code.

I'm using Eclipse with GNU bare metal ARM toolchain on Windows 8.1 machine, and have a SEGGER J-Link to debug on the real hardware (Beaglebone Black).

When I run/debug the second bootloader step (in the embedded RAM) everything works fine, I'm able to initialize the external DDR3 memory.

When I try to load executable code into the DDR3 memory things goes wrong : I'm unable to make this work.

After rethinking, I Think I need some kind of script to: 1) load the second bootloader's executable code into embedded RAM and execute it (initialize peripherals and DDR3 memory) 2) at the end of step 1), break into the debugger to load the executable code into DDR3 memory 3) set the programm counter to the entry point of the executable in DDR3 and start executing these code.

On the SAM4s I have worked with Atmels EDBG debugging tool, so I don't have experience with configuring and setting up the SEGGER J-Link to control this booting process. What I need is more info on how I can accomplish this tasks : Load the second boot step into embedded RAM (file MLO.elf) Execute this code At the end of this code, break into the debugger to load the target code into DDR3 memory (Kernel.elf) Jump to the entry point of the target code without resetting the SoC.

Any help on this is very welcome.

Thanks, Paul

Aucun commentaire:

Enregistrer un commentaire