Quick Answer
STM32 offers three low-power modes: Sleep mode (CPU stopped, peripherals active, fast wake-up ~10μs), Stop mode (most clocks stopped, SRAM retained, wake-up ~5μs to 100μs), and Standby mode (deepest sleep, SRAM lost, only backup registers retained, wake-up ~50ms). Choose based on your power budget and wake-up speed requirements: Sleep for frequent wake-ups, Stop for moderate intervals, Standby for longest battery life.
Introduction
Power management is critical for battery-powered IoT devices and embedded systems. STM32 microcontrollers provide multiple low-power modes that allow developers to balance performance with energy consumption, extending battery life from hours to years depending on the application requirements.
Core Content
1. Sleep Mode
Characteristics
- CPU: Stopped
- Peripherals: Continue running (can wake CPU via interrupts)
- Clocks: All clocks active
- SRAM: Retained
- Wake-up Time: ~10 μs (fastest)
- Power Consumption: ~1-5 mA (varies by device and peripherals)
When to Use
- Waiting for peripheral events (UART data, timer interrupt)
- Interrupt-driven applications
- Short idle periods (milliseconds to seconds)
- Applications requiring fast wake-up
2. Stop Mode
Characteristics
- CPU: Stopped
- Peripherals: Most stopped (some can wake: RTC, external interrupts)
- Clocks: High-speed clocks stopped, low-speed clocks can run
- SRAM: Retained
- Wake-up Time: ~5-100 μs
- Power Consumption: ~20-50 μA (varies by device)
When to Use
- Periodic sensor readings (wake via RTC alarm)
- Waiting for external events (button press, sensor interrupt)
- Medium-duration idle (seconds to minutes)
- Need to preserve state (SRAM retained)
3. Standby Mode
Characteristics
- CPU: Stopped
- Peripherals: All stopped except RTC and IWDG
- Clocks: All stopped except LSE/LSI for RTC
- SRAM: Lost (except backup domain)
- Wake-up Time: ~50 ms (reset sequence)
- Power Consumption: ~2-5 μA (lowest)
When to Use
- Long sleep intervals (minutes to hours)
- Battery-powered devices with infrequent activity
- Applications that can reinitialize after wake-up
- Maximum power savings required
4. Power Mode Comparison
| Mode | Power | Wake-up | SRAM | Use Case |
|---|---|---|---|---|
| Run | ~10-50 mA | N/A | Active | Normal operation |
| Sleep | ~1-5 mA | ~10 μs | Retained | Short waits |
| Stop | ~20-50 μA | ~5-100 μs | Retained | Periodic activity |
| Standby | ~2-5 μA | ~50 ms | Lost | Long intervals |
FAQ
How do I enter low-power modes?
Use HAL functions: HAL_PWR_EnterSLEEPMode(), HAL_PWR_EnterSTOPMode(), HAL_PWR_EnterSTANDBYMode(). Configure wake-up sources before entering low-power mode.
Can peripherals wake the MCU from Stop mode?
Limited peripherals can wake from Stop mode: External interrupts (EXTI), RTC alarms, USB wakeup (if supported). Internal peripherals like UART cannot wake from Stop mode because their clocks are stopped.
What happens to my variables in Standby mode?
SRAM is lost. All variables are reset. Use backup registers (20 bytes on most STM32) or external EEPROM/flash to preserve critical data across Standby cycles.
Conclusion
Effective STM32 power management:
- Sleep: Fastest wake-up, use for short waits and interrupt-driven tasks
- Stop: Balance of power savings and state retention
- Standby: Lowest power, use for longest battery life
- Choose based on: Wake-up frequency, power budget, and state retention needs
Need Help with Low-Power Design?
InnovChip specializes in low-power embedded systems design. Contact us today for assistance with power optimization, battery life estimation, and firmware development.
