Home / Learn Chip Programming / STM32 Low Power: Sleep, Stop, Standby
STM32 Low Power: Sleep, Stop, Standby
Use the three STM32 low power modes and wake sources.
In shortUse the three STM32 low power modes and wake sources.
Theory in plain words
What it is
Sleep stops the CPU clock only. Stop stops all clocks but keeps RAM and registers. Standby powers down almost everything; only backup domain survives.
Why we use it
The same chip can draw 30 mA running or 2 uA in Stop, so mode choice sets battery life.
How it works
Configure wake sources (EXTI, RTC alarm, LPUART), enter with WFI, re-init the clock after Stop because it falls back to HSI.
Where it is used
- Sensor nodes
- Wearables
- Remote loggers
Mode picker
Estimate current by duty cycleTry it Yourself
Stop mode with a short active burst gives months or years. Standby saves the most but loses RAM and re-runs from reset.
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
SystemClock_Config(); // after wake-up the clock is back to HSI: set up PLL again
// Before sleeping: set unused GPIOs to analog, disable debug in sleep (DBGMCU), stop unused peripheralsTip:The ST-LINK debugger itself keeps the MCU awake. Measure power with the debugger disconnected, using a multimeter in series or a Power Profiler Kit.
Quick quiz
1. Which mode keeps RAM and registers but stops clocks?
State is preserved in Stop.
2. After Stop mode you must...
It restarts on HSI.