i am testing the low power mode in my bl072z lora board, i call the low power mode function and when i wake up from this state (after a timer set to 20 seconds) the led blinks, everything ok, but if i print a message using PRINTF instead the blink led to know if the board wakes up i never enter in low power mode and just see the PRINTF message in the terminal, why i can't use PRINTF with the low power function?
//does not works
while(1)
{
LPM_EnterLowPower( );
PRINTF("woke up\n\r");
}
//works
while(1)
{
LPM_EnterLowPower( );
BSP_LED_Toggle(LED_GREEN);
}
//works
while(1)
{
LPM_EnterLowPower( );
PRINTF("woke up\n\r");
HAL_Delay(500); //works with this delay but i don't know why
}
//low power function:
void LPM_EnterLowPower(void)
{
HAL_PWR_EnterSTOPMode ( PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI );
}
i use the "woke up" message to know if i exit from sleep mode, i call the low power function and after 20 seconds i expect to see "woke up" just once in the terminal and then go to sleep again and repeat the process, everything works fine with the led but does not works printing a message,in the terminal i only see (indefinitely):
woke up
woke up
woke up
woke up