cancel
Showing results for 
Search instead for 
Did you mean: 

High Current Consumption in Stop2 mode STM32L4

Aaron McNeil
Associate III

I am trying to achieve the lowest power consumption possible when entering Stop2 mode with the STM32L476. I have verified that all of my GPIO are in the correct state before entering Stop2 mode. I am also very confident that it is not any external circuitry on my board at this point as I have done extensive testing.

My current consumption is about 280 uA when entering stop2 mode. About 35 uA can me accounted for with the current draw of a couple of my external circuits. However, the MCU itself should be drawing around 3-5 uA.

Are there any things someone can point me to to check in order to see what might be causing the problem?

In my sleep projects code, I initialize the system clock, all gpios, and several peripherals. Then, I deinitialize all said peripherals, set my GPIOs to the proper settings, and then enter sleep mode.

Any guidance would be greatly appreciated. I have been stuck on this for weeks.

1 ACCEPTED SOLUTION

Accepted Solutions
Aaron McNeil
Associate III

After a few weeks of fighting with this I finally fixed my current consumption problem. Apparently, when using the HAL library to initialize a few GPIO that I am using as interrupts, as well as the FMC controller for external SRAM, you have to call HAL_GPIO_DeInit() before you are able to reconfigure the GPIO to prepare it for Stop2 mode. Once I added HAL_GPIO_DeInit() before I reinitialized them, I was able to get my overall current down to 39 uA, which is exactly what I was expecting.

I'm not sure if there is a more efficient way to go about this, as I will have to reinitialize all the GPIO and SRAM upon wake up, but at least I am now able to get the low power I was expecting.

View solution in original post

4 REPLIES 4
Piranha
Chief II

Take a look at DBGMCU_CR register. Try setting it to zero before entering low-power mode. Debugging connection will be lost, of course. Also disconnect debugger physically, because it's pins can also draw some current.

Thank you for the reply. My DBGMCU_CR register is 0 before entering low power mode. Also, when my debugger is physically connecting i am drawing around 430 uA. When I disconnect it is when I get my current of 280 uA.

Aaron McNeil
Associate III

Is there a way to see what my register settings are after I enter stop2 mode? I am thinking the best way to move on from here is to compare registers on my board to the nucleo board using the sleep example and see if I can find any differences. Once I get to the point in code that sets the SLEEPDEEP but of Cortex System control register, my debugger stops working so I cannot see my register settings.

If I compare all my registers just before that point, they all look the same.

I'm at my wits end here...

Aaron McNeil
Associate III

After a few weeks of fighting with this I finally fixed my current consumption problem. Apparently, when using the HAL library to initialize a few GPIO that I am using as interrupts, as well as the FMC controller for external SRAM, you have to call HAL_GPIO_DeInit() before you are able to reconfigure the GPIO to prepare it for Stop2 mode. Once I added HAL_GPIO_DeInit() before I reinitialized them, I was able to get my overall current down to 39 uA, which is exactly what I was expecting.

I'm not sure if there is a more efficient way to go about this, as I will have to reinitialize all the GPIO and SRAM upon wake up, but at least I am now able to get the low power I was expecting.