ISR Epilogue/Prologue (Cortex M3)
Posted: Thu Apr 10, 2014 8:06 pm
Do the epilogue (blank, so not really relevant) and prologue for an ISR need to be at the naked ISR level? I'm using a Cortex M3 that has some vendor provided and automatically generated code for the interrupt handlers that I am trying to avoid modifying, and I've put my epi/pro calls one call frame down from the naked ISR. I'm also seeing a very intermittent crash related to interrupts that I haven't been able to figure out, so I'm wondering if I've broken the rules.
The crash I'm seeing is two-fold: I get a Hard Fault (the actual fault varies), and it ultimately traces back to the context switch routine. This leads me to believe that a thread's context is getting totally hosed. The main stack pointer is invalid at the start of the fault. I've checked and no code modifies the MSP register other than the startup code, so there must be code running in an interrupt context that modifies the stack pointer.
I just want to make sure I'm not doing something that is known to be wrong.
The crash I'm seeing is two-fold: I get a Hard Fault (the actual fault varies), and it ultimately traces back to the context switch routine. This leads me to believe that a thread's context is getting totally hosed. The main stack pointer is invalid at the start of the fault. I've checked and no code modifies the MSP register other than the startup code, so there must be code running in an interrupt context that modifies the stack pointer.
I just want to make sure I'm not doing something that is known to be wrong.