STM32L010,in STOP mode 16 uA instead of <1uA
Hi,
asking help for a behaviour that i was not able to find in previous discussions.
i'm using for the first time this value line microcontroller :
STM32L010K4T6 ,other production details printed on case are GQ20T VG CHN74815.
I im using it on an empty PCB, only mounting the microcontroller,some filter caps on VDD ,RC on reset and 5 pins programming connector,no other components that can be accused of leakages.
The software is minimal,generated with CubeMx,no peripheralor systick interrupt are activated.I use a sooftware delay to have the program running for few seconds,just to read the current changing when STOP mode enters.The code produces on X_NUCLEO_LPM01A board the following measurements:345 uA in RUN and 16,5 uA in STOP.
Forcing all pins in analog mode does not change nothing.My doubt is if i'm actually in STOP mode.I should wake from STOP to verify it,and i'll do it soon.
By now thanks for any hint or link to previous discussions on the same issue.
Diego
Milan,Italy
int main(void)
{
unsigned int count=1000000;
HAL_Init();
SystemClock_Config();
while(count--);
Enter_Stop();
while (1){}
}void Enter_Stop( void )
{
//RCC->IOPENR |= RCC_IOPENR_GPIOAEN;
RCC->APB1ENR &= ~( RCC_APB1ENR_PWREN );
DBGMCU->CR &= ~0x2;
PWR->CR |= PWR_CR_FWU | PWR_CR_ULP | PWR_CR_LPSDSR;
/* Prepare to enter stop mode */
PWR->CR &= ~( PWR_CR_PDDS ); // Enter stop mode when the CPU enters deepsleep
RCC->CFGR |= RCC_CFGR_STOPWUCK; // HSI16 oscillator is wake-up from stop clock
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; // low-power mode = stop mode
__disable_irq();
I2C1->CR1 &= ~I2C_CR1_PE; // Address issue 2.5.1 in Errata
__WFI(); // enter low-power mode
}