I'm trying to understand how to wake up the MCU from the hibernation state using a GPIO.
Right now I can program a wake up using RTC:
Power_shutdown(0, shutdownTime);
it works very well. After the shutdownTime it wakes up and PRCMSysResetCauseGet() tells me it's exiting from hibernation (PRCM_HIB_EXIT).
Now I connected a pin (GPIO13) from a MEMS sensor. Usually it is in low-lovel state but when something happens it will go to the high level. Reading the document SWRU465 at page 505, I add the following:
PRCMHibernateWakeupSourceEnable(PRCM_HIB_GPIO13); PRCMHibernateWakeUpGPIOSelect(PRCM_LPDS_GPIO13, PRCM_HIB_RISE_EDGE);
Now when I call the Power_shutdown function as above it immediately exits from the hibernation, regardless the GPIO pin state (that is still low). PRCMSysResetCauseGet() says again PRCM_HIB_EXIT, but PRCMHibernateWakeupCauseGet() returns 0.
Where is my error?