Running WDT in FreeRTOS |
This application note explains how to use the WDT in the FreeRTOS demo application. Understanding FreeRTOS WDT Interfaces FreeRTOS WDI Implementation The FreeRTOS BSP make uses of the STM32CubeH7 software component to provide a device driver for the STM32H7 WDT. The driver is configured (enabled / disabled) at the BSP build time, using the HAL_IWDG_MODULE_ENABLED configuration option, defined in the stm32h7xx_hal_conf.h file. FreeRTOS WDT C-Binding API The WDT driver implements the following C-binding API:
The IWDG_HandleTypeDef data structure used in the HAL_IWDG_Init interface has the following definition:
The IWDG_InitTypeDef data structure used in IWDG_HandleTypeDef has the following definition:
FreeRTOS WDT Strobing Task The FreeRTOS tdemo application implements a separate thread (called the "WDT thread"), whose only task will be to strobe the WDT periodically, to ensure that the WDT does not reset the system. The WDT will be enabled at the start of the WDT thread, before it enters the endless WDT strobing loop. The WDT period will be set to 2 seconds. WDT CLI Command The FreeRTOS application implements the following WDT related CLI command:
Validating WDT Operation Use the following step-wise procedure to validate the FreeRTOS WDT operation:
CLI> |