I need to edit the return address of an ISR. The ISR should return to a specific address after the interrupt is handled, regardless of where it came from. This is to facilitate a fast system reset. This functionality can't be implemented in the normal firmware as timing is too tight to check a flag somewhere frequently.
I've tried editing the stack frame that is saved by the ISR upon exception entry, which seems to work for a few milliseconds, then it enters the micro's "Oh shit something went bad" state. In this state, the stack looks normal, and there are no signs that anything went wrong. This occurs even if I pop the stack and push exactly the same data back onto it. Also, using a stack-pointer-relative store causes this failure.
Info about exception handling can be found here, but I can't find enough info to tell me whats going wrong.
Ideas? I really just need to get the interrupt to return to the same label regardless of where the interrupt hits, and without the core getting all fussy.
Thanks, Stuart