Watchdog Manager#
Introduction#
The Si91x SOC provides a robust mechanism to handle state changes and recovery operations. In standalone mode, it can notify applications running on the M4 core about different state changes, which helps ensure system stability and recovery from faults.
The different boot states managed by the SOC include:
Cold Boot: A standard boot from a powered-off state.
Power Save Boot: Resuming from a low-power state, typically retention-based.
Crash Boot: A reboot triggered by internal events such as hangs, crashes, watchdog triggers, or planned reboots to prevent known issues.
This feature helps detect processor hangs and ensures recovery through system resets, enhancing the overall reliability of the SOC.
Configuration#
Configuration involves setting up mechanisms to handle various boot states and utilizing the internal watchdog and reset features to manage unexpected faults or hangs.
Ensure that all boot states are properly monitored.
Use watchdog timers to detect hangs or crashes.
Implement firmware routines to handle planned reboots and crash scenarios effectively.
Usage#
The typical sequence to utilize WDT-MANAGER effectively includes:
Initialize the watchdog and monitoring mechanisms at startup.
Configure the system to handle different boot states:
Cold Boot
Power Save Boot
Crash Boot
Implement interrupt handling for detecting system hangs or crashes.
Trigger system reset in case of detected faults.
Log state changes and recovery actions for diagnostics.
Benefits#
Detects and recovers from processor hangs.
Provides mechanisms to handle planned and unplanned reboots.
Ensures system reliability and stability by managing state transitions effectively.
Enumerations#
Reason for the system being reset.
Enumeration to represent possible time delay values for WDT interrupt time and system reset time with 32 kHz clock frequency.
Functions#
To configure the watchdog manager service.
To start the watchdog manager service.
To retrieve the system reset reason.
To disable the hardware watchdog in sleep mode.
To enable the hardware watchdog in sleep mode.
Macros#
Wake-up event.
Timeout wake-up.
Host wake-up.
MCU wake-up status.
MCU watchdog reset.
MCU watchdog window reset.
Network processor watchdog reset.
Network processor watchdog window reset.
Host reset request.
Watchdog reset status flags.
Enumeration Documentation#
sl_watchdog_manager_reset_reason_t#
sl_watchdog_manager_reset_reason_t
Reason for the system being reset.
This enumeration defines the possible reasons for the system being reset. It includes power-on reset, watchdog reset, and software-invoked reset.
Enumerator | |
---|---|
SL_SI91X_WATCHDOG_MANAGER_RESET_POR | A power-on reset was performed. |
SL_SI91X_WATCHDOG_MANAGER_RESET_WATCHDOG | System was reset by the watchdog manager service. |
SL_SI91X_WATCHDOG_MANAGER_RESET_SOFTWARE | A reset was invoked from the system firmware. |
SL_SI91X_WATCHDOG_MANAGER_RESET_MAX | Maximum value for reset reasons. |
88
of file components/device/silabs/si91x/mcu/drivers/service/wdt_manager/inc/sl_si91x_wdt_manager.h
sl_watchdog_manager_wdog_timeout_t#
sl_watchdog_manager_wdog_timeout_t
Enumeration to represent possible time delay values for WDT interrupt time and system reset time with 32 kHz clock frequency.
This enumeration defines the possible time delays for the Watchdog Timer (WDT) interrupt and system reset times. The delays are based on a 32 kHz clock frequency.
Enumerator | |
---|---|
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_0 | Time delay of 0.03125 milliseconds. |
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_1 | Time delay of 0.0625 milliseconds. |
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_2 | Time delay of 0.125 milliseconds. |
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_3 | Time delay of 0.25 milliseconds. |
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_4 | Time delay of 0.5 milliseconds. |
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_5 | Time delay of 1 millisecond. |
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_6 | Time delay of 2 milliseconds. |
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_7 | Time delay of 4 milliseconds. |
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_8 | Time delay of 8 milliseconds. |
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_9 | Time delay of 16 milliseconds. |
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_10 | Time delay of 32 milliseconds. |
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_11 | Time delay of 64 milliseconds. |
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_12 | Time delay of 128 milliseconds. |
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_13 | Time delay of 256 milliseconds. |
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_14 | Time delay of 512 milliseconds. |
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_15 | Time delay of 1.024 seconds. |
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_16 | Time delay of 2.048 seconds. |
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_17 | Time delay of 4.096 seconds. |
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_18 | Time delay of 8.192 seconds. |
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_19 | Time delay of 16.384 seconds. |
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_20 | Time delay of 32.768 seconds. |
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_21 | Time delay of 65.536 seconds. |
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_22 | Time delay of 131.072 seconds. |
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_23 | Time delay of 262.144 seconds. |
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_24 | Time delay of 524.288 seconds. |
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_25 | Time delay of 1048.576 seconds. |
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_26 | Time delay of 2097.152 seconds. |
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_27 | Time delay of 4194.304 seconds. |
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_28 | Time delay of 8388.608 seconds. |
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_29 | Time delay of 16777.216 seconds. |
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_30 | Time delay of 33554.432 seconds. |
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_31 | Time delay of 67108.864 seconds. |
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_MAX | Maximum value for time delay validation. |
102
of file components/device/silabs/si91x/mcu/drivers/service/wdt_manager/inc/sl_si91x_wdt_manager.h
Function Documentation#
sl_watchdog_manager_init#
sl_status_t sl_watchdog_manager_init (void )
To configure the watchdog manager service.
N/A |
Configures the hardware watchdog timer.
The 91x watchdog peripheral's interrupt interval is set to 2 seconds less than the configured value of
SL_WDT_MANAGER_INTERRUPT_TIME
. The hardware watchdog triggers an interrupt when this timeout expires, allowing the software to feed the watchdog within this interval.Assigns a system reset value to 4 seconds. If the watchdog timer (WDT) is not reset within this interval, the system will reset after 4 seconds. The reset counter begins counting after the interrupt time expires. The system reset value is updated based on the configured interrupt time, referenced by
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_PERIOD
.
Returns
sl_status_t Status code indicating the result:
SL_STATUS_OK (0x0000) - Success
SL_STATUS_FAIL (0x0001) - Generic error
For more information on status codes, refer to SL STATUS DOCUMENTATION.
160
of file components/device/silabs/si91x/mcu/drivers/service/wdt_manager/inc/sl_si91x_wdt_manager.h
sl_watchdog_manager_start#
sl_status_t sl_watchdog_manager_start (void )
To start the watchdog manager service.
N/A |
This function starts the Watchdog Timer (WDT) and begins counting. The hardware watchdog triggers an interrupt when the WDT timeout interval expires.
Pre-conditions:
sl_watchdog_manager_init must be called before this function.
Returns
sl_status_t Status code indicating the result:
SL_STATUS_OK (0x0000) - Success
SL_STATUS_FAIL (0x0001) - Generic error
For more information on status codes, refer to SL STATUS DOCUMENTATION.
178
of file components/device/silabs/si91x/mcu/drivers/service/wdt_manager/inc/sl_si91x_wdt_manager.h
sl_wdt_manager_get_system_reset_status#
sl_watchdog_manager_reset_reason_t sl_wdt_manager_get_system_reset_status (void )
To retrieve the system reset reason.
N/A |
Returns the reason for the system being reset. This may be invoked during a startup flow to determine if the system has recovered from an error condition such as a crash.
Returns
sl_watchdog_manager_reset_reason_t Enumeration value indicating the reset reason:
SL_SI91X_WATCHDOG_MANAGER_RESET_WATCHDOG - WDT System Reset
SL_SI91X_WATCHDOG_MANAGER_RESET_SOFTWARE - Software System Reset
SL_SI91X_WATCHDOG_MANAGER_RESET_POR - Power-on Reset
192
of file components/device/silabs/si91x/mcu/drivers/service/wdt_manager/inc/sl_si91x_wdt_manager.h
sl_watchdog_disable_wdt_in_sleep#
void sl_watchdog_disable_wdt_in_sleep (void )
To disable the hardware watchdog in sleep mode.
N/A |
This function stops the Watchdog Timer (WDT) counter from running when the system enters sleep mode.
Pre-conditions:
sl_watchdog_manager_init must be called before this function.
Note
This function does not return a status code.
205
of file components/device/silabs/si91x/mcu/drivers/service/wdt_manager/inc/sl_si91x_wdt_manager.h
sl_watchdog_enable_wdt_in_sleep#
void sl_watchdog_enable_wdt_in_sleep (void )
To enable the hardware watchdog in sleep mode.
N/A |
This function starts the Watchdog Timer (WDT) counter running in sleep mode. It enables the WDT as a wake-up source to the system to serve the ISR and kick the watchdog.
Pre-conditions:
sl_watchdog_manager_init must be called before this function.
217
of file components/device/silabs/si91x/mcu/drivers/service/wdt_manager/inc/sl_si91x_wdt_manager.h
Macro Definition Documentation#
SL_SI91X_WAKEUP_INDICATION#
#define SL_SI91X_WAKEUP_INDICATIONValue:
BIT(0)
Wake-up event.
53
of file components/device/silabs/si91x/mcu/drivers/service/wdt_manager/inc/sl_si91x_wdt_manager.h
SL_SI91X_TIMEOUT_WAKEUP#
#define SL_SI91X_TIMEOUT_WAKEUPValue:
BIT(1)
Timeout wake-up.
54
of file components/device/silabs/si91x/mcu/drivers/service/wdt_manager/inc/sl_si91x_wdt_manager.h
SL_SI91X_HOST_BASED_WAKEUP_S#
#define SL_SI91X_HOST_BASED_WAKEUP_SValue:
BIT(2)
Host wake-up.
55
of file components/device/silabs/si91x/mcu/drivers/service/wdt_manager/inc/sl_si91x_wdt_manager.h
SL_SI91X_MCU_PROCESSOR_WAKE_STAT#
#define SL_SI91X_MCU_PROCESSOR_WAKE_STATValue:
BIT(4)
MCU wake-up status.
56
of file components/device/silabs/si91x/mcu/drivers/service/wdt_manager/inc/sl_si91x_wdt_manager.h
SL_SI91X_MCU_WWD_RESET#
#define SL_SI91X_MCU_WWD_RESETValue:
BIT(5)
MCU watchdog reset.
57
of file components/device/silabs/si91x/mcu/drivers/service/wdt_manager/inc/sl_si91x_wdt_manager.h
SL_SI91X_MCU_WWD_WINDOW_RESET#
#define SL_SI91X_MCU_WWD_WINDOW_RESETValue:
BIT(6)
MCU watchdog window reset.
58
of file components/device/silabs/si91x/mcu/drivers/service/wdt_manager/inc/sl_si91x_wdt_manager.h
SL_SI91X_NWP_WWD_RESET#
#define SL_SI91X_NWP_WWD_RESETValue:
BIT(8)
Network processor watchdog reset.
59
of file components/device/silabs/si91x/mcu/drivers/service/wdt_manager/inc/sl_si91x_wdt_manager.h
SL_SI91X_NWP_WWD_WINDOW_RESET#
#define SL_SI91X_NWP_WWD_WINDOW_RESETValue:
BIT(9)
Network processor watchdog window reset.
60
of file components/device/silabs/si91x/mcu/drivers/service/wdt_manager/inc/sl_si91x_wdt_manager.h
SL_SI91X_HOST_RESET_REQUEST#
#define SL_SI91X_HOST_RESET_REQUESTValue:
BIT(10)
Host reset request.
61
of file components/device/silabs/si91x/mcu/drivers/service/wdt_manager/inc/sl_si91x_wdt_manager.h
SL_SI91X_WDT_RESET#
#define SL_SI91X_WDT_RESETValue:
Watchdog reset status flags.
This macro combines multiple watchdog reset status flags, indicating various watchdog reset sources:
MCU watchdog window reset
MCU watchdog reset
Network processor watchdog window reset
Network processor watchdog reset
Host reset request
74
of file components/device/silabs/si91x/mcu/drivers/service/wdt_manager/inc/sl_si91x_wdt_manager.h