Re:stack pointer access?
Thanks ravaz,
I think your suggestion takes me in a new direction. Although I use the IAR C compiler, so I'd have to try somethig like:
__asm ("ldr R4, [SP,#24]");
to get the same result. Is MRS a thumb command? Is it supported by the cortex M3?
Though I did try the above in a serial port ineterrupt service routine, but the printout is 0x0, so that must not be correct. Basically I want to send a character to the mcu, which causes an interrupt, so the PC is saved and branges to the interrupt handler, then the handler finds that saved PC and prints it out to the serial port so I can find out where the PC was before the interrupt. Havn't gotten it yet so still open to suggestions...
by the way, wouldn't the code be:
mrs psp,r0 as opposed to msr psp,r0
How would I check to see which stack the user code is using?
Thanks agian for any help.
Brian
login or register to reply
|