cancel
Showing results for 
Search instead for 
Did you mean: 

STM32's Low power mode

Wasilewski.Piotr
Associate III
Posted on September 04, 2015 at 20:18

Hello!

I have a problem with low power mode on stm32f103 and stm32f4 When I try to put them in Stop mode they still consume about 4-5mA which is too much ( it should be about 300uA). Here's the imagehttp://stm32f4-discovery.com/2014/10/library-39-power-consumption-modes-for-stm32f4/ . I put it to Stop mode through:

PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI);

I don't do any RCC on GPIO configuration. Above line is the ony line in my program. Also I don't have any external devices connected to STM, any pullup resistors etc. What am I doing wrong ? greetings, Peter
8 REPLIES 8
Posted on September 05, 2015 at 14:13

Debugger connected?

JW
Wasilewski.Piotr
Associate III
Posted on September 05, 2015 at 15:51

No. I'have dsconnected the ST-link programmer. The thing that worries me is that pa13 (swdio) and pb4 and pa15 are all high in IDR register. It's strange because I write 0 to IDR registers, and CRL CRH. 

Posted on September 05, 2015 at 18:23

No. I'have disconnected the ST-link programmer. The thing that worries me is that pa13 (swdio) and pb4 and pa15 are all high in IDR register. It's strange because I write 0 to IDR registers, and CRL CRH. 

I don't think writing to IDR is helpful, you want ODR. Consider carefully what everything is connected too, DISCO boards are often more cluttered than your average breakout board.

Definately want to break the ST-LINK connectivity at a board level. Watch also NRST and SWO.

Where are you measuring the current?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Wasilewski.Piotr
Associate III
Posted on September 05, 2015 at 22:35

Since my last reply I've made a bit of progress. I've managed to reduce the current from 7mA to 2mA on stm32f407. I have mistaken - I was writing to ODR register. But something had to be wrong, because when use the SPL library the current is about 2- 1,5mA. However sometimes it starts to grow, and is able to rise up to 20mA. This is very disturbing, because I cannot allow my device to consume that amount of currnet in sleep mode. 

I'm mesuring current after my external regulator - it's not the problem. I'm still looking for answer why is it that high ( it should be arund 310uA, shouldn't it ? ). Can it be the external capacitors for internal regulator ? I have no idea what's wrong now...

Posted on September 07, 2015 at 06:50

Floating digital input pins? Set all pins where possible to analog input. Reset occurs of whatever source? Toggle an output pin at reset and watch it with an oscilloscope (unloaded pins even if set to output should not present a significant current consumption).

I faintly recall a ''low power tips and tricks'' appnote (not necessarily directly for 'F4, but should be applicable) but can't find it now.

JW

JW

Wasilewski.Piotr
Associate III
Posted on September 07, 2015 at 14:58 Thank You for the reply! You probably thought about this document http://www.st.com/st-web-ui/static/active/en/resource/technical/document/application_note/DM00096pdf I have to say that I read it and carefully complied to all rules included there. That's what I do about digital pins - I set them to Analog input - all of them. My code looks like this:

//no rcc config - internal oscilator
RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN;
RCC->AHB1ENR |= RCC_AHB1ENR_GPIOBEN;
RCC->AHB1ENR |= RCC_AHB1ENR_GPIOCEN;
RCC->AHB1ENR |= RCC_AHB1ENR_GPIODEN;
RCC->AHB1ENR |= RCC_AHB1ENR_GPIOEEN;
RCC->APB1ENR |= RCC_APB1ENR_PWREN;
GPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AIN;
GPIO_Init(GPIOA, &GPIO_InitStructure);
GPIO_Init(GPIOB, &GPIO_InitStructure);
GPIO_Init(GPIOC, &GPIO_InitStructure);
GPIO_Init(GPIOD, &GPIO_InitStructure);
GPIO_Init(GPIOE, &GPIO_InitStructure);
PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI);

So You suggest that I should plug each od the pins to an oscilloscope during cpu reset to see if they're high ? Maybe I didn't understand Your thought. greetings, Peter
Posted on September 10, 2015 at 13:26

No, I was trying to understand this:

> sometimes it starts to grow, and is able to rise up to 20mA.

Can't the reason be inadvertent and repeated resetting? This is why I suggested the pin toggling after reset, to be observed by an oscilloscope. You could observe the reset pin itself too.

What is your hardware? Don't you have a DISCOVERY board to try it there?

JW
Wasilewski.Piotr
Associate III
Posted on September 11, 2015 at 08:06

Thank You for the repy!

I think I partially solved the problem of grovinc current consumption. It seems it was caused by not connected gnd pin of stm32( on the mesurer it looked like internally shorted to gnd ) Now it looks preety stable. 

But still I can't go below 1,8mA. Yes, that's my board, but I know what to do next. I'm going to make a new pcb, and the only thing I'll solder will be the cpu (with capacitors etc. of course). If the current consumption will be as high as it is now then I'll show You the picture of schematic, full code, and maybe You'll find the problem 😉

Anyway thanks for the interest.

greetings,

Peter