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

BLE app UART with peer manager

Hello,

I am currently working on adding the pairing part to the ble_app_uart with peer manager. I have followed the way that is used for ble_app_gls and ble_app_hrs. I could successfully integrate peer manager to ble_app_uart example code and just initailzed the peer_manager in main.c with all the changes required for pairing, but code is getting stuck and after debugging i found that sd_softdevice_enable i returning  NRF_ERROR_INVALID_PARAM. Clock configuration that i have done is 

NRF_SDH_CLOCK_LF_SRC = 0
NRF_SDH_CLOCK_LF_RC_CTIV = 16 or 4
NRF_SDH_CLOCK_LF_RC_TEMP_CTIV = 2 or 0
NRF_SDH_CLOCK_LF_ACCURACY = 7

I searched the threads for this problem but doing clock configuration and chaning RAM size didn't work for me.

Any help would be appreciated.

Thanks,

Nikhil

Parents
  • I don't know what SDK version you use, but if you recompile the entire project, then you should see a compiler warning saying:

    Please select NRF_CLOCK_LF_ACCURACY_500_PPM when using NRF_CLOCK_LF_SRC_RC

    This is because you don't have a clock with accuracy 20ppm when you use the RC Oscillator. 

    I would suggest to use the following combination if you are going to use the RC Oscillator:

    #define NRF_SDH_CLOCK_LF_SRC 0
    #define NRF_SDH_CLOCK_LF_RC_CTIV 16
    #define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 2
    #define NRF_SDH_CLOCK_LF_ACCURACY 1

    Best regards,

    Edvin

  • Hi Edvin,

    Thank you for you reply.

    I used the same configuration as mentioned in the thread, still it is throwing the error at sd_softdevice_enable function (returning NRF_ERROR_INVALID_PARAM). I am using SDK15.3.0

    Anything that i am missing in clock configuration ?

    Regards,

    Nikhil 

  • Are you sure that you are not changing the CLOCK_CONFIG_LF_SRC instead of the NRF_SDH_CLOCK_LF_SRC?

    Can you send me your sdk_config.h?

  • 0640.sdk_config.h

    Please find the attached sdk_config.h file and let me know if any configuration change is required ?

  • If I copy your clock configurations it works on my side. I see that you have:

    // <o> NRF_SDH_CLOCK_LF_ACCURACY  - External clock accuracy used in the LL to compute timing.
     
    // <0=> NRF_CLOCK_LF_ACCURACY_250_PPM 
    // <1=> NRF_CLOCK_LF_ACCURACY_500_PPM 
    // <2=> NRF_CLOCK_LF_ACCURACY_150_PPM 
    // <3=> NRF_CLOCK_LF_ACCURACY_100_PPM 
    // <4=> NRF_CLOCK_LF_ACCURACY_75_PPM 
    // <5=> NRF_CLOCK_LF_ACCURACY_50_PPM 
    // <6=> NRF_CLOCK_LF_ACCURACY_30_PPM 
    // <7=> NRF_CLOCK_LF_ACCURACY_20_PPM 
    // <8=> NRF_CLOCK_LF_ACCURACY_10_PPM 
    // <9=> NRF_CLOCK_LF_ACCURACY_5_PPM 
    // <10=> NRF_CLOCK_LF_ACCURACY_2_PPM 
    // <11=> NRF_CLOCK_LF_ACCURACY_1_PPM 
    
    #ifndef NRF_SDH_CLOCK_LF_ACCURACY
    #define NRF_SDH_CLOCK_LF_ACCURACY NRF_CLOCK_LF_ACCURACY_500_PPM
    #endif

    NRF_CLOCK_LF_ACCURACY_500_PPM is usually defined in nrf_sdm.h. Have you changed it there? (Line 209), or is it still 1?

    If it is in fact 1, then there is something different. I believe you need to roll back and try to go step by step forward to see what change that made this return NRF_ERROR_INVALID_PARAM.

    Best regards,

    Edvin

Reply
  • If I copy your clock configurations it works on my side. I see that you have:

    // <o> NRF_SDH_CLOCK_LF_ACCURACY  - External clock accuracy used in the LL to compute timing.
     
    // <0=> NRF_CLOCK_LF_ACCURACY_250_PPM 
    // <1=> NRF_CLOCK_LF_ACCURACY_500_PPM 
    // <2=> NRF_CLOCK_LF_ACCURACY_150_PPM 
    // <3=> NRF_CLOCK_LF_ACCURACY_100_PPM 
    // <4=> NRF_CLOCK_LF_ACCURACY_75_PPM 
    // <5=> NRF_CLOCK_LF_ACCURACY_50_PPM 
    // <6=> NRF_CLOCK_LF_ACCURACY_30_PPM 
    // <7=> NRF_CLOCK_LF_ACCURACY_20_PPM 
    // <8=> NRF_CLOCK_LF_ACCURACY_10_PPM 
    // <9=> NRF_CLOCK_LF_ACCURACY_5_PPM 
    // <10=> NRF_CLOCK_LF_ACCURACY_2_PPM 
    // <11=> NRF_CLOCK_LF_ACCURACY_1_PPM 
    
    #ifndef NRF_SDH_CLOCK_LF_ACCURACY
    #define NRF_SDH_CLOCK_LF_ACCURACY NRF_CLOCK_LF_ACCURACY_500_PPM
    #endif

    NRF_CLOCK_LF_ACCURACY_500_PPM is usually defined in nrf_sdm.h. Have you changed it there? (Line 209), or is it still 1?

    If it is in fact 1, then there is something different. I believe you need to roll back and try to go step by step forward to see what change that made this return NRF_ERROR_INVALID_PARAM.

    Best regards,

    Edvin

Children
Related