2025-10-07 7:54 AM - last edited on 2025-10-07 8:03 AM by Andrew Neil
I’m testing low-power modes on my STM32 B-L072Z-LRWAN1 board and measuring the current consumption.
When I measure the current using a Xiao PowerBread, I get around 20 mA on the 5 V rail, even when the MCU enters Sleep Mode.
My question is whether the on-board LEDs (LD5 and LD7) could be masking the expected drop in power consumption.
According to the board documentation:
LD7 (Red) is the 5 V Power LED, which is always on when 5 V is present.
LD5 (Green) is the ST-LINK COM LED, powered from the ST-LINK interface and active during communication.
Since these LEDs are powered from the 5 V rail and the ST-LINK section, they remain on regardless of the MCU power mode.
So my questions are:
Can these LEDs (and the ST-LINK interface) prevent me from seeing the real power drop when the MCU goes into Sleep Mode?
What is the best way to measure only the MCU’s current consumption, excluding the ST-LINK and LEDs?
Should I remove some jumpers or power the MCU directly through the VIN V pin?
Thanks in advance.
2025-10-07 8:02 AM - edited 2025-10-07 8:04 AM
@Mariiian09 wrote:
Can these LEDs (and the ST-LINK interface) prevent me from seeing the real power drop when the MCU goes into Sleep Mode?
Absolutely!
@Mariiian09 wrote:2. What is the best way to measure only the MCU’s current consumption
That's what the 3 current measurement links are for.
But even then there are still some hidden current drains:
2025-10-09 2:40 AM
Hi Andrew,
Would you happen to have a working example code for the STM32 B-L072Z-LRWAN1 that demonstrates the implementation of low-power modes?
I would greatly appreciate it if you could share it or indicate where it can be found.
Thank you in advance.
2025-10-09 2:59 AM
> When I measure the current using a Xiao PowerBread, I get around 20 mA on the 5 V rail, even when the MCU enters Sleep Mode.
On a related note, I would be careful with such a device.
Said Xiao board uses a 13-bit ADC for current measurement, which gives you an accuracy of about 1/8000 of the full range at best. And you find very little about accuracy and tolerances in the specs.
Check the user manual of your board, many ST eval boards have an IDD jumper you can remove, and attach an ammeter for measuring the current of the MCU section.
2025-10-09 3:14 AM
@Mariiian09 wrote:I measure the current using a Xiao PowerBread,.
You mean this: https://www.seeedstudio.com/XIAO-PowerBread-p-6318.html ?
As @Ozone suggested, that's not going to much use in this type of application.
The current consumption in this type of application is very "peaky" - you're not going to get anything useful by just looking at displays.
Not even with a proper multimeter.
What you need is something like the STLINK-V3PWR or X-NUCLEO-LPM01A - that will give you a proper, real-time view of the current.
I actually use one of these: https://www.nordicsemi.com/Products/Development-hardware/Power-Profiler-Kit-2
2025-10-09 3:18 AM
@Mariiian09 wrote:Would you happen to have a working example code for the STM32 B-L072Z-LRWAN1 that demonstrates the implementation of low-power modes?
Sorry, I don't.
You can find examples for the STM32L072 itself in the L0 firmware pack:
https://www.st.com/en/embedded-software/stm32cubel0.html
The I-CUBE-LRWAN pack uses low-power modes.