cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WL NMI Handler Best Practice

RLind.3
Associate III

Hi there,

I am using the STM32WLE4C8 and I am trying to write a safe handler for the NMI interrupt. From what I can tell, the NMI interrupt is triggered by a flash double ECC error, an HSE failure, or an SRAM parity error. All of these are fairly serious and I am not sure of the best way to handle them safely.

Ideally, I would like to be able to send an RF message describing the error, but this seems unlikely as it is a complex process and the flash may be corrupt, or the TCXO dead. At a minimum, I would like to write a small log entry to flash. Is this possible? Are there other actions I should be taking alongside this?

Thanks,

Rebecca

1 REPLY 1
gregstm
Senior III

Hopefully an expert will respond to your question, in the mean time here is my two cents worth... I guess a lot depends on your application. While debugging/prototyping, the simplest thing you could do first is set an IO pin/Led so you can tell something went wrong. Maybe send a code out a uart, it is also a fairly simple process that doesn't rely on many resources - you could leave it in the final software and it might help diagnose faults in your products later.