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

NRF_ERROR_SDM_LFCLK_SOURCE_UNKNOWN when correctly configured

Hi all,

I'm currently making Mbed OS 5 able to work with the NRF51 with DFU enabled.
It seems Mbed OS 5 currently has no support for a Nordic bootloader for the NRF51. Mbed OS 5 uses softdevice S130 2.0.0 so I've chosen to create a bootloader with SDK11.

Our board doesn't have a LF clock source so my configuration is as follow:

#define NRF_CLOCK_LFCLKSRC      {.source        = NRF_CLOCK_LF_SRC_RC,            \
                                 .rc_ctiv       = 16,                                \
                                 .rc_temp_ctiv  = 1,                                \
                                 .xtal_accuracy = 0}

The problem is as follow:
On bootup the bootloader in SDK11 works fine. It initialises the softdevice without any problem and than starts the application.
In the application we softreset back to the bootloader with the DFUService from Mbed 5 and than the trouble occurs.
In softdevice_handler.c it returns an error in sd_softdevice_enable with err_code NRF_ERROR_SDM_LFCLK_SOURCE_UNKNOWN. 
This code ran previously fine on hardware reset!

I also tried this on a PCA10028 with the following configuration:

#define NRF_CLOCK_LFCLKSRC      {.source        = NRF_CLOCK_LF_SRC_XTAL,            \
                                 .rc_ctiv       = 0,                                \
                                 .rc_temp_ctiv  = 0,                                \
                                 .xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM}

The exact same error occurs.
Also, I've made sure Mbed 5 uses the exact same configuration as the bootloader so no switching between different clock sources is necessary.
We're migrating from Mbed 3 to Mbed 5 and the DFUService looks the same between those platforms.

My question is; in what situations can the function sd_softdevice_enable return NRF_ERROR_SDM_LFCLK_SOURCE_UNKNOWN apart from an incorrect configuration parameter?
My configuration looks fine...

Thanks in advance!

Related