MCU doesnt wake up from standby with WKUP1 pin
Hello,
I am using STM32L073V8T .
I am trying wake up from standby with WKUP1 pin. It is PA0. According to techinical documents, low to high transition should wake MCU from standby. But, It doesnt work in my case.
Is there any special configuration what I missed ? Maybe a flag wich I shoud clean before standby ? Or GPIO configuration ?
My sleep function :
void wakeupWithPin(void)
{
// __HAL_PWR_WakeUpPinCmd(ENABLE);
dbg_printf("wakeup source is WKUP1 pin\n\r");
HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN1);
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN1);
}
void pwr_lowPowermode(void)
{
// RTC_AlarmConfig();
// wakeupWithRTC();
wakeupWithPin();
dbg_printf("standby\n\r");
HAL_PWR_EnterSTANDBYMode();
}
Related GPIO configuration:
GPIO_InitStruct.Pin = WakeUp_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(WakeUp_GPIO_PORT, &GPIO_InitStruct);