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

Watchdog Timer Implementation

Hello, 

I am transmitting 1 byte BLE data across a central and peripheral and the central does other things like control PWM, sample SAADC (scan mode), GPIO pins interrupts etc. I need to ensure that my application is not stuck while doing any of those tasks or in any of the event handlers and hence, I want to implement a watchdog timer.

What is the ideal way for using the watchdog in such a case or in other words when should I kick the dog in such an application. I though of having a watchdog at start of every event handler and disabling at end of event handler but if SoftDevice interferes while running the SAADC event handler, the dog wont be kicked and the system will be reset.

Thanks in advance

Parents Reply
  • Why would you need additional Watchdog for the event handlers if you also have a system-level watchdog running?

    I wanted to monitor each and every event handler separately but yes, as you said that would be redundant given that I have a system level timer. Although, why should I set a flag and trigger in main() for a system-level watchdog. Suppose, I directly kick the dog in the timer handler and if midway through that particular timer_handler() softdevice interrupts, once the softdevice is done with it's execution, wouldn't it come back to that timer_event handler and finish it's process??

Children
Related