HAL WWDG Overview ¶
Introducing WWDG ¶
- group WWDG_Introduction
-
The WWDG hardware abstraction layer provides a set of APIs to interface with the WWDG peripheral on STM32 microcontrollers.
The system window watchdog (WWDG) is used to detect the occurrence of a software fault, usually generated by external interference or by unforeseen logical conditions, which causes the application program to abandon its normal sequence.
The WWDG clock is prescaled from the APB clock and has a configurable time-window that can be programmed to detect abnormally late or early application behavior.
An Early Wakeup Interrupt can be generated before a reset happens to perform a system recovery or manage certain actions before a system restart.
Once the WWDG is enabled, it can only be disabled by a device reset.
The WWDG is best suited for applications requiring the watchdog to react within an accurate timing window.
This abstraction layer guarantees portability and ease of use across different STM32 series.
Module and files ¶
The following diagram illustrates the WWDG module and its associated files.
Component diagram ¶
The following diagram illustrates the software components involved in the WWDG module. It shows the interactions between the user application, HAL drivers, low-level drivers, and the hardware components.
Configuration table ¶
The following table lists the configuration defines for the HAL WWDG module, specifying their locations, default values, and descriptions:
- group WWDG_Configuration_Table
-
¶
Configuration inside the WWDG driver: ¶
Config defines
Where
Default value
Note
USE_HAL_WWDG_MODULE
hal_conf.h
1
Enable the HAL WWDG module.
USE_HAL_WWDG_REGISTER_CALLBACKS
hal_conf.h
0
Enable the register callbacks assert
USE_HAL_CHECK_PARAM
hal_conf.h
0
Enable checking of vital parameters at runtime
USE_HAL_WWDG_HARDWARE_START
hal_conf.h
0
WWDG driver starts in HW mode
USE_HAL_WWDG_CLK_ENABLE_MODEL
hal_conf.h
HAL_CLK_ENABLE_NO
Clock activation
USE_HAL_WWDG_TIME_UNIT (*)
hal_conf.h
HAL_WWDG_TIME_UNIT_MS
Time unit to be used for WWDG driver
USE_HAL_WWDG_USER_DATA
hal_conf.h
0
Enable the set/get user data
USE_ASSERT_DBG_PARAM
PreProcessor env
None
Enable the params assert
USE_ASSERT_DBG_STATE
PreProcessor env
None
Enable the state assert
(*) Select the time unit value with the USE_HAL_WWDG_TIME_UNIT define:
HAL_WWDG_TIME_UNIT_US: WWDG driver time unit in microseconds.
HAL_WWDG_TIME_UNIT_MS: WWDG driver time unit in milliseconds.
HAL_WWDG_TIME_UNIT_S: WWDG driver time unit in seconds.
The default time unit is milliseconds if not set.