cancel
Showing results for 
Search instead for 
Did you mean: 

Solution

Adam Czapski
Associate II
Posted on May 22, 2014 at 19:57

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'' key

after

 writing all the configuration registers. Wrong! There appears to be an error in the datasheet. You have to enable watchdog

before

 re-configuring it. 

When I used the memory monitor in debug mode I realized that the configuration registers

remain 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
0 REPLIES 0