ARM Cortex M3 How do I determine the program counter value before a hard fault?

前端 未结 5 1180
醉话见心
醉话见心 2020-12-28 23:27

I have an embedded project using a STM32F103 (ARM Cortex M3), it is getting a occasionally getting hard fault in release mode. As part of recovery, I would like to retrieve

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-29 00:05

    I have an FAQ on this very topic. The page linked to from the FAQ includes fault handler code that will obtain the program counter from the stack for you.

提交回复
热议问题