How do you wake up using RTC wakeup?
Status from reads: WUTE is enabled, WUT shows what I set, RTC is enabled, and the WUTF flag is correctly being set every so often (and manually being cleared during GPIO interrupts I'm troubleshooting with).
What's not happening: The EXTI interrupt is not being fired; the device is not waking up from sleep. It can be woken up from an EXTI fired from GPIO. This is hopefully enough to narrow it down: The RTC wakeup timer itself is working, but it's not triggering the interrupt. What needs to be accomplished to fix this? It should trigger the interrupt once WUTF gets set.
WUT setup steps:
- Enable the RTC and setup/enable LSE
- Disable write protection
- clear WUTE
- wait until WUWTF is set
- set timeout in WUT and WCKSEL
- Set WUTE
- Enable write protection
Interrupt setup steps. Note that this works for GPIO interrupts:
- Unmask imr1's mr20 field (20 should be RTC wakeup)
- Enable rtsr's tr20, and disable ftsr's tr20 (Set rising trigger)
- unmask the NVIC RTC wakeup IRQ channel
- Setup an EXTI interrupt handler function
Thank you!
