From 531261497403b0932e524ea3ffb0ce56e071ba97 Mon Sep 17 00:00:00 2001 From: Yuuki NAGAO Date: Sun, 21 Sep 2025 16:07:17 +0900 Subject: [PATCH] stm32/rtc: Fix RTC.wakeup issue for STM32G0. To clear wakeup interrupt flag, set CWUTF on RTC_SCR instead of RTC_MISR. Signed-off-by: Yuuki NAGAO --- ports/stm32/stm32_it.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/stm32/stm32_it.c b/ports/stm32/stm32_it.c index 9eda3cb239..052550a8fa 100644 --- a/ports/stm32/stm32_it.c +++ b/ports/stm32/stm32_it.c @@ -541,7 +541,7 @@ void RTC_IRQHandler(void) { #if defined(STM32G0) void RTC_TAMP_IRQHandler(void) { IRQ_ENTER(RTC_TAMP_IRQn); - RTC->MISR &= ~RTC_MISR_WUTMF; // clear wakeup interrupt flag + RTC->SCR |= RTC_SCR_CWUTF; // clear wakeup interrupt flag Handle_EXTI_Irq(EXTI_RTC_WAKEUP); // clear EXTI flag and execute optional callback Handle_EXTI_Irq(EXTI_RTC_TIMESTAMP); // clear EXTI flag and execute optional callback IRQ_EXIT(RTC_TAMP_IRQn);