Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This application note explains how to use the WDT in the FreeRTOS demo application.

1. Understanding FreeRTOS WDT Interfaces

1.1. 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.

1.2. FreeRTOS WDT C-Binding API

The WDT driver implements the following C-binding API:

...

Code Block
typedef struct
{
uint32_t Prescaler; /* Select the prescaler of the IWDG. */
uint32_t Reload;    /* Specifies the IWDG down-counter reload value. */
uint32_t Window;    /* Specifies the window value to be compared 
                       to the down-counter. */
} IWDG_InitTypeDef;

1.3. 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 period will be set to 2 seconds.

2. WDT CLI Command

The FreeRTOS application implements the following WDT related CLI command:

Command

Description

Comments

wdt_stop

Command the WDT thread to stop the WDT strobing (which will result in resetting the system on WDT expiration)

3. Validating WDT Operation

Use the following step-wise procedure to validate the FreeRTOS WDT operation:

...