Standby Mode Wakeup
I am creating a project in which I am using Standby mode as the low power mode of choice. I am using Cube IDE for development. These are the wakeup pins/procedures that I would like to implement:
- SYS_WKUP1 (PA0)
- SYS_WKUP2 (PC13)
- HAL_RTC WakeUpTimer Interrupt
- RTC Internal Alarm A
- RTC Internal Alarm B
My questions are:
1. Is there a way to distinguish between all the wakeups given above ( Callback functions that could execute at the moment of wakeup or flag status checks) since the wakeup from standby mode is like a complete reset and executes from main() ?
2. I am currently checking the flags
__HAL_PWR_GET_FLAG(PWR_FLAG_SB) - for checking if its a power on scenario or wakeup from standby, and __HAL_PWR_GET_FLAG(PWR_FLAG_WU) - for checking if its a wakeup event
But I am not able to distinguish between the above 5 wakeup cases. I am using the callback function HAL_RTCEx_WakeUpTimerEventCallback to check if its an internal wakeup from rtc. But its not entering the callback function.
Looking forward for suggestions and information.
Thank you,
Justin
