This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Switching between RC and XTAL for HF clock

I need to measure periods with high precision, so I need to make sure that the HF clock is using the external XTAL; when the softdevice is not started (for testing mode) I can use the nrfx_clock_hfclk_start() function or nrf_clock_task_trigger(NRF_CLOCK_TASK_HFCLKSTART) and the corresponding calls to return to the low power internal RC; when he softdevice is running, using these functions causes the program to crash.
I can start the XTAL before starting the softdevice and it will stay on, but I would like to return to the RC for lower power consumption. Is it possible to switch between the RC and the XTAL when the softdevice is running?

Related