I'm trying to chase a problem which I think is caused by stack corruption within an ISR - the ISR never returns to non-ISR mode as expected.
To try and get to the bottom of this, I've been trying to understand the call frame generated on ISR entry, but I'm struggling. From what I can glean the call frame is composed of the PC and SR when the ISR is triggered, any ISR local variables the compiler decides to store on the stack, and the values of a set of registers that need to be recovered on RETI, but the actual extent is totally determined by what the compiler determines it needs. Is there any way other than the disassembled code to see the extent of the call frame, and exactly what will be pushed and popped? I have found slaa140 which gives a somewhat conceptual overview of how call frames are structured - is there anything more available anywhere?
Code Composer is able to generate a call hierarchy without (presumably) access to the underlying stack operations. This makes me think there is some metadata buried in the call frames that I am missing (maybe some sort of frame pointer?). Just how does CCS walk the stack to produce the call hierarchy?
The code is all generated by GCC. Thanks for any insights or pointers.
Andrew