cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F042 sometimes hans upon NVIC_SystemReset()

Mehmet Erol
Associate II

Hi,

One out of 10/15/20 times, STM32F042 MCU in my application hangs upon NVIC_SystemReset(). Any idea on what could be the reason ? Some more info :

-BOOT0 is directly connected to ground. In CUBEMX, nothing was set for that pin.

- I removed the external pull-up on the reset line. There is only 100nF towards ground on NRST.

- Hard reset via power cycle always works.

I tried to use while(1) loop instead of NVIC_SystemReset() for IWDG to take care of the reset but it is happening with IWDG as well. It is quite unpredictable.

Edit : One final detail, as mentioned here, I tried to put  HAL_Delay(100) before the reset command and it seemed to reduce the frequency of this happening. This is really strange and I have no idea on what's going on..

 

 

 

 

 

10 REPLIES 10
TDK
Guru

Probably the UART interface is still active and triggers an overrun or other error condition which is unhandled.

If you feel a post has answered your question, please click "Accept as Solution".