I'm having some problem reaching the said ultra-low power available for the STM32Lxx series. With no active register, the UC should consume around 10 uA, but I can't get it down from 1 mA. The datasheet says to first reduce the frequency, then the core voltage then enter the ultra low power mode as one can no longer program it.
The lines I use to enter the lower power mode are :
RCC_MSICmd(ENABLE); % Activate the Multi-speed internal clock RCC_MSIRangeConfig(RCC_MSIRange_0); % Reduce to 32 kHz the Multi-speed internal clock RCC_SYSCLKConfig(RCC_SYSCLKSource_MSI); % The system clock that will be used is the MSI clock. RCC_HCLKConfig(RCC_SYSCLK_Div512); % Reduce furthermore the clock frequency RCC_PCLK1Config(RCC_HCLK_Div16); % Reduce furthermore the clock frequency PWR_VoltageScalingConfig(PWR_CR_VOS); % Reduce the core voltage PWR_EnterLowPowerRunMode(ENABLE); % Enter the low power run mode
I'd be very grateful if someone could point me the mistake I am doing.