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

Custom NRF52840 Board Softdevice Clock Configuration

Hello, 

I am having problems with a custom NRF52840 Board. My program hands at the ble_stack_init function.

I have encoutered this problem in the past so I have tried the different solutions that worked previously. My board uses both a HF and LF.

    NRF_CLOCK->TASKS_HFCLKSTART = 1;
    while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0);

    NRF_CLOCK->TASKS_LFCLKSTART = 1;
    while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0);

I have inserted this functions at the beginning of my main function, and I am able to pass these 2 tests. This should mean that both the HF and LF were successfully initialized.

But my program hangs at ble_stack_init when I set NRF_SDH_CLOCK_LF_SRC to NRF_CLOCK_LF_SRC_XTAL. I have also set the correct accuracy (20 ppm)

It works when I set it to NRF_CLOCK_LF_SRC_SYNTH, But I know this is inefficient. 

What could be the problem with the clock setup?

Related