cancel
Showing results for 
Search instead for 
Did you mean: 

PC value in stack frame after exception entry remains 0x00000000.

vishweshgm
Associate II

I am trying to understand the exception entry behaviour of cortex M3. It is given that stack frame contains PC info at address SP+0x18.

If I see the PC value after entry of SysTick_Handler(), it remains 0x0000 0000. Please refer screenshots to get idea on what I am trying to do.

I'm using ST's latest eclipse IDE.

Controller used is STM32F103C8.

ST-Link V2 debugger

1 ACCEPTED SOLUTION

Accepted Solutions

> It is given that stack frame contains PC info at address SP+0x18

Only if the handler itself did not put anything else on the stack. Observe the disasm of the handler.

JW

View solution in original post

4 REPLIES 4

> It is given that stack frame contains PC info at address SP+0x18

Only if the handler itself did not put anything else on the stack. Observe the disasm of the handler.

JW

vishweshgm
Associate II

Hello JW,

You are right. The disassembly shows the r7 and lr push. Can you help me understand the flow please. Where is the return point PC stored?

As you've now stopped before the push, offset 0x18 indeed contains the return value for PC, i.e. 0x08000642 (for some reason your debugger shows words MSB first - I don't use Eclipse).

JW

vishweshgm
Associate II

Thank you. Memory view problem got solved after I changed Rendering option from hex to HexInteger in eclipse. Not sure why eclipse has not given option to change endianness in Hex view. Overall my issue got solved.