Skip to main content
Visitor II
October 3, 2024
Question

HARD FAULT HANDLER

  • October 3, 2024
  • 2 replies
  • 710 views

Hi,playing around a program found hard fault handler on debugging Can anyone help to proceed that

Shrini17_0-1727962103489.pngShrini17_1-1727962128156.png

 

    This topic has been closed for replies.

    2 replies

    Graduate II
    October 3, 2024

    Look at what's actually faulting.

    Most likely bad address or point, or misalignment. The CM0(+) do not tolerate misaligned 32-bit access.

    Have a handler that outputs actionable detail, this is NOT done with a while(1) loop.

    You can inspect the registers and stack in the debugger, but it's not nearly as helpful as printing something out, especially in the field or end-users, who aren't going to have access.

    Instrument your code so you've got some first idea as to where it's going, what it's doing, and where it is failing.