Zbotic Logo Zbotic Logo
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

  • Shop
  • About Us
  • Contact Us
  • Reseller
  • Blogs
020 69134444
1800 209 0998
[email protected]
Help Desk
Facebook Twitter Instagram Linkedin YouTube
Zbotic Logo Zbotic Logo
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

All departments
  • 3D Print Service
  • 3D Printer
  • Batteries & Chargers
  • Development Boards
  • Drone Parts
  • EBike parts
  • Sensor Modules
  • Electronic Components
  • Electronic Modules
  • IoT and Wireless
  • Mechanical Parts and Workbench Tools
  • Motors & Drivers & Pumps & Actuators
  • DIY and Robot Kits
  • Show more
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
Return to previous page
Home Development Boards & SBCs

STM32 Low Power Modes: SLEEP, STOP and STANDBY Guide

STM32 Low Power Modes: SLEEP, STOP and STANDBY Guide

March 11, 2026 /Posted byJayesh Jain / 0

Implementing STM32 low power modes — Sleep, Stop, and Standby correctly is critical for battery-powered Indian IoT applications. STM32’s sophisticated power management hardware can reduce current from 100 mA active to under 1 µA in Standby mode, extending battery life from hours to years.

Table of Contents

  • STM32 Power Architecture
  • Sleep Mode
  • Stop Mode
  • Standby Mode
  • Wakeup Sources
  • STM32L4: Ultra-Low Power Series
  • Frequently Asked Questions

STM32 Power Architecture

STM32 microcontrollers have multiple power domains that can be independently powered down. Understanding these domains is key to achieving STM32 low power modes effectively:

  • VDD domain: Main supply (GPIO, most peripherals) — powered down in Standby
  • VBAT domain: RTC, backup registers — powered from backup battery during Standby
  • V_CORE domain: CPU and core logic — powered down in Standby, retained in Stop

On STM32F4 series, the CPU draws ~100 mA at 168 MHz. In Standby mode with only RTC running, this drops to 2–4 µA — a 50,000× reduction.

Recommended: 4×18650 Lithium Battery Shield V8 V9 for Arduino ESP32 ESP8266 — 4×18650 Battery Shield — for Indian outdoor IoT deployments using STM32 low-power modes, a 4×18650 pack provides 10,000+ mAh for years of operation.

Sleep Mode

In Sleep mode, only the CPU core clock is stopped. All peripherals (UART, SPI, DMA, ADC) continue running. Any interrupt immediately wakes the CPU — interrupt latency is 1–3 µs. Current drops from ~100 mA to ~15–30 mA on STM32F4.

/* STM32 Sleep Mode entry */
#include "stm32f4xx_hal.h"

void enterSleepMode(void) {
  // Ensure pending interrupts are cleared
  __WFI(); // Wait For Interrupt - enters Sleep
  // CPU wakes here on any enabled interrupt
}

// Enter Sleep from HAL
HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON, PWR_SLEEPENTRY_WFI);

Sleep mode is useful for: peripherals that must continue running during CPU idle periods (UART reception, ADC continuous mode), SysTick-based delays without busy-waiting.

Recommended: 2×18650 Lithium Battery Shield for Arduino ESP32 ESP8266 — 2×18650 Battery Shield for Arduino/ESP32 — adaptable for STM32 low power builds; provides stable 5V/3.3V supply for STM32 sensor nodes with built-in charging.

Stop Mode

In Stop mode, all clocks are stopped (HSI, HSE, HSI14, HSI48, PLL). SRAM and register content is preserved. Wakeup sources are limited: EXTI lines (GPIO interrupts), RTC alarm/wakeup, or comparison events from comparators. Current drops to 50–300 µA on STM32F4, or as low as 2 µA on STM32L4.

/* STM32 Stop Mode with RTC wakeup */
void enterStopWithRTCWakeup(uint32_t wakeupSeconds) {
  // Configure RTC wakeup timer
  HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, wakeupSeconds,
                               RTC_WAKEUPCLOCK_CK_SPRE_16BITS);
  
  // Disable SysTick to prevent early wakeup
  HAL_SuspendTick();
  
  // Enter Stop Mode (main regulator on = faster wake)
  HAL_PWR_EnterSTOPMode(PWR_MAINREGULATOR_ON, PWR_STOPENTRY_WFI);
  
  // Wake here - clocks are now at HSI (8 MHz)
  // MUST restore system clock to PLL for full speed operation
  SystemClock_Config(); // Re-configure PLL to full speed
  
  HAL_ResumeTick();
  HAL_RTCEx_DeactivateWakeUpTimer(&hrtc);
}

Standby Mode

Standby is the deepest sleep — only VBAT domain (RTC, backup registers, WKUP pins) is powered. SRAM content is LOST on entry. On waking, MCU performs a full reset sequence (same as power-on reset). Current: 2–4 µA on STM32F4, 0.4 µA on STM32L4, 0.03 µA on STM32L4 Shutdown mode.

/* STM32 Standby Mode with WKUP pin or RTC alarm */

// IMPORTANT: Save state to backup registers or EEPROM before standby
// SRAM content will be LOST
HAL_PWR_EnableBkUpAccess();
HAL_RTCEx_BKUPWrite(&hrtc, RTC_BKP_DR1, systemState); // Save state

// Configure wakeup: WKUP pin (PA0) on rising edge
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN1); // PA0 = WKUP

// Or RTC-based wakeup
HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, 3600, // 1 hour
                             RTC_WAKEUPCLOCK_CK_SPRE_16BITS);

// Clear all wakeup flags before entering standby
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB);
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);

// Enter Standby
HAL_PWR_EnterSTANDBYMode();
// Execution continues from reset vector on wakeup, not here

// On next boot, check if waking from standby:
if (__HAL_PWR_GET_FLAG(PWR_FLAG_SB) != RESET) {
  systemState = HAL_RTCEx_BKUPRead(&hrtc, RTC_BKP_DR1); // Restore state
  __HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB);
}
Recommended: ESP32-WROOM-32E Development Board Module for Arduino — ESP32-WROOM-32E — for simpler battery IoT projects in India, ESP32’s deep sleep (10-20 µA) with much simpler API is often preferable to STM32 Standby.

Wakeup Sources Comparison

Wakeup Source Sleep Stop Standby
Any interrupt Yes No No
EXTI GPIO Yes Yes WKUP pins only
RTC alarm Yes Yes Yes
SRAM preserved Yes Yes No
Wake time ~1 µs ~50 µs ~500 µs (full reset)

STM32L4: Ultra-Low Power Series

For battery-optimised Indian IoT (smart meters, wearables, soil sensors), STM32L4 series is purpose-built for low power. Key advantages over STM32F4:

  • Stop 2 mode: 0.4 µA with RTC running (vs 300 µA on F4)
  • Shutdown mode: 30 nA (vs 4 µA Standby on F4)
  • LP run mode: 10 µA at 2 MHz core clock (real CPU execution)
  • Smart peripherals: LPUART, LPTIM operate independently from CPU during Stop mode
  • Available in India: STM32L476RG Nucleo (₹1,500–2,000 from Mouser India)

Frequently Asked Questions

Can I enter Stop mode during FreeRTOS task execution?

Yes, via tickless idle mode. Configure FreeRTOS’s configUSE_TICKLESS_IDLE and implement vPortSuppressTicksAndSleep() for STM32 Stop mode entry when all tasks are blocked. STM32CubeIDE generates this code.

What happens to UART if I enter Stop mode?

Standard USART stops. STM32L4’s LPUART continues working in Stop 2 mode — useful for waking from serial commands while in ultra-low-power state. STM32F4 UART requires wakeup via EXTI before UART operation resumes.

Which STM32 is best for a sensor on 2xAA batteries in India?

STM32L4 series. STM32L432KC (Nucleo-L432KC, ₹800–1,200) achieves 0.4 µA in Stop 2 with RTC — a 2×AA 3000 mAh pack would last theoretically decades in sleep mode with hourly wakeups for sensor reading and transmission.

Shop Development Boards & SBCs at Zbotic →

Tags: battery IoT India STM32, STM32 low power, STM32 sleep mode, STM32 standby mode, STM32 stop mode, STM32L4 low power
Share Post
  • Facebook
  • Linkedin
  • Whatsapp
Open Source Hardware Boards: A...
blog open source hardware boards alternatives to arduino in india 599198
blog bifacial solar panels worth it for indian rooftop systems 599208
Bifacial Solar Panels: Worth I...

Related posts

Svg%3E
Read more

Battery Charger Module TP4056: LiPo and 18650 Charging Guide

April 1, 2026 0
The TP4056 battery charger module is one of the most essential components for any battery-powered electronics project. Costing under ₹30,... Continue reading
Svg%3E
Read more

Buck Converter vs Boost Converter: Voltage Regulation Guide

April 1, 2026 0
Understanding buck converters vs boost converters is essential for every electronics project involving power management. Whether you are stepping down... Continue reading
Svg%3E
Read more

Google Coral TPU: Accelerating AI Projects on Raspberry Pi

April 1, 2026 0
The Google Coral TPU (Tensor Processing Unit) transforms a Raspberry Pi from a sluggish AI hobbyist tool into a real-time... Continue reading
Svg%3E
Read more

NVIDIA Jetson Nano Projects India: Getting Started Guide

April 1, 2026 0
The NVIDIA Jetson Nano is the most accessible GPU-accelerated AI computer for developers in India. With 128 CUDA cores, a... Continue reading
Svg%3E
Read more

ATtiny85 Projects: Tiny Microcontroller for Space-Constrained Builds

April 1, 2026 0
The ATtiny85 is the Swiss Army knife of tiny microcontrollers — just 8 pins, 8 KB of flash, and a... Continue reading

Add comment Cancel reply

Your email address will not be published. Required fields are marked

Facebook Twitter Instagram Pinterest Linkedin Youtube

Get the latest deals and more.

Download on Google Play Download on the App Store

Call us: 020 69134444 / 1800 209 0998

Monday - Saturday 09:30 AM - 06:00 PM
For Technical Supports Email: [email protected]
For Sales / Enquiries Email: [email protected]

  • My Account

    • Cart

    • Wishlist

    • Checkout

    • My Orders

    • Track Order

    • My Account

  • Information

    • FAQs

    • Blogs

    • Career

    • About Us

    • Contact Us

    • Payment Options

  • Policies

    • Privacy Policy

    • Terms & Conditions

    • GST Input Tax Credit

    • Shipping Return Policy

    • E-Waste Collection Points

    • Our Sitemap

© Zbotic.in is registered trademark of Moxie Supply Pvt Ltd – All Rights Reserved
Login
Use Phone Number
Use Email Address
Not a member yet? Register Now
Reset Password
Use Phone Number
Use Email Address
Register
Already a member? Login Now