Skip to main content
Visitor II
October 7, 2019
Solved

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

  • October 7, 2019
  • 4 replies
  • 2291 views

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

    This topic has been closed for replies.
    Best answer by waclawek.jan

    > 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

    4 replies

    Super User
    October 7, 2019

    > 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

    Visitor II
    October 7, 2019

    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?

    Super User
    October 7, 2019

    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

    Visitor II
    October 7, 2019

    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.