Relation between clock and softdevice

I'am currently porting code from NRF51822 to NRF52805. In my old code I used the following line to initialize softdevice:

```
SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, NULL);

```

I'm not sure if parameter `NRF_CLOCK_LFCLKSRC_XTAL_20_PPM` is correctly set, but it worked. The project was build against Nordic SDK 9.0.0.

---

On my new chip I am using Nordic SDK 17.1.0 with current patches. Here two functions for initialising softdevice exists: `nrf_sdh_enable_request` and `sd_softdevice_enable`.  

If I am using `nrf_sdh_enable_request` everything works fine. However startup time is relative high which isn't a big problem.

However I tested function `sd_softdevice_enable` where clock parameter must be entered. So I manually started high frequency clock (`while(NRF_CLOCK->EVENTS_HFCLKSTARTED == 0)`) and started softdevice with following code:

```
nrf_clock_lf_cfg_t Config;
    
memset(&Config, 0, sizeof(Config));
Config.accuracy = NRF_CLOCK_LF_ACCURACY_20_PPM;
Config.source = NRF_CLOCK_LF_SRC_SYNTH;                 
return sd_softdevice_enable(&Config, gErrorHandler);    // Old code: SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, NULL);
```

After that softdevice starts very fast. However my flash write function didn't work any more and hangs. I am using `nrf_fstorage.h` and `nrf_storage_sd.h`.

So what happend if some wrong parameter are given to `sd_softdevice_enable`?
Why are there two functions for enabling softdevice?
Does `sd_softdevice_enable` also starts a clock?

Related