2016-10-06 03:07 AM
Hi,
We are using wakeup pin and RTC alarm sources for wakingup the STM from standby mode in different scenarios. We are facing the problem to identify the wakeup source i.e (wakeup because of pin or RTC alarm).We tried to read the RTC CRL register also to get the alarm flag whenever STM wakesup, but it is not giving the alarm flag set value if it is RTC wakeup.please let us know, how to identify the wakeup source.2016-10-06 06:04 AM
Presumably you programmed in the specific time(s) the alarm(s) fire, can you review that? EXTI?
2016-10-06 10:02 AM
Hi v.ranga,
AS a solution, try the following:Define 2 software flags , one for RTC wakeup case and other for wakeup pin case.In the function that handles RTC Auto wake-up interrupt RTC_WKUP_IRQHandler() dwitch the state of the correspondent defined flag. In the function that handles external line EXTI15_10_IRQHandler(), switch the correspondent flags.Use both flags on your main function to check which wakeup source has wakeup the device.Regards,Walid.