4
\$\begingroup\$

I'm trying to configure an STM32L011-Nucleo developement board to consume about 600 uA of current or so. It uses an STM32L011K4.

The datasheet states that this should be possible if I drive the MCU at 8 MHz and keep it in sleep mode for most of the time.

enter image description here

So I expect that MCU should consume about 1.3 mA or so in run mode. My exact case isn't listed - there are examples for 16 MHz HSI and 8 MHz HSE. I think that 1.3 mA is a good estimation.

In sleep mode:

enter image description here

So it is the same story: looking at 16 MHz HSE and 8 MHz HSE I could expect less than than 500 uA of consumption with 8 MHz HSE in sleep.

To test the current I put 100 Ohm through-hole resistor on the power jumper like this:

enter image description here

After all I have the following picture:

enter image description here

As you can see I have 1.7 mA in sleep and 2.2 mA in run modes. Which is WAY more than I expected.

I've already set all unused GPIO's to GPIO_Analog mode as I expect that this will minimize leakage current.

I've checked the schematic to verify that VDD is only feeding the MCU (looks like this is true).

I tried much lower frequencies and I was able to drop current consumption to 400 uA at 625 kHz which is also not match to datasheet...

Well, I have to state that I'm confused. AVR controllers (ATmega48PA) behaved as expected in one of my previous device.

Is there anything I am missing?

My clock configuration:

enter image description here

UPDATE

After I changed the PLL setting to None I reached less consumption: 1.1 mA for sleep and 2 mA for run mode:

enter image description here

\$\endgroup\$

This question has an open bounty worth +100 reputation from Roman Matveev ending in 2 days.

This question has not received enough attention.

Friends! I'm still need the answer as my problem was not solved yet. I'd need my question reviewed by anyone deeply knowing STM32 core architecture. Thank you in advance!

  • 1
    \$\begingroup\$ How did you probe the shunt? Maybe your ground is shifted by some additional currents? \$\endgroup\$ – jusaca Mar 15 at 9:33
  • 1
    \$\begingroup\$ @MarcusMüller I wouldn't call 50Ohms by word typical but in my case the probe marked as 10 MOhms for 10:1 option (which is my case). My scope does not provide any optin to put the input into 50 Ohms mode so I think that it is really in high impedance mode. At least I hope so :))) \$\endgroup\$ – Roman Matveev Mar 15 at 9:35
  • 3
    \$\begingroup\$ What I would like to see is the full schematic, containing everything that is connected to the uC and the VO and +3V3 nets. \$\endgroup\$ – Bimpelrekkie Mar 15 at 11:08
  • 2
    \$\begingroup\$ How many of peripherals are enabled when you enter sleep mode? Are all unnecessary clocks disabled? I don't know the STM32, but when current consumption is not as expected, it's often some MCU/CPU setting that have been missed. If you current measuring setup works with the AVR MCU there is no reason it shouldn't work with the STM32. I would look for the solution in the CPU configuration. \$\endgroup\$ – Peter Karlsen Mar 15 at 11:12
  • 1
    \$\begingroup\$ Did you notice that all datasheet numbers are listed for Vcore=1.5V and 1.8V, while you are feeding the MCU with 3.3V? \$\endgroup\$ – Ale..chenski Mar 15 at 14:43
3
\$\begingroup\$

You are measuring the voltage drop across the resistor with a single ended probe, thus grounding (earthing) one side.

Assuming that your scope is properly grounded, if you are using a supply that is not perfectly floating, you are probably measuring the current consumption of the board, plus the leakage in the supply. Many "isolated" supplies still use/require a resistor between the output negative voltage and the earth contact of the input.

Try putting the ground clip on the VDD side, and the probe tip on the MCU side. In this way, you still get leakage, but not into the resistor.

\$\endgroup\$
3
\$\begingroup\$

I suspect the unexpected current is being used by peripheral clocks.

The code generated by STM32CubeMX enables a bunch of clocks during initialization and leaves them running. Even if a clock is necessary to configure a peripheral, that clock can often be disabled afterwards (assuming you don't need that peripheral, of course!)

Go through your initialization code, noting which clocks get enabled. I'm using another family of STM32L's, not your STM32L0, but the commands should be similar. Look for something like LL_AHB1_GRP1_EnableClock(), or perhaps RCC_APB1PeriphClockCmd(), etc.

It's probably worth doing a text search for AHB and APH, to make sure you don't miss any. If you exclude the STM libraries from your search, the results shouldn't be overwhelming.

Also, there are some clocks which activate automatically. For example, if your WDT is active, it will force on a clock to use as its time base (likely the LSI clock).

There is a list of peripheral current consumption on page 61 of your linked datasheet.

\$\endgroup\$
0
\$\begingroup\$

i think this link might help you in your problem

https://www.digikey.com/eewiki/display/microcontroller/Low-Power+Modes+on+the+STM32L0+Series

\$\endgroup\$

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.