2020-11-26 12:41 AM
We have a board with a STM32G071RBT6. The MCU is controlling a mechanical relay that breaks mains voltage (230V). When the relay closes, this causes the MCU to hiccup in rare occasions: either the core locks up and the WDI resets it, or a NMI exception triggers, or just plainly locks up entirely and stops responding to the reset pin, or an external programmer, or anything, until power cycled. The MCU is clocked by an external crystal and the PLL is set to 32 MHz.
My question is, what could be the cause of such terrible lock-ups? Is there anything I could try to implement in the chip configuration to make it more stable or sturdier?