Hello -
We are developing an application for nRF52840, using the v17.0.0 SDK. The application is running on FreeRTOS. We need to power off all the RAM and use the RTC to wakeup after a specified time. To do that I borrowed the SDK tickless idle code. Here is the part that configures the RTC and waits for the wakeup:
nrf_rtc_cc_set(portNRF_RTC_REG, 0, wakeupTime);
nrf_rtc_event_clear(portNRF_RTC_REG, NRF_RTC_EVENT_COMPARE_0);
nrf_rtc_int_enable(portNRF_RTC_REG, NRF_RTC_INT_COMPARE0_MASK);
__DSB();
do {
__WFE();
} while (0 == (NVIC->ISPR[0] | NVIC->ISPR[1]));
The code works fine. My question is whether or not the code only wakes up on the RTC event, or can other/external sources trigger the wakeup condition? If other sources can trigger the wakeup, how can the do/while loop be modified to only exit when the RTC event triggers?
Also, when the SoftDevice is enabled, we replace the loop above with a call to sd_app_evt_wait(). Similar question: does the call to sd_app_evt_wait() need to be bracketed with other tests to ensure that the RTC is the wakeup source?
Regards,
Brian