cancel
Showing results for 
Search instead for 
Did you mean: 

Exact wakeup reason from standy mode (STM32F429): RTC vs WKUP pin

Peeters.Bram
Senior

Hi,

I am looking for a way to determine what caused a wakeup from standby mode, in my case the options are RTC or the WKUP pin (and if you have multiple, which pin).

In my case I only have one WKUP pin, so I could check the RTC and conclude if it was not the RTC then is must have been the one pin, but in borderline cases the RTC might expire after the pin wokeup the CPU but before I check the RTC which will lead to the wrong result. So a more direct way would be nice ....

( Duplicate of https://stackoverflow.com/questions/42509500/reason-of-wakeup-from-standby-mode-in-stm32f4 which does not have an answer at the time of writing)

3 REPLIES 3

I think you need to validate the RTC as the source, and check the time, and contrast against the alarms, etc which you selected. You might also be able to flag in the EXTI. For pins check the GPIO state. Perhaps if a button you need a latching source.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Couldn't RTC timestamp be used instead of WKUP pin?

JW

Peeters.Bram
Senior

The problem with checking the RTC is that it does not allowed to know that the line toggled (first) if the RTC expires just after it. It also does now allow to detect which wakeup pin triggered in on cpu's with multiple wakeup pins. I do not think the EXTI flags will be set after starting up from deep sleep (because it is almost the same as a reset) but i need to check to make sure. The 'check the state of the GPIO pin as soon as possible after coming out of deep sleep' is what i was trying now and it seems to work for me since in my case it is a physical button press i am trying to detect. So that usually takes a while (longer than the time it takes for the cpu to boot/ get to the point where i can read the pin). For other cases with shorter pulses it will not work though, so it is still a limited solution.