cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103ZG wake-up source identification from standby mode.

rangaswamy
Associate
Posted on October 06, 2016 at 12:07

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.
2 REPLIES 2
Posted on October 06, 2016 at 15:04

Presumably you programmed in the specific time(s) the alarm(s) fire, can you review that? EXTI?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Walid FTITI_O
Senior II
Posted on October 06, 2016 at 19:02

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.