Skip to main content
Associate III
October 15, 2024
Solved

We want to light up an LED when a hard fault occurs.

  • October 15, 2024
  • 1 reply
  • 799 views

We want to light up an LED when a hard fault occurs.

Please tell me in which handler I should put the GPIO processing.

Also, We would like to turn on the LEDs for faults other than Hard fault, is that possible?

 

Best answer by Andrew Neil

@pass3master wrote:

We want to light up an LED when a hard fault occurs.


Good idea!

 


@pass3master wrote:

Please tell me in which handler I should put the GPIO processing.


In the Hard Fault Handler!

On debugging Cortex-M Hard Faults - in general, and STM32 specifically:

https://community.st.com/t5/community-guidelines/how-to-write-your-question-to-maximize-your-chances-to-find-a/tac-p/708193/highlight/true#M51 

 


@pass3master wrote:

Also, We would like to turn on the LEDs for faults other than Hard fault, is that possible?


Of course - do it in the handlers for those faults

 

1 reply

Andrew Neil
Andrew NeilBest answer
Super User
October 15, 2024

@pass3master wrote:

We want to light up an LED when a hard fault occurs.


Good idea!

 


@pass3master wrote:

Please tell me in which handler I should put the GPIO processing.


In the Hard Fault Handler!

On debugging Cortex-M Hard Faults - in general, and STM32 specifically:

https://community.st.com/t5/community-guidelines/how-to-write-your-question-to-maximize-your-chances-to-find-a/tac-p/708193/highlight/true#M51 

 


@pass3master wrote:

Also, We would like to turn on the LEDs for faults other than Hard fault, is that possible?


Of course - do it in the handlers for those faults

 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Associate III
October 15, 2024

Thank you for your prompt reply. It was helpful.