Accessing the MSP and PSP registers of the Cortex-M3 in C/C++ code using Keil's µVision
- by Captain NedD
I need to access the MSP and PSP registers (the main and process stack registers) of the Cortex-M3 processor.
I'm writing in C/C++.
The µVision and associated compiler doesn't let you do inline assembly for this Thumb-2 only core (and I'm not sure that'd be such a good idea anyway).
I need to do this so that I can extract the immediate value of an svc instruction regardless of whether it was executed while in thread or handler mode.
Thanks,