| CMSIS-RTOS2 Real-Time Operating System API |

Loading...
Searching...
No Matches
Thread Watchdogs

CMSIS-RTOS defines Thread Watchdogs that allow to control timing constraints for thread execution temporal isolation.

Each thread has an independent watchdog timer that is started with the function osThreadFeedWatchdog(uint32_t ticks). The ticks value specifies the timeout before it expires. Within this time interval the function osThreadFeedWatchdog must be called again within the thread to restart the watchdog timer.

If the thread watchdog is not restarted during the specified amount of ticks the Watchdog Alarm callback osWatchdogAlarm_Handler(osThreadId_t thread_id) is triggered and can be used to recover the system or proceed to the system shutdown.

Figure below explains the concept with an example:

Example use of Thread Watchdogs

Fault Handling provides more details on the available possibilities for system recovery.

> ‍Note

> - If the application suspends a thread from scheduling by calling osThreadSuspend or osThreadSuspendClass, the thread watchdog still continues to run, and it is expected to expire and trigger osWatchdogAlarm_Handler because the thread will not be serviced as expected.
> - Hence it may be necessary to differentiate handling of thread watchdogs that expired unexpectedly from the thread watchdog alarms of intentionally suspended threads.

Function references

Summary of functions that implement thread watchdog functionality:

- osThreadFeedWatchdog : Feed watchdog of the current running thread.
- osWatchdogAlarm_Handler : Handler for expired thread watchdogs.