2014-05-22 10:57 AM
Hi,
I know it's an old thread but I decided to answer just in case someone else still has this problem.''I added this line in my IWDG initalization:
while ((IWDG->SR & (IWDG_SR_PVU | IWDG_SR_RVU)) != 0) {}
But it never comes past this line.''
I did exactly the same thing with the same results. Eventually I noticed that there are 2 different methods for configuring the watchdog in the datasheet. One with and the other without the window function. According to the method without the window option (which I used) you're supposed to write the ''enable'' keyafter
writing all the configuration registers. Wrong! There appears to be an error in the datasheet. You have to enable watchdogbefore
re-configuring it. When I used the memory monitor in debug mode I realized that the configuration registersremain unchanged
after writing to them if watchdog is disabled. That's why the update flags in IWDG->SR never go back to 0. Once you enable watchdog, everything works as it should.Hope it helps anyone.Adam #stm32-iwdg-watchdog-problem