This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

What is the point of the watchdog ISR?

Two questions. 1) What is the point of the watchdog ISR? In the Ambiq Apollo 2 microcontroller, the watchdog ISR fires and if the CPU doesn't pet the watchdog slightly after that, the watchdog resets the CPU. But when I tried to pet the watchdog in the nRF watchdog event handler, the CPU was reset anyway. So my only choice for petting/feeding the watchdog is putting it on some kind of timer? Is the watchdog event handler only for when it's "too late" to feed, logging the CPU's last words before it gets reset by the watchdog?

2) What is the point of having multiple watchdog channels? What does that even mean? 

Parents
  • Hi,

    1) The Watchdog interrupt on the nRF5 devices is a mechanism to let the application know that a watchdog reset is imminent, giving it time to do a small amount of cleanup or logging before the reset occurs. There is no way to prevent a reset at that point. You have full freedom in how you kick the watchdog, as long as you do so in time. A typical way is to use a repeated app timer, and do some checking there. If all is OK, you kick the watchdog.

    2) The multiple watchdog channels can for instance be used where you have an RTOS and want to require each task to kick the watchdog. If any task fails to do so in time, the reset will occur. This is an optional feature, and you can get the traditional watchdog behavior by only enabling a single channel.

Reply
  • Hi,

    1) The Watchdog interrupt on the nRF5 devices is a mechanism to let the application know that a watchdog reset is imminent, giving it time to do a small amount of cleanup or logging before the reset occurs. There is no way to prevent a reset at that point. You have full freedom in how you kick the watchdog, as long as you do so in time. A typical way is to use a repeated app timer, and do some checking there. If all is OK, you kick the watchdog.

    2) The multiple watchdog channels can for instance be used where you have an RTOS and want to require each task to kick the watchdog. If any task fails to do so in time, the reset will occur. This is an optional feature, and you can get the traditional watchdog behavior by only enabling a single channel.

Children
No Data
Related