Using Task Watchdog


Omar Morceli
 


Regarding the watchdog feature, I have an application running on an nRF52840 Dongle that communicates with Bluetooth Mesh (using some vendor models) and sends/receives data over USB .

  • How many channels should I use ?
  • Where do i put the task_wdt_feed() exactly ?
  • And in what case enabling the TASK_WDT_HW_FALLBACK is useful ?


Martin Jäger
 

Hi Omar,

I would only use it for critical tasks. If you want to supervise the entire application using the task watchdog you'll need one channel per thread.

You have to put the task_wdt_feed() somewhere into the code section that has to be executed regularly.

The hardware watchdog fallback is useful as an additional safety measure. If for some reason the RTOS kernel itself gets stuck (e.g. because of a bug or because of some blocking code in an ISR) the hardware watchdog will kick in and reset the device.

This is an excellent article about hardware and task watchdogs I recommend to read: https://interrupt.memfault.com/blog/firmware-watchdog-best-practices

Martin


On 23.05.22 20:26, Omar Morceli wrote:


Regarding the watchdog feature, I have an application running on an nRF52840 Dongle that communicates with Bluetooth Mesh (using some vendor models) and sends/receives data over USB .

  • How many channels should I use ?
  • Where do i put the task_wdt_feed() exactly ?
  • And in what case enabling the TASK_WDT_HW_FALLBACK is useful ?