How to implement WatchDog in FreeRTOS


I am using Cortex-M7 and FreeRTOSv10.3.1

I need to implement WatchDog functionality, but its not very clear to me how I can do with FreeRTOS.

Please suggest.

I‘m using the watchdog peripherals of either STM32 or SAM MCUs (I‘m currently using) and keep them alive in a task which gets triggered by a periodic timer.
It might be that simple, but it depends on what you want to watch/check.

Hi, Thanks for your response. Can you share an example code?

I think you need to provide more context of what you want to achieve. If you are talking about a hardware watchdog then FreeRTOS itself has no baring on how that operates as it is hardware not software. I suspect you want to use the hardware watchdog from a FreeRTOS application to catch some error condition. That can be as simple as kicking the watchdog from the idle task just to ensure the idle task is getting some execution time, or as complex as having each task report its status to a central monitoring task - the monitoring task will then check each task is still running and getting the necessary amount of processing time, and only kick the watchdog if it deems the system to be healthy. That is sort of what the FreeRTOS demos and tests do where a check task looks at all the other tasks running to ensure they are still running and have not themselves detected any errors - it outputs a message rather than kicking the watchdog.