cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L0 consumption

xarion
Associate II
Posted on January 17, 2018 at 16:04

Hi Guys

I'm using and STM32L011 MCU with HAL library and RTC running on a WakeUpTimer of 60seconds.

I enter stop mode in the following way:

void gotosleep() { 

   __HAL_RCC_PWR_CLK_ENABLE();

   HAL_PWREx_EnableUltraLowPower();

   HAL_PWREx_EnableFastWakeUp();

   HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);

   SystemClock_Config();

}

I wake the system up with EXTI and then return MCU to a current of 1uA in STOP mode by calling the above.

However when the WakeUp kicks in after 60 seconds, the consumption goes up to 2.5uA and never returns to the 1uA.

I have tried to re-init the RTC with MX_RTC_Init(); but it doesn't make any difference.

All I am doing is incrementing a variable in the HAL_RTCEx_WakeUpTimerEventCallback function, why would current stay high there after?

Thanks

X

3 REPLIES 3
T J
Lead
Posted on January 17, 2018 at 21:32

If you are sure its only 1uA then jumps up, it has to be some peripheral clock, pin clock  or timer running.

to be so low power, you may have to shut down every timer clock and pin manually after the interrupt until you find it.

xarion
Associate II
Posted on January 18, 2018 at 10:52

Hi TJ

Yes it consistently goes from 1uA to 2.4uA when RTC kicks in, after that it remains at 2.4uA.

If I trigger an external gpio interrupt it wakes up and returns back to the 1uA (until RTC kicks in then it wakes and returns to 2.4uA).

I have deactivated all other interrupt and clock sources to make sure.

I have also tries to reinitialize the RTC system with HAL_RTC_MspDeInit() and MX_RTC_Init(); with the same results.

Posted on January 19, 2018 at 00:16

did you use the Cube files ? I am not sure what I could find in there, be its worth a look.

I don't use the on board RTC due to accuracy,

but it sounds like a clock/pin/function is activated by the RTC and not shut down by the RTC.

what did you do with the alarm pins ?

very early in the day...   (1980s) 

we had instruction to make sure all pins are tied hi or low.

otherwise any CMOS input may start to oscillate and draw extra current.

maybe you have a rouge pin ??