I'm having some trouble getting interrupt from RTC1. I'm initialising as follows.
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Enable LF clock
NRF_CLOCK->LFCLKSRC = (CLOCK_LFCLKSRC_SRC_RC << CLOCK_LFCLKSRC_SRC_Pos);
NRF_CLOCK->CTIV = CLOCK_CTIV_CTIV_Msk;
NRF_CLOCK->TASKS_LFCLKSTART = 1U;
// Do some other stuff...
// Wait for LF clock to be running
while ((NRF_CLOCK->LFCLKSTAT & CLOCK_LFCLKSTAT_STATE_Msk) !=
(CLOCK_LFCLKSTAT_STATE_Running << CLOCK_LFCLKSTAT_STATE_Pos)) {
continue;
}
// Clear all interrupts and events
NRF_RTC1->INTENCLR =
(RTC_INTENCLR_TICK_Clear << RTC_INTENCLR_TICK_Pos) |
(RTC_INTENCLR_OVRFLW_Clear << RTC_INTENCLR_OVRFLW_Pos) |
(RTC_INTENCLR_COMPARE0_Clear << RTC_INTENCLR_COMPARE0_Pos) |
(RTC_INTENCLR_COMPARE1_Clear << RTC_INTENCLR_COMPARE1_Pos) |
(RTC_INTENCLR_COMPARE2_Clear << RTC_INTENCLR_COMPARE2_Pos) |
(RTC_INTENCLR_COMPARE3_Clear << RTC_INTENCLR_COMPARE3_Pos);
I have an interrupt function as follows.
Fullscreen
1
2
3
void RTC1_IRQHandler(void) {
BREAKPOINT;
}
I'm using the gcc_startup-script. We're not using the SDK. I'm not getting any errors from SoftDevice and everything seems to behave nicely.
However, I'm not getting any interrupts. I've tried checking if RTC1's counter is incrementing, but something seems to be afoul with my debugger as it reads all registers as default values (although breakpoints and reading variables works). Am I missing some step here?
Edit SoftDevice S132 v3.0.0
Ok - I was missing NVIC_EnableIRQ(RTC1_IRQn). Which reformulates my question to what is the difference between NVIC_EnableIRQ and INTENSET register?