STM32L053: Unexplained power consumption jump from ~30µA to 6.0mA in STOP/LPSLEEP mode
Hi everyone,
I'm working on a battery-powered flow meter application using the STM32L053, and I'm running into a massive, unexpected jump in power consumption.
Previously, our device was successfully hitting the 0.0xx mA (around 30µA) range while maintaining our sleep cycle and keeping the LCD on. However, our boards are now consistently drawing between 5.3mA and 6.0mA, and I am struggling to isolate the leak.
Application & Setup Details:
- MCU: STM32L053 (64-pin)
- Clocking: LSE is disabled. We are relying entirely on the MSI (262 kHz for run mode) and the LSI (~37 kHz) for the RTC and LCD.
- Peripherals Active in Sleep:
- LCD Controller: Driving a large custom 7-segment display (GTD2892B). Configured for 1/4 Duty, 1/3 Bias, running off the internal voltage source (
VSEL = 0or tied to 3.3V). - LPTIM1: Running asynchronously in the background on the LSI to count flow pulses via an external op-amp (MCP6042).
- RTC: Set up with the WakeUp Timer to wake the MCU every 100ms to update the flow math and handle UI debouncing.
- LCD Controller: Driving a large custom 7-segment display (GTD2892B). Configured for 1/4 Duty, 1/3 Bias, running off the internal voltage source (
- Sleep Mode: The main loop spends 99% of its time in either Low-Power Sleep (
LPSLEEP) orSTOPmode (withPWR_LOWPOWERREGULATOR_ONandHAL_PWREx_DisableLowPowerRunMode()handled properly before entry).
What I've already checked/fixed:
- PVD (Programmable Voltage Detector): I noticed this was left on and disabled it before entering STOP mode, but that only accounts for a ~2.5µA leak, nowhere near the 5mA jump.
- GPIOs: All unused GPIOs are parked in
GPIO_MODE_ANALOGwith no pull-ups/pull-downs. SWD pins are left in their default alternate function. - LCD High Drive (HDEN): We were previously struggling with a "dull" LCD contrast (glass capacitance sag) and experimented with enabling High Drive (
LCD_FCR_HD). I know the continuous resistor network draws more current, but I wouldn't expect a 5mA jump from this alone. - Debug Modules:
HAL_DBGMCU_DisableDBGSleepMode()andSTOPModeare called to ensure the debugger isn't keeping the core awake. - Flash: Flash is powered down during sleep (
FLASH_ACR_SLEEP_PD).
My Questions:
- Has anyone experienced a ~5mA leak specifically related to the LCD controller on the L0 series? Does using the High Drive (
HDEN) network scale up to the milliamp range on large glass? - Are there any known latch-up states or internal shoot-through currents on the STM32L053 if an Alternate Function input (like my LPTIM1 pin) sits at an intermediate voltage from my external op-amp?
- What other internal peripherals could accidentally be left clocked on the APB1/APB2 buses that would result in exactly a ~5mA floor in STOP mode?
Any insights or debugging steps to trace this 5.3mA - 6mA draw would be highly appreciated!
Thanks in advance.
code - https://github.com/vedantjadhav304/BatterypoweredFLSTM32L
