2026-01-05 10:33 PM
Hello,
We are using the RTC wakeup timer and I have noticed that sometimes the WUTIE and WUTE bits are not being set. We are using HAL_RTCEx_SetWakeUpTimer_IT() HAL function to enable the timer. In stepping through the HAL code, it sets the RTC_CR_WUTIE and RTC_CR_WUTE bits but does not check they are actually set, so I assume it is expected to set the bits.
I have read through the reference manual (RM0456) and existing errata. There is no existing errata w.r.t the RTC unit that applies to this situation.
Any insight would be appreciated.
Thanks,
Aidan
2026-01-06 2:28 AM
hello @AidanBrowne
Can you debug your project and add breakpoints at the point when the interrupt occurs?
Sometimes, the bit is cleared immediately after it is set.
You might have reviewed the register bits after they were cleared.
If you check the HAL_RTCEx_SetWakeUpTimer_IT function, you see that the WUTE bit is cleared.
HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer_IT(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock,
uint32_t WakeUpAutoClr)
{
.....
assert_param(WakeUpAutoClr <= WakeUpCounter);
__HAL_LOCK(hrtc);
hrtc->State = HAL_RTC_STATE_BUSY;
/* WUTE bit is getting cleared here */
CLEAR_BIT(RTC->CR, RTC_CR_WUTE);
/* Clear flag Wake-Up */
WRITE_REG(RTC->SCR, RTC_SCR_CWUTF);
.....
and in "HAL_RTCEx_DeactivateWakeUpTimer" for WUTIE bit
CLEAR_BIT(RTC->CR, (RTC_CR_WUTE | RTC_CR_WUTIE));
Hope that helps you
Gyessine
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.