nRF5 SDK is not maintained anymore
More Info: Consider nRF Connect SDK for new designs

MDBT42Q BLE not advertising when using simple SDK ble examples

Hi everyone, and thanks for all the help provided on this site !

I have tried to flash a MDBT42Q using the nrf82832-DK (PCA10040) and it works fine for simple peripheral examples (like GPIOs, entering sleep modes...).

But when I try to upload ble-peripheral examples such as ble-blinky or ble-app-uart the upload goes fine, but the device doesn't seem to advertise any data.
I have tried to change the NRF_SDH_CLOCK_LF_SRC parameter to 0 and the NRF_SDH_CLOCK_LF_ACCURACY  parameter to 1 as described in this topic, but with no success.

Has anyone managed to make the MDBT42Q work with the ble_app_uart example ?

FYI : I am using Segger Embedded Studio v6.30 and the nrf SDK v17.1.0.

Thanks a lot for your help !

Parents
  • Hi Vidar,

    Thank you very much for your precise and prompt reply !
    I have switched back to Segger V 5.70 that I used previously and commented out the line you suggested, but still with no luck.

    I went a bit further though : when debugging, I get the error "app: ERROR 7 [NRF_ERROR_INVALID_PARAM]" when calling nrf_sdh_enable_request().
    According to this topic it might be related to the fact that I changed the NRF_SDH_CLOCK_LF_SRC to 0 ("RC") but I should also have changed the values of NRF_SDH_CLOCK_LF_RC_TEMP_CTIV and NRF_SDH_CLOCK_LF_RC_CTIV. 
    The problem is that I don't know to what values I should put those. Any idea ?

    I will look further and upload any findings in here.

    Thanks again for your support !

Reply
  • Hi Vidar,

    Thank you very much for your precise and prompt reply !
    I have switched back to Segger V 5.70 that I used previously and commented out the line you suggested, but still with no luck.

    I went a bit further though : when debugging, I get the error "app: ERROR 7 [NRF_ERROR_INVALID_PARAM]" when calling nrf_sdh_enable_request().
    According to this topic it might be related to the fact that I changed the NRF_SDH_CLOCK_LF_SRC to 0 ("RC") but I should also have changed the values of NRF_SDH_CLOCK_LF_RC_TEMP_CTIV and NRF_SDH_CLOCK_LF_RC_CTIV. 
    The problem is that I don't know to what values I should put those. Any idea ?

    I will look further and upload any findings in here.

    Thanks again for your support !

Children
  • Hi,

    Thanks for the update. Yes, that makes sense, you have to specify a calibration interval when and also declare the correct accuracy when using the internal RC oscillator as the 32Khz clock source.

    These are the configs we typically recommend for this clock source:

    // </h> 
    //==========================================================
    
    // <h> Clock - SoftDevice clock configuration
    
    //==========================================================
    // <o> NRF_SDH_CLOCK_LF_SRC  - SoftDevice clock source.
     
    // <0=> NRF_CLOCK_LF_SRC_RC 
    // <1=> NRF_CLOCK_LF_SRC_XTAL 
    // <2=> NRF_CLOCK_LF_SRC_SYNTH 
    
    #ifndef NRF_SDH_CLOCK_LF_SRC
    #define NRF_SDH_CLOCK_LF_SRC 0
    #endif
    
    // <o> NRF_SDH_CLOCK_LF_RC_CTIV - SoftDevice calibration timer interval. 
    #ifndef NRF_SDH_CLOCK_LF_RC_CTIV
    #define NRF_SDH_CLOCK_LF_RC_CTIV 16
    #endif
    
    // <o> NRF_SDH_CLOCK_LF_RC_TEMP_CTIV - SoftDevice calibration timer interval under constant temperature. 
    // <i> How often (in number of calibration intervals) the RC oscillator shall be calibrated
    // <i>  if the temperature has not changed.
    
    #ifndef NRF_SDH_CLOCK_LF_RC_TEMP_CTIV
    #define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 2
    #endif
    
    // <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 1
    #endif
    

  • Ok, new update,

    I found this topic which indicated the following values for the parameters :

    NRF_SDH_CLOCK_LF_RC_CTIV=16 and NRF_SDH_CLOCK_LF_RC_TEMP_CTIV=2

    I changed it like this in the sdk_config.h file, and it worked !

    So to sum up the changes I had to make for it work :

    1. Use Segger version 6.20 or older
    2. Comment out the line APP_ERROR_HANDLER(p_event->data.error_communication);
    3. Change NRF_SDH_CLOCK_LF_SRC to 0 and NRF_SDH_CLOCK_LF_ACCURACY to 1 to activate the internal oscillator
    4. Change NRF_SDH_CLOCK_LF_RC_CTIV=16 and NRF_SDH_CLOCK_LF_RC_TEMP_CTIV=2
Related