Feed watchdog in Zephyr idle thread

Hi all,

Is there any way to use the Zephyr idle thread to feed the watchdog? I do that with freeRTOS and is an elegant way to feed the watchdog.

The other way is to create a task with a very low priority (just one step above the idle thread priority) and periodically feed it.

Thanks and kind regards,

Pedro.

Parents
  • Hi,

    The idle thread in Zephyr does nothing, so no, you cannot use that one for feeding the watchdog.

    You could do it from a very low priority thread (as you suggest), or from main, or signal from other threads to main and do it in main whenever you get the signals, or use another scheme.

    The important thing when using watchdogs, is to use them in a way which is useful for your use case. Typically that means signaling (or feeding) from the processes that should not freeze, and in such a way that even only one such process freezing would trigger the watchdog reset.

    Regards,
    Terje

Reply
  • Hi,

    The idle thread in Zephyr does nothing, so no, you cannot use that one for feeding the watchdog.

    You could do it from a very low priority thread (as you suggest), or from main, or signal from other threads to main and do it in main whenever you get the signals, or use another scheme.

    The important thing when using watchdogs, is to use them in a way which is useful for your use case. Typically that means signaling (or feeding) from the processes that should not freeze, and in such a way that even only one such process freezing would trigger the watchdog reset.

    Regards,
    Terje

Children
Related