cancel
Showing results for 
Search instead for 
Did you mean: 

High current absorption issue in Low power sleep and stop mode

SPozz.1
Associate III

I'm trying to minimize the current consumption of an STM32G031K but I can't reach the ones calculated by the STM32CubeMX in any way. I tried with Low Power Sleep Mode, Stop Mode 0 and Stop mode 1. In Stop Mode 1, according to STM32CubeMX I should have 3.36uA, actually it consumes over 700uA. The MCU is connected in the minimum possible configuration: VDD=2.8V, GND, NRST connected to the 0.1uF capacitor, SWDIO and SWCLK. All other pins are not connected.

RCC->IOPSMENR = 0u;

RCC->AHBSMENR = 0u;

RCC->APBSMENR1 = 0u;

RCC->APBSMENR2 = 0u;

HSI divided by 128; LSI disabled; PLL disabled;

DBG->CR = 0;

PWR->CR1 |= PWR_CR1_FPD_STOP | PWR_CR1_FPD_LPSLP

SCB->SCR = SCB_SCR_SLEEPDEEP_Msk

PWR->CR1 |= PWR_CR1_LPR | PWR_CR1_LPMS_0 (just before WFI or WFE)

STM32CubeIDE PWR_LPSLEEP example, compiled as is, do not solve.

gpio set pin and gpio reset pin added just before and after WFI/WFE confirm that the MCU is executing the wait. The ST-Link is physically disconnected before power cycling the MCU and measuring the current.

The only way to go below 2uA is to go into Shutdown mode, but in this mode the MCU doesn't wake up if I generate an external interrupt (which I need).

What am I missing ?

Please help.

1 ACCEPTED SOLUTION

Accepted Solutions
SPozz.1
Associate III

I solved. The problem was due to the configuration of the pins.

Configuring them all as analog inputs (except those used to generate the wake-up interrupt, which have been configured as input+EXTI), the consumption dropped below 3uA.

Attention should be paid to the pins that normally work as an output; in some cases, I had to configure them as inputs with pull-up/pull-down to maintain the desired output level. It is not possible to keep them configured as an output, otherwise the consumption increases by about 100uA for each activated output, in my case about 1.20mA (even though all the pins of the MCU are left unconnected, except obviously NRST, VDD and VSS).

Anyway, many thanks to Piranha for his time and trying.

View solution in original post

2 REPLIES 2
Piranha
Chief II

Your code and approach seems adequate, but there still are some fine details, which could be critical. Try adjusting the code according to this article:

https://community.st.com/s/question/0D53W00001bnh8dSAA/how-to-enter-standby-or-shutdown-mode-on-stm32

The Stop also have some specifics:

https://community.st.com/s/question/0D53W00001nYvGgSAK/mc-sdk-not-work-with-mcu-stop-mode

SPozz.1
Associate III

I solved. The problem was due to the configuration of the pins.

Configuring them all as analog inputs (except those used to generate the wake-up interrupt, which have been configured as input+EXTI), the consumption dropped below 3uA.

Attention should be paid to the pins that normally work as an output; in some cases, I had to configure them as inputs with pull-up/pull-down to maintain the desired output level. It is not possible to keep them configured as an output, otherwise the consumption increases by about 100uA for each activated output, in my case about 1.20mA (even though all the pins of the MCU are left unconnected, except obviously NRST, VDD and VSS).

Anyway, many thanks to Piranha for his time and trying.