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

nrf_sdh_enable_request() returns 7 Invalid Parameter

Hi,

      Just spent a while debugging this and since there seems to be nothing - well I can't find it anyway - up here thought I should document this issue. This relates to SDK 15.0.0 and softdevice S140.

nrf_sdh_enable_request, while it doesn't take a parameter calls sd_softdevice_enable with the parameters within sdk_config.h:

nrf_clock_lf_cfg_t const clock_lf_cfg =
{
   .source = NRF_SDH_CLOCK_LF_SRC,
   .rc_ctiv = NRF_SDH_CLOCK_LF_RC_CTIV,
   .rc_temp_ctiv = NRF_SDH_CLOCK_LF_RC_TEMP_CTIV,
   .accuracy = NRF_SDH_CLOCK_LF_ACCURACY
};

The softdevice clock is configured by default in sdk_config.h. To find the right place do a search for the string "XTAL". There are four settings as you can see above. 

The source can be RC (0), XTAL(1) or Synth(2). RC uses an oscillator internal to the nrf52 chip. It is the least accurate approach.

XTAL refers to an external crystal across some pins on the chip. On the DK boards this is included. On many custom boards it isn't. If you don't have a crystal and choose this option, then you will fail when enabling the softdevice.

Synth slaves the low frequency clock off the High frequency clock. There are various warnings about using lots of power when choosing this option. The problem I had was that you need to change RC_CTIV and RC_TEMP_CTIV when choosing other than RC. The best information I have found is in nrf_sdm.h which says among other things to set these two to 0 when using sources other than RC. If you don't you will get the error 7 Invalid Parameter.

HTH 

Paul

Parents Reply Children
No Data
Related