This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

BLE communication causes RTC1 to stop

Hello everybody,

I am using RTC1 for time measurement, this works fine as long as no BLE communication is running.

The RTC is initialized with

const nrf_drv_rtc_t rtc = NRF_DRV_RTC_INSTANCE(1); // Declaring an instance of nrf_drv_rtc for RTC1

nrf_drv_rtc_tick_enable(&rtc, false);

nrf_drv_rtc_enable(&rtc);

I call then repeatedly

app_timer_cnt_get(&ticks);

And print out the value to the UART which is connected to a putty console.

As said, the measurement works fine, as long as no BLE communication is running. If I communicate via BLE the RTC seems to stop after some time and the call

app_timer_cnt_get(&ticks);

always writes 0 to the tick variable.

Does anybody have an idea what's going on here?

Thanks in advance

Matthias

  • Question is how did you get nrf_drv_rtc and app_timer to work in the same project, they are conflicting. Some modules like ble_conn_params uses app_timer to update the connection variables some time after the a bluetooth connection is established. Some app_timer call may stop the rtc from running. You should either just use nrf_drv_rtc or just use app_timer. I will suggest to use app_timer, as this is used heavily in the BLE examples.

  • That helped and was actually the problem. I was mixing nrf_drv_rtc and app_timer, which is wrong in this case.

Related