cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 IWDG keeps resetting even though key register is written with 0xAAAA

aow
Associate
Posted on July 30, 2015 at 22:33

I have the following issue with the IWDG:

I initialized the IWDG with the sequence

  IWDG_WriteAccessCmd(IWDG_WriteAccess_Enable);

  IWDG_SetPrescaler(IWDG_Prescaler_32);

  IWDG_SetReload(0x0FF0);

  IWDG_ReloadCounter();

  IWDG_Enable();

which will cause a timeout after 4 seconds, and then I reset the counter periodically with

  IWDG_ReloadCounter();

which writes 0xAAAA to the key register. However, the watchdog always resets the system after 4 seconds, as if the call to IWDG_ReloadCounter() never took place (the debugger tells otherwise). What could be the issue?

2 REPLIES 2
Posted on July 31, 2015 at 02:20

And what if you do it outside the debugger, sending a character out a USART each time immediately after you call IWDG_ReloadCounter();

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
aow
Associate
Posted on July 31, 2015 at 02:53

The watchdog also resets if I do not run the program with the debugger. It is old code, which I ported to the STM32F407, and there the watchdog timer (different code obviously) never resets, though it is a 1.6s timeout.