# FreeRTOS & watchdog

**URL:** <https://forums.freertos.org/t/freertos-watchdog/97>\
**Category:** Kernel\
**Created:** [May 14, 2010, 2:44pm UTC](https://forums.freertos.org/t/freertos-watchdog/97 "2010-05-14T14:44:04Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [May 14, 2010, 2:44pm UTC](https://forums.freertos.org/t/freertos-watchdog/97/1 "2010-05-14T14:44:04Z")

</div>

**[paoloferrari](https://sourceforge.net/u/paoloferrari/)** wrote on [Friday, May 14, 2010](https://sourceforge.net/p/freertos/discussion/382005/thread/0118d345/#6004):

Using recently FreeRTOS and I need advice:  
which is the best place to reset the watchdog?  
- In idle task  
- A task with lowest priority  
- A task with highest priority  
- Elsewhere

Any comments are welcome  
Thanks  
Paolo

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [May 14, 2010, 10:53pm UTC](https://forums.freertos.org/t/freertos-watchdog/97/2 "2010-05-14T22:53:23Z")

</div>

**[edwards3](https://sourceforge.net/u/edwards3/)** wrote on [Friday, May 14, 2010](https://sourceforge.net/p/freertos/discussion/382005/thread/0118d345/#be0e):

It depends on what you want the watchdog to do. Normally you will kick the watchdog after performing a number of tests on the entire system, for example, are the correct number of tasks running, has each task executed the expected number of times, have any tasks failed to execute since the check was last performed, etc. This can be done from a task, but the tasks priority will depend on the rest of the application functionality.

---

<div class="post-metadata">

**Author:** ![richard-damon](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/richard-damon/32/38_2.png) [@richard-damon](https://forums.freertos.org/u/richard-damon)\
**Post date:** [May 15, 2010, 1:25am UTC](https://forums.freertos.org/t/freertos-watchdog/97/3 "2010-05-15T01:25:41Z")

</div>

**[richard\_damon](https://sourceforge.net/u/richard_damon/)** wrote on [Saturday, May 15, 2010](https://sourceforge.net/p/freertos/discussion/382005/thread/0118d345/#929c):

I generally put the watchdog monitor task near the bottom of the priority list (there may be some non-critical background operations below it). Placing it low adds a check for CPU starving by some other task, As Edwards says, it should check that all the critical tasks are still alive and functioning.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [May 15, 2010, 2:20pm UTC](https://forums.freertos.org/t/freertos-watchdog/97/4 "2010-05-15T14:20:35Z")

</div>

**[paoloferrari](https://sourceforge.net/u/paoloferrari/)** wrote on [Saturday, May 15, 2010](https://sourceforge.net/p/freertos/discussion/382005/thread/0118d345/#7785):

thanks guys for your answers

another question:

Example:  
To my mistake or for any reason FreeRTOS crashes.  
I want a hardware watchdog that in this case reset the system.  
To reset this when everything is ok, the best place is a task of low or high priority?

Thanks again  
Paolo

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [May 17, 2010, 3:23pm UTC](https://forums.freertos.org/t/freertos-watchdog/97/5 "2010-05-17T15:23:11Z")

</div>

**[jakbird](https://sourceforge.net/u/jakbird/)** wrote on [Monday, May 17, 2010](https://sourceforge.net/p/freertos/discussion/382005/thread/0118d345/#a0ed):

In one app (ARM7) I set up a high priority task as a watchdog, triggered once per second from the RTC timer.&nbsp; The watchdog checks the pending messages in several application queues to make sure none are maxed out for several seconds, indicating a hung process.&nbsp; I also reset an external hardware watchdog at the same time.

For another design I put the independent watchdog (STM23) in the system tick hook routine, to guarantee the RTOS timer doesn’t stop.  
&nbsp; Jack Peacock

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [May 18, 2010, 6:07am UTC](https://forums.freertos.org/t/freertos-watchdog/97/6 "2010-05-18T06:07:57Z")

</div>

**[paoloferrari](https://sourceforge.net/u/paoloferrari/)** wrote on [Tuesday, May 18, 2010](https://sourceforge.net/p/freertos/discussion/382005/thread/0118d345/#d242):

Thanks for your comments.  
I think I found the right solution for my application.

Thanks again to all  
Paolo

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [May 28, 2010, 3:56pm UTC](https://forums.freertos.org/t/freertos-watchdog/97/7 "2010-05-28T15:56:08Z")

</div>

**[oahmad2](https://sourceforge.net/u/oahmad2/)** wrote on [Friday, May 28, 2010](https://sourceforge.net/p/freertos/discussion/382005/thread/0118d345/#1234):

Do these answers change for uCs with MPUs such as the Cortex M3?&nbsp;

For example, I assume the best place to put the watchdog functionality would be in a privileged task
