Hello,
I’m porting my RTOS from Atollic to VisualGDB and I face an issue.
I use SVC to call OS features, and use the stack R0, R1, R2 and R3 to pass parameters.
The ISR Handler has a few lines of asm code to get the stack pointer and the SVC parameter and pass it to the C++ function that will do the actual job.
Calling this C++ function from ASM, I rely on the calling convention to get the correct parameters (by convention, first param in R0, then R1, then R2, return value in R0).
Just before the C++ function is called I can see in the registers I have the correct values, but when I step into the C++ function, the debugger tells me the parameters are totally messed up, obviously not taking values from R0, R1 and R2, but from other registers or stack.
Is this normal behavior (it was working fine on Atollic, which is using GCC ARM too …), and if so is there a way to force the compiler to take the parameters from the registers ?
Thomas.