2021-04-15 08:03 AM
Hello,
I've tested a few weeks now without solution, hopefully somebody can help me with this topic.
I try to reach the Low Power mode (LP Run or LP Sleep), but when I enter it, the consumption is still at 150µA (~270µA in debug mode).
I even tested with a simplified initialization without any peripherals except a EXTI to wake up from interrupt.
Do I miss something essentially? Why don't I come down to <10µA?
Code example:
int main()
{
...
while(1)
{
LowPower_EnterLowPower();
if(wakeup)
{
wakeup = false;
LowPower_ExitLowPower();
// just some dummy alive testing:
HAL_GPIO_TogglePin(DEBUG_PIN_OUT_GPIO_Port, DEBUG_PIN_OUT_Pin);
HAL_Delay(3000);
HAL_GPIO_TogglePin(DEBUG_PIN_OUT_GPIO_Port, DEBUG_PIN_OUT_Pin);
}
}
}
void EXTI_Btn()
{
wakeup = true;
__HAL_GPIO_EXTI_CLEAR_FLAG(GPIO_PIN_7)
}
void LowPower_ExitLowPower()
{
SystemClock_InitConfig();
HAL_ResumeTick();
}
void LowPower_EnterLowPower()
{
__HAL_RCC_GPIOC_CLK_DISABLE();
__HAL_RCC_GPIOB_CLK_DISABLE();
__HAL_RCC_GPIOA_CLK_DISABLE();
__HAL_RCC_GPIOD_CLK_DISABLE();
__HAL_RCC_GPIOH_CLK_DISABLE();
HAL_SuspendTick();
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
}
Used MCU STM32L05, Clock config HSI16 at 4MHz, 32.768kHz LSE for LP; measured with STM32CubeMonitor-Power and X-Nucleo-LPMO1A, verified with Multimeter and R&S Power Supply; (In run mode/wake up: ~1,5mA during button pressed, 1,2mA during HAL_DELAY)
Cube IDE 1.6.1, FW_L0 V1.12.0
2021-04-15 08:27 AM
Additional information:
2021-04-15 08:32 AM
Test on another chip to be sure no non-fatal damage to the chip has happened.
2021-04-16 03:14 AM
Thank you Uwe Bonnes for the tip. Unfortunately other chips behave similar. I tested now with 6, one of them really seem to a defect (doesn't go to sleep mode at all).
2021-04-16 05:13 AM
Hello again,
I have to admit I've done some mistakes. Maybe the summary is helpful for others. But still there must be some improvement regarding the specs:
It's not enough to unplug the Debugger USB cable. All cables (espacially VDD Pin1) must be unplugged, otherwise the debugger drains ~200µA.
For my new test the lowest level I reached 110µA (no Debugger, only supply).
However these 110µA still seemed a bit high for LP. So I really checked that there is no HAL initialization at all, expect the EXTI pin and all other pins as analog inputs. Now it went down to 30µA. Datasheet describes <10µA for LP modes though.
I was hoping that the entry of LP mode would stop some peripherals automatically. But it seems that I have to make a complete Uninit (entering LP) and Init again (leaving LP). Let's see how consumption drops/rises if I use LPTIM or RTC to wake up.
Still some tips, why i don't reach <10µA with the current setting?