I am currently using vApplicationIdleHook() to simply reset the Watchdog timer (WDT) on my target device. This technique works well so far, but there is no way of checking the proper functioning of other threads, so I would instead like to have my two other threads each give their own WDT binary semaphore, and vApplicationIdleHook() will only reset the WDT once both semaphores have been given by each task, otherwise the watchdog timer will reset. I’ve noted that blocking functions like vTaskDelay(), xSemaphoreTake(), etc. are not usable in vApplicationIdleHook(), but I would like to hear any other suggestions of how to implement this sort of WDT functionality using vApplicationIdleHook(). Thanks, Nicholas
What I have done is have each thread that needs to be verified that it is running set a global variable to a specific value if it is running properly, and the idle hook can check those values, and if all are set, kick the watchdog and reset the values to 0. Another method that can be used is when each task ‘makes progress’ it saves a time stamp, and the idle task can then check that every task either has no work to do or has made progress recently.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.