Debugging Points During M4 Sleep#

Debug Prints#

Use the Ultra-Low-Power (ULP) Universal Asynchronous Receiver/Transmitter (UART) in the sleep and wake-up path to verify sleep entry and wakeup.

GPIO Toggles#

  • Before sleep: Toggle a General Purpose Input/Output (GPIO) in the M4 sleep path.

  • After wake-up: Drive the same GPIO high right after Interrupt Service Routine (ISR) exit/context restore. This gives a crisp pulse you can capture on a logic analyzer.

Checklist before M4 Sleep#

Before the M4 core transitions to a low-power state, the application performs a series of checks to ensure a clean and stable sleep entry. Ensure all sleep blockers are cleared: sl_si91x_power_manager_is_ok_to_sleep(). These are the checks done automatically when Power Manager sleep is called.

sl_si91x_power_manager_is_ok_to_sleepsl_si91x_power_manager_is_ok_to_sleep

  • Check active events: Verifies that no high-priority operations (such as data transfers, sensor sampling, or computations) are currently active, and ensures there are no pending Power Manager state requirements.

  • Internal state evaluation: Reviews communication buffers, confirming there are no pending packets or events from the Network Processor Subsystem (NWP).

  • Check for ongoing memory operations: Ensures all flash or Non-Volatile Memory (NVM) write operations have completed successfully before initiating the M4 sleep sequence.

Checks when PS2 State is Added#

  • Add preprocessor definitions:

    • SL_SI91X_ULP_STATE_ENABLE=1

    • SLI_SI91X_MCU_ENABLE_RAM_BASED_EXECUTION=1

  • Because flash is disabled in PS2, driver files are copied to RAM automatically by the driver.

Transition Callbacks#

The Power Manager lets you subscribe to power-state transition events (for example, entering/leaving PS4/PS3/PS2, active, or sleep) using sl_si91x_power_manager_subscribe_ps_transition_event. Your callback is invoked with the from→to states so you can log, timestamp, and validate every transition.