High current absorption issue in Low power sleep and stop mode
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.
