2019-10-07 07:38 PM
Hi,
In stm32f051, iwdg is not working, I think.
After enable iwdg, encounter the while(1); loop , reset is not issued.
NRST pin is connected to RC reset circuit.
BR
Paul
2019-10-07 08:27 PM
It works. You either didn't enable it or have incorrect settings. But since you posted no code and no info apart from that you enabled it, we can only guess at what the problem is.
2019-10-07 09:49 PM
My iwdg enable code is as follow:
void
WatchDog_Config (void)
{
/* Enable write access to IWDG_PR and IWDG_RLR registers */
IWDG_WriteAccessCmd(IWDG_WriteAccess_Enable);
/* IWDG counter clock */
IWDG_SetPrescaler(IWDG_Prescaler_32);
IWDG_SetReload(96000000L/32);
/* Reload IWDG counter */
IWDG_ReloadCounter();
/* Enable IWDG (the LSI oscillator will be enabled by hardware) */
IWDG_Enable();
DBG ("IWDG Started\n");
}
BR
Paul
2019-10-07 09:55 PM
IWDG_SetReload(96000000L/32);
The RLR register is 12 bits.
2019-10-07 10:02 PM
And even if the value wasn't out of range, your IWDG would take 40 hours to trigger a reset.
96000000/32*32/40kHz = 40 hours