RTC alarm interrupt

Hello!

I am having difficulty on enabling RTC alarm interrupt.

My code looks something like this:

void rtc_init() {
    // 32kHz crystal started in Sleep_Mode_Configure()
    Sys_RTC_Config(RTC_CNT_START_4294967295, RTC_RESET | RTC_ALARM_2S | RTC_ENABLE | RTC_CLK_SRC_XTAL32K);

    NVIC_ClearPendingIRQ(RTC_ALARM_IRQn);
    NVIC_ClearPendingIRQ(RTC_CLOCK_IRQn);
    NVIC_EnableIRQ(RTC_ALARM_IRQn);
    NVIC_EnableIRQ(RTC_CLOCK_IRQn);
}

void RTC_ALARM_IRQHandler() {
    // Never hit
    __NOP();
}

void RTC_CLOCK_IRQHandler() {
    // Hit every 1s
    __NOP();
}

I have placed breakpoints in both interrupts, and I reliably hit the RTC_CLOCK_IRQ once every second, however RTC_ALARM_IRQ is never hit.

What might be the problem?

Hi,

There is a solution, the wake-up control register with the alarm bit must be cleared for the alarm interrupt to occur:
ACS_WAKEUP_CTRL->RTC_ALARM_WAKEUP_CLEAR_ALIAS=WAKEUP_RTC_ALARM_CLEAR_BITBAND;

Follow the post:

5 Likes

Is this behavior documented somewhere?

By the way, I could not find the errata sheet for RSL10 chip. Where can I download it?

There is none at this day:

3 Likes

Thank you for the helpful tips. Have a great day!

1 Like