Skip to main content
Explorer
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?

 

    This topic has been closed for replies.
    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

    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

     

    Explorer
    October 15, 2024

    Thank you for your prompt reply. It was helpful.