Skip to main content
DOCon.1
Senior
September 26, 2020
Solved

How do you wake up using RTC wakeup?

  • September 26, 2020
  • 1 reply
  • 1095 views

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!

This topic has been closed for replies.
Best answer by DOCon.1

Solved: Need to set WUTIE in rtc CR register.

1 reply

DOCon.1
DOCon.1AuthorBest answer
Senior
September 26, 2020

Solved: Need to set WUTIE in rtc CR register.