cancel
Showing results for 
Search instead for 
Did you mean: 

resetting the WWDG

con3
Senior

Hey everyone,

I'm a little confused. I've added the wwdg, but I'm not sure where to refresh it. Is there somewhere I can refresh it that should happen at a constant time, The examples I looked at simply place the reset in the code, but I have so many moving parts, that I would rather have it reset on it's own than manually doing it. Thought about placing it somewhere like the systick interrupt, but I'm really not sure.

Thanks in advance for any help!

2 REPLIES 2
Danish1
Lead II

A watchdog is intended to check that all vital services are being performed, and (for example) the processor is not stuck in an endless loop somewhere.

If you place the WWDG feeder in the systick interrupt, the system will be reset if systick does not get serviced.

But the processor could be stuck in an endless loop - not doing what it is supposed to do. And on each systick interrupt it obediently goes off, services systick, and returns to its endless loop. Under these circumstances, you probably do want the watchdog to time-out and the processor to be reset. So having the WWDG feeder inside systick might be unsatisfactory unless you make it conditional on genuine progress being observed on your main execution loop.

Where you have a real-time OS and several threads, you probably want to observe progress (i.e. having been around the code loop) on each and every one of these threads. So you might need to have a flag for each thread, and you feed the watchdog only when all flags have been set (at which point you clear all flags).

Hope this helps,

Danish

Hi @Danish​ ,

Thank you for the reply, that was definitely very informative and I have a few long running tasks that I really hope don't get stuck in an infinite loop (sdcard writes).

Would I then have to manually call the wwdg refresh in my code constantly? The example code provided by ST make it really easy by just having a led blinked in a while loop with a constant refresh after a delay, which isn't a very practical usecase. At this point I'm not using an OS and my main concern is a task stalling in an infinite loop.

Thanks for the help thus far. I appreciate it.