Dear All.
I am trying to back trace and get the call of faulty application after getting an exception, in this i need to update SP from HardFault Handler.
I tried in many way like "MOV SP, Rn" , "MSR SP, Rn" and etc but finally ended up with either Compilation error or Lockup state after execution of this instruction.
Already I've updated PSP from Handler, but i need to change SP to get called stack frames.
Please help me to do this.
Regards,
Deepak
$> armasm --version_number↵
6120001
I don't get any error with "254 0000002A 4685 MOV SP, R0 ;set SP" but it fails to move R0 into SP while execution.
replacing line no 254 with "MSR SP, R0" gives error,
with this way i want to move R0 into SP register, is it right?
Hi Deepak,
For MSR instruction, you need to use either MSP / PSP / MSP_NS / PSP_NS.
Since the processor is in Handler mode (using MSP), you could write it as
MSR MSP, r0
regards,
Joseph
Thanks a lot.