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

Changes needed to start developing Laird BL652 the old way (NRF+Keil)

Hello fellows,

I did my master's thesis with the nrf51 and now some years later I need some help setting up a Laird BL652 to work with my beloved NRF+Keil tools.

Here's what I did and what's working so far:

nrf52840 DK Preview connected to a Laid BL652 via SWD.

Erased all with nRFgo Studio.

Able to flash SD132 and e.g. ble_app_uart example. (The one out of the PCA10040 folder using Keil5) ( nRF5_SDK_14.2.0_17b948a\examples\ble_peripheral\ble_app_uart\pca10040\s132\arm5_no_packs )

I found this document: https://assets.lairdtech.com/home/brandworld/files/Getting%20Started%20with%20DVK-BL652%20and%20Nordic%20SDK%20Development%20using%20Eclipse%20and%20GCC.pdf and changed the pca10040.h

.source= NRF_CLOCK_LF_SRC_XTAL,\
.rc_ctiv= 0,\
.rc_temp_ctiv = 0,\

 lines to
.sourcev= NRF_CLOCK_LF_SRC_RC,\
.rc_ctiv= 16,\
.rc_temp_ctiv = 2,
But it just won't run/start. I can't find it scanning with my mobile using nRF Connect. What/Where else do I need to change stuff or shall I look into?
  • nRF5_SDK\components\softdevice\common\nrf_sdh.c

    I'm routinely using BL652 in my projects ant all I've always needed was chip erase from nRF Go studio. Are you sure that modifying the SDK is necessary?

  • Hi Keton,

    the better way to change the values of clock source is to change only the sdk_config.h in the respective example. this file is located in the respective config directory (i.e. nRF5_SDK_15.0.0_a53641a\examples\ble_peripheral\my_ble_app_blinky\pca10040\s132\config).

    Change the SoftDevice clock configuration to the values specified in the LAIRD documentation like this:

    // </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 7
    #endif
    
    // </h> 
    

    The relevant lines are:
    #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 7
    So, you do not need to change the SDK.
Related