Hello, Guys!
As I know, the Bootloader uses RTC2.
The problem is that RTC2 continues to operate after executing the bootloader, in my Application.
My Application not uses RTC2, and there is no any handler for RTC2_IRQn. When RTC2_IRQn happens the program freezes at Dummy_Handler.
After reset by Watchdog the RTC2 registers are cleared and the program runs well.
I solved my problem by executing this code at startup of my Application.
uint32_t mask = NRF_RTC_INT_TICK_MASK |
NRF_RTC_INT_OVERFLOW_MASK |
NRF_RTC_INT_COMPARE0_MASK |
NRF_RTC_INT_COMPARE1_MASK |
NRF_RTC_INT_COMPARE2_MASK |
NRF_RTC_INT_COMPARE3_MASK;
NRFX_IRQ_DISABLE(RTC2_IRQn);
nrf_rtc_task_trigger(NRF_RTC2, NRF_RTC_TASK_STOP);
nrf_rtc_event_disable(NRF_RTC2, mask);
nrf_rtc_int_disable(NRF_RTC2, mask);
I think my solution is not very good. Counting RTC2 in my Application is the consequence of executing bootloader.
Are you familiar with this problem? What would be a good solution?
I use SDK 16.0.0