cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F0 standby current way too high

Marek Nowak
Associate II
Posted on May 11, 2017 at 21:37

Hello Guys,

I need your expertise here. Having a problem with current draw in Standby mode ( STM32F091).

I developed custom board with some external components like Accelerometer, Pressure sensor, temperature sensor, RF comm, EEPROM chip. It is powered from two AAA cels.

I attempted several times to go into STANDBY mode, I have obviously shut down all listed components. After all no success, my board takes around 630uA, it can't go any lower.

this is how I put it in standby:

PWR_WakeUpPinCmd(PWR_WakeUpPin_4, ENABLE);

PWR_ClearFlag(PWR_FLAG_WU);

RTC_ClearFlag(RTC_FLAG_ALRAF);

PWR_EnterSTANDBYMode();

I wanted to rule out component by component, difficult to do it on final PCB. I had one spare board, so I mounted only power supply part (boost regulator 3.3V). It consumes only 6uA (quiscent current).

Next I mounted STM32F091, and few capacitors mainly ceramic 100nF + 4uF tanatalum, all as advices per ST app note.

Basically I have very clean, isolated setup STM32 + power supply.

At this stage, I doubt there is a hardware issue in the circuit.

I was looking into capacitor leakage, but certainly I did not find anything that adds up to 630 uA of total current.

Did I miss something, can you guys suggest how to approach this problem.

Thanks,

Marek

8 REPLIES 8
Marek Nowak
Associate II
Posted on May 12, 2017 at 08:55

An important update:

According to ST datasheet, in standby all pins should go Hi-Z state. Does earlier GPIO init affect this?

I just measured some pins state and they are all 0V (low state).

another update:

Solved high current consumption, now I have nice and steady 11.4 uA, however still gpio pins are not changing to Hi-Z while in standby mode.

The missing bit was enabling clock to backup domain, before switching to standby:

RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE);

I just wonder why this piece of information is missing in so many examples one can find on the net.

Posted on May 12, 2017 at 11:06

If you want the pins in High-Z state without massive current flow, set the pins to Analog. Analog mode disables the input amplifier. This amplifier draws high cuurent when the input voltage is not near the rails.

Posted on May 12, 2017 at 11:19

Volatile variables in caches memory may also be a problem.

Posted on May 12, 2017 at 11:30

Sorry, disregard last post, should have gone to another thread. Can I or the moderator my post from 11:19 and this post?

Posted on May 12, 2017 at 11:40

Thanks Uwe,

I tried to set the following for all gpio ports

GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AN; 

GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;

GPIO_InitStructure.GPIO_Speed = GPIO_Speed_Level_3; 

GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; 

Looks like I'm getting 1.8V now, which falls into Hi-Z region.

Regards,

Marek

Posted on May 16, 2017 at 08:59

Hi Uwe,

Something strange is going on here, I'm sure there is an explanation, but I have no clue at the moment.

I was almost there, having only some problems with MCP9808 (temp.sensor).

My problem is still with Hi-Z state, but I have to stress, I'm talking about Hi-Z in standby mode. Datasheet says, that after switching to standby, all pins are in Hi-Z state, with some exceptions like reset and wakeup pins.

Setting PULL/NO PULL for all pins does not change the situation.

There should be no hardware fault, because when I load normal firmware ( not using standby), all functions work properly.

I also verified that MCU was actually in standby mode, by checking the flag with:

PWR_GetFlagStatus(PWR_FLAG_SB);

One important note, when I'm in standby, current consumption is now over 2 mA, therefore it's much worse than it was in the initial state (630uA).

Regards,

Marek

Posted on May 16, 2017 at 11:25

Look carefully at all pins and their connection. Don't forget external connections like a debugger. And look some earlier debug session set DBGMCU_CR.

Marek Nowak
Associate II
Posted on May 25, 2017 at 15:59

@Uwe

Thanks for advice. Sorry for being dumb, I wanted to take a shortcut, was looking for quick wins, but again experience shows there is no such thing, you need to learn everythin hard way

Took me lot of time. I was depending on Hi-Z state of MCU i/o pins. Somehow randomly my RF chip (ST Spirit1) was going to sleep, and occasionaly it did not happen. Lot of confusion. Therefore I have added very weak pull-up (680k) on spitrit's SDN pin (shutdown), this step reduced current by few mA.

Yet another problem 170uA consumed by LIS3DH, some kind of hardware bug (undocumented) i2c address line (SDO) connected to GND was causing this. After connecting SDO to VCC, current consumed by LIS3DH went down to few uA.

Last one, BME280 from Bosch, was taking constanlty around 400 to 500 uA, putting chip in sleep mode did not help (there is i2c command). Finally I found out that there is a reset command, when I did this 3ms after data readout, chip went to low power mode.

Finally entire pcb draws 24 uA.