cancel
Showing results for 
Search instead for 
Did you mean: 

Looking for library to help debugging power used

Frog
Associate II

Hi,

I'm using a STM32L0, the power consume under stop mode was ~50uA. After some search, i see that i forgot to stop the USART clock which permit a consume under stop mode around 20uA which is far from the datasheet <1uA.

Actually, i'm doing manual search for clock or GPIO which could drain useless power. I wondered if a library or function already exist which could scan all possibility option which drain power and give information about that. I'm not looking for exact number (it could be nice to have approximation) but more a list of all activate option like :

- ADC clock enable

- GPIOx under output state

- MSI clock at x Mhz

etc

So i can figure out what i forgot to disable.

Thanks in advance,

4 REPLIES 4
KnarfB
Super User

STM32CubeMX has a power consumption calculation tool which shows the nuts and bolts:

KnarfB_0-1752566274569.png

You may also check this app note: STM32L0xx ultra-low power features overview

and knowledge base article: Tips for using STM32 low-power modes - STMicroelectronics Community

hth

KnarfB

Thanks for your answer.

I saw that, but my asking is more about a listing at any instant of powered clock/gpio/... STM32 cube mx can help me about that, but can't show the reality at an instant if i make modification in the code.

Which is different with a specific function or library which could printf a result. For example, it could be :

 

MyProg.c
//Some code

ShowEnable();

//Some code

What i would like to have on serial :

Enable clock : USART SPI GPIOA | Output GPIO : GPIOA1 GPIOB5 | Prescaler = 1

 So i can know that if i go on standby mode, i need to have USART/SPI/GPIOA disable, for example. It's not a big deal to write by my own, but maybe someone already works on it and made something better than i will ever do.

I see. Not aware of library code. You may check the peripheral register view in the debugger before actually entering a low power mode, especially the RCC registers.

hth

KnarfB


@KnarfB wrote:

You may check the peripheral register view in the debugger before actually entering a low power mode, especially the RCC registers.


Indeed.

@Frog or you could have your code read those registers for you ...

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.