Problems with PWR_MODE STOP and the wake up with Timer LPTIM1
The LPTIM1 interrupt is running. But if I use the EnterStopMode function, the controller is not gone at the stop mode (LED1 come directly). If I use the EnterStopMode function the second time, the controller goes into the STOP mode and after few seconds the interupt wake up the controller (LED2 is delayed few seconds). Do I forget flags reset at first?
if (HAL_LPTIM_Counter_Start_IT(&hlptim1, 20000) != HAL_OK)
{
Error_Handler();
}
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
/* ### - 4 - Enter in Stop mode ########################################### */
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
LED1_ON;
//HAL_Delay(10);
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
LED2_ON;
//HAL_Delay(10);
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
LED3_ON;
