2023-08-23 03:49 AM - edited 2023-08-23 03:56 AM
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..
2023-08-23 07:25 AM
Probably the UART interface is still active and triggers an overrun or other error condition which is unhandled.