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

前端 未结 5 1203
醉话见心
醉话见心 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:12

    I found a common cause for these issues are those 'for loop' delays. When using -O3 they simply get optimized away if you are are not referring to volatile variables. Personally, I prefer the SysTick approach.

提交回复
热议问题