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:

  1. Initialize the watchdog and monitoring mechanisms at startup.

  2. Configure the system to handle different boot states:

    • Cold Boot

    • Power Save Boot

    • Crash Boot

  3. Implement interrupt handling for detecting system hangs or crashes.

  4. Trigger system reset in case of detected faults.

  5. 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#

enum
SL_SI91X_WATCHDOG_MANAGER_RESET_POR
SL_SI91X_WATCHDOG_MANAGER_RESET_WATCHDOG
SL_SI91X_WATCHDOG_MANAGER_RESET_SOFTWARE
SL_SI91X_WATCHDOG_MANAGER_RESET_MAX
}

Reason for the system being reset.

enum
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_0
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_1
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_2
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_3
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_4
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_5
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_6
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_7
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_8
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_9
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_10
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_11
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_12
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_13
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_14
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_15
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_16
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_17
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_18
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_19
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_20
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_21
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_22
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_23
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_24
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_25
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_26
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_27
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_28
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_29
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_30
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_31
SL_SI91X_WATCHDOG_MANAGER_TIMEOUT_INDEX_MAX
}

Enumeration to represent possible time delay values for Watchdog Timer (WDT) interrupt time and system reset time with 32 kHz clock frequency.

Functions#

sl_status_t

To configure the watchdog manager service.

sl_status_t

To start the watchdog manager service.

void

To disable the hardware watchdog in sleep mode.

void

To enable the hardware watchdog in sleep mode.

Macros#

#define

Wake-up event.

#define

Timeout wake-up.

#define

Host wake-up.

#define

MCU wake-up status.

#define

MCU watchdog reset.

#define

MCU watchdog window reset.

#define

Network processor watchdog reset.

#define

Network processor watchdog window reset.

#define

Host reset request.

#define

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.


Definition at line 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 Watchdog Timer (WDT) interrupt time and system reset time with 32 kHz clock frequency.

This enumeration defines the possible time delays for the 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.


Definition at line 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.

Parameters
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 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 - Success

    • SL_STATUS_FAIL - Generic error

For more information on status codes, refer to SL STATUS DOCUMENTATION.


Definition at line 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.

Parameters
N/A

This function starts the WDT and begins counting. The hardware watchdog triggers an interrupt when the WDT timeout interval expires.

Returns

  • sl_status_t Status code indicating the result:

    • SL_STATUS_OK - Success

    • SL_STATUS_FAIL - Generic error

For more information on status codes, refer to SL STATUS DOCUMENTATION.


Definition at line 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.

Parameters
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


Definition at line 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.

Parameters
N/A

This function stops the WDT counter from running when the system enters sleep mode.

Note

  • This function does not return a status code.


Definition at line 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.

Parameters
N/A

This function starts the 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.


Definition at line 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_INDICATION
Value:
BIT(0)

Wake-up event.


Definition at line 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_WAKEUP
Value:
BIT(1)

Timeout wake-up.


Definition at line 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_S
Value:
BIT(2)

Host wake-up.


Definition at line 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_STAT
Value:
BIT(4)

MCU wake-up status.


Definition at line 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_RESET
Value:
BIT(5)

MCU watchdog reset.


Definition at line 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_RESET
Value:
BIT(6)

MCU watchdog window reset.


Definition at line 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_RESET
Value:
BIT(8)

Network processor watchdog reset.


Definition at line 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_RESET
Value:
BIT(9)

Network processor watchdog window reset.


Definition at line 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_REQUEST
Value:
BIT(10)

Host reset request.


Definition at line 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_RESET
Value:
(SL_SI91X_MCU_WWD_WINDOW_RESET | SL_SI91X_MCU_WWD_RESET | SL_SI91X_NWP_WWD_WINDOW_RESET | SL_SI91X_NWP_WWD_RESET \
| SL_SI91X_HOST_RESET_REQUEST)

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


Definition at line 74 of file components/device/silabs/si91x/mcu/drivers/service/wdt_manager/inc/sl_si91x_wdt_manager.h