cancel
Showing results for 
Search instead for 
Did you mean: 

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

pass3master
Senior

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?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Andrew Neil
Super User

@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.

View solution in original post

2 REPLIES 2
Andrew Neil
Super User

@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.

Thank you for your prompt reply. It was helpful.

Announcement

We’re moving the ST Community to a new platform to give you a better and more reliable community experience.