Hello,
We are using a NRF52832 in our product with Buttonless DFU. In a new version of the product we are exchanging the external LF Crystal for a LF Clock source.
As the SoftDevice does not support it natively, we used the following code before the SoftDevice initialization that worked fine:
NRF_CLOCK->LFCLKSRC = (CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos)|(CLOCK_LFCLKSRC_BYPASS_Enabled << CLOCK_LFCLKSRC_BYPASS_Pos ) |
(CLOCK_LFCLKSRC_EXTERNAL_Enabled << CLOCK_LFCLKSRC_EXTERNAL_Pos);
NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;
NRF_CLOCK->TASKS_LFCLKSTART = 1;
while(NRF_CLOCK->EVENTS_LFCLKSTARTED == 0)
{//do nothing
}
Now what is not clear is how to make changes in the DFU to use the External Clock or the internal RC Oscilator. To use the Internal RC oscilator I believe I would have to change the DFU sdk_config and recompile it, is that correct?. However, I was not able to understand when the SoftDevice is initialized inside the DFU code. In the DFU code there is a Weak Function called nrf_dfu_init_user. Is this function called before the SoftDevice is initilized? If I add the same piece of code on that function, will it work?
Thanks a lot