HardFault_Handler and breadcrumbs

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HardFault_Handler and breadcrumbs

1,456 Views
mspenard603
Contributor IV

Hi All,

 This is an admittedly open ended question but... I've declared my own HardFault_Handler() and want it to dump information as to what function or 0x6xxxxxxx instruction caused the fault. How are others accomplishing this?

0 Kudos
Reply
3 Replies

1,402 Views
RaRo
NXP TechSupport
NXP TechSupport

Hello @mspenard603,

Could you please give us more details about what are you doing or trying to do? Also, which microcontroller and IDE are you using?

In the meantime, it could be useful to take a look to the following information related to HardFault in ARM microcontrollers:

Best regards, Raul.

0 Kudos
Reply

1,372 Views
mspenard603
Contributor IV

iMXRT1062 and MCUxpresso 11.7.0

On a fault I'd like to know the call stack. But that's only available with Cortex-M0+ and its MTB I assume.

The program counter on a Hard Fault points to its ISR. So I'd like to know what previous instruction address caused the hard fault. I assume that's on stack. So I'm curious how others are approaching this and dumping stack.

 

0 Kudos
Reply

1,360 Views
RaRo
NXP TechSupport
NXP TechSupport

Hello @mspenard603,

You could obtain information about your HardFault in MCUXpresso IDE in Faults view.

RaulRomero_0-1681837483882.png

[MCUXpresso IDE User Guide. Chapter 12. Debugging a Project. Section 12.7. Faults]

Also, could you please take a look at the following information?

It could be useful.

Best regards, Raul.

0 Kudos
Reply