cancel
Showing results for 
Search instead for 
Did you mean: 

unusual power consumption by stm32l152cb in run mode

karthikainala
Associate II
Posted on August 14, 2014 at 14:22

I am running a sample code with while(1) loop running from flash using MSI @ 2Mhz  and it takes 6mA, but the data sheet shows that it takes 1mA with MSI @ 4.2Mhz running from flash.

Are there any other configurations to be taken care to reduce power consumption?
6 REPLIES 6
os_kopernika
Associate II
Posted on August 14, 2014 at 23:12

That performance is usually given with peripherals disabled, IOs not floating, OCD disabled, debugger not sucking current through nRESET/SWD, no pullups/downs conducting, without watchdog resetting every 2ms, etc, etc, etc.

karthikainala
Associate II
Posted on August 15, 2014 at 16:39

disabling peripherals:- does disabling peripheral port clocks will suffice (RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOB, DISABLE)

IO's not floating:- what we should do with unused ports ie physically. so that power consumption reduces.

thank you.

stm32forum
Associate II
Posted on August 15, 2014 at 22:03

Unused pins can best best defined as input to reduced power consumption.

Are you sure the core is running at 2Mhz, isn't the pll switch on?

You can check it with the variable SystemCoreClock
karthikainala
Associate II
Posted on August 16, 2014 at 12:18

yes in system_stm32l1xx.c   uint32_t SystemCoreClock         = SYSCLK_FREQ_MSI_2MHz;

is ''input'' the default state of the ports?

adam23
Associate II
Posted on August 25, 2014 at 11:29

The GPIO default state is Analog In i.e. high impedance. So yes the default state should be fine. However it is always good to tight the unused pins to defined level - e.g. ground.

There is many peripherals on STM32 cpu, that may have clocks enabled. It depends on when initialization code you used. Remember that there is a usually some code run before entering main. Look for a function ''SystemInit''.

henry.dick
Senior II
Posted on March 19, 2018 at 11:14

'

Are there any other configurations to be taken care to reduce power consumption?'

yes.