Skip to content

LowPowerModes

Reto Da Forno edited this page Jun 24, 2021 · 1 revision

Guide to Low-Power Modes (LPM)

The different low-power modes (a general overview)

The following applies to MCUs from ST and TI, but may also be valid for other types of MCUs.

  • Sleep mode (sometimes called LPM0) generally refers to a low-power mode where the CPU is off, but all other peripherals can remain active. Wake-up delay is close to zero. Current drain in sleep mode is in the mA range.
  • Stop mode (also known as LPM3/LPM4) refers to a low-power mode where all high-speed clocks are disabled, only low-frequency clock sources such as the 32kHz oscillator remain active. Wake-up delay is still very short (a few us). Register and SRAM content is retained. Current drain in stop mode is in the uA range.
  • In standby and shutdown mode (aka LPM3.5/LPM4.5), Vcore domain is powered down, all clocks are stopped, but there is commonly the option to leave the RTC or the low-speed crystal oscillator running. The system can be woken with e.g. an external interrupt via certain GPIOs, the RTC or the nRST pin. There is usually no state retention (register and SRAM contents are lost), therefore the whole MCU needs to be re-initialized. Wake-up delay in this mode is considerably longer (~1ms). Current drain in the shutdown mode is in the sub uA range.

Apart from these basic classes of low-power modes, there are often additional (intermediate) modes.

Checklist

A few things to consider in order to achieve low current drains in LPMs:

  • Turn off unused peripherals before entering the low-power mode. Active peripherals may prevent the LPM entry.
  • Turn off unused clocks / clock sources.
  • For stop mode: switch the system clock to the internal RC oscillator and disable the external high-frequency crystal oscillator.
  • Lower the frequency of peripheral clocks that keep running in low-power mode.
  • Pay special attention to the GPIO configuration:
    • Configure all unused (= unconnected) pins as outputs (low) or in analog mode.
    • Don't leave pins floating: make sure all input pins have either a driving source or a pull resistor. If they have both, make sure the drive level matches the pull resistor.
    • Ensure that GPIOs don't source current to external circuits (e.g. power-off sensors). Even input pins with an internal pullup can source hundreds of microamps.
    • On the DPP, don't forget to configure the pins on both sides (COM and APP) appropriately. There is a 'recommended pin configuration' guide for each platform. Also, make sure BOLT runs on the latest firmware.
  • STM32 specific:
    • If a GPIO needs to be reconfigured (overwrite an existing config), call HAL_GPIO_DeInit() first before re-initializing the pin (otherwise some register are not cleared, which can cause excessive current drain of more than 0.5mA).

Links

Clone this wiki locally