I am trying to write an assembly function for an arm-v7-m cortex-m4 processor. I am using the eclipse IDE with the gnu arm compiler (arm-none-eabi). To compile the .S file, in my 'project properties', I have set the target processor arm family to cortex m4, appended '--specs=rdimon.specs' to the gnu arm linker and '-g -gstabs' to the gnu arm assembler. The code compiles successfully and generates an executable. Please note that I have used an empty C/C++ project rather than the STM32F4-Discovery template:
.syntax unified
.thumb
.text
.global main
.balign 4
.thumb_func
.type main, %function
main: MOV r0, #28 @1st argument;
MOV r1, #21 @ 2nd argument;
ADD r2, r1, r0
stop: BAL stop
.end
To check the registers, I put a breakpoint on the ADD line.
I use gdb-qemu-armeclipse debugging in my debug configuration, with the xpacks/.bin path selected. I have selected the STM32F4-Discovery board with STM32F407VG as the device name. The qemu program starts successfully, but I cannot use the debugger: the stepping options and stuff are all grayed out. I would gladly appreciate any suggestions to rectify this issue. Thanks in advance
UPDATE: When I have the "Debug in RAM" RunTime Option selected in the startup options, I get to see the code running correctly and the registers updated. Things start going south once I hit the infinite 'stop' loop