Standby/Shutdown mode

Browse source code on GitHub

Overview

This sample is a minimum application to demonstrate basic power management of Standby mode and shutdown mode behavior in a basic blinking LED set up you can enter in shutdown mode or in standbymode mode. Press and hold the user button: when LED2 is OFF to enter to Shutdown Mode when LED2 is ON to enter to Standby Mode release the user button to exit from shutdown mode or from shutdown mode.

Requirements

The board should support enabling PM. For a STM32 based target, it means that it should support a clock source alternative to Cortex Systick that can be used in core sleep states, as LPTIM (st,stm32-lptim). For another board than nucleo_L476RG please adjust wakeup pin into config_wakeup_features().

Building and Running

Build and flash standby_shutdown as follows, changing nucleo_L476RG for your board:

west build -b nucleo_L476RG samples/boards/st/power_mgmt/standby_shutdown
west flash

After flashing, the LED starts to blink. Press and hold the user button: when LED2 is OFF to enter to Shutdown Mode when LED2 is ON to enter to Standby Mode release the user button to exit from shutdown mode or from shutdown mode.

PM configurations

By default, CONFIG_PM is enabled.

See also

System power off
System