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

SDK14 ble_periphal example dont work

Hi, i downloaded new SDK14 with example, after i upload hex from example in ble_peripheral/ble_app_hrs I use s132 / nrf52

program stuck here :

ret_code_t nrf_sdh_enable_request(void)
{
    ret_code_t ret_code;

    if (m_nrf_sdh_enabled)
    {
        return NRF_ERROR_INVALID_STATE;
    }

    m_nrf_sdh_continue = true;

    // Notify observers about SoftDevice enable request.
    if (sdh_request_observer_notify(NRF_SDH_EVT_ENABLE_REQUEST) == NRF_ERROR_BUSY)
    {
        // Enable process was stopped.
        return NRF_SUCCESS;
    }

    // Notify observers about starting SoftDevice enable process.
    sdh_state_observer_notify(NRF_SDH_EVT_STATE_ENABLE_PREPARE);

    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,
    #ifdef S132
        .accuracy      = NRF_SDH_CLOCK_LF_XTAL_ACCURACY
    #else
        .xtal_accuracy = NRF_SDH_CLOCK_LF_XTAL_ACCURACY
    #endif
    };

    #ifdef ANT_LICENSE_KEY
        ret_code = sd_softdevice_enable(&clock_lf_cfg, app_error_fault_handler, ANT_LICENSE_KEY);
    #else
        ret_code = sd_softdevice_enable(&clock_lf_cfg, app_error_fault_handler);
    #endif

    if (ret_code != NRF_SUCCESS)
    {
        return ret_code;
    }

on ret_code = sd_softdevice_enable(&clock_lf_cfg, app_error_fault_handler);

same problem is, if i recomplile whole project a load new one.

could someone help me, where is the problem ? regards

Parents
  • I had the same issue, my custom board has no LF clock at all (no solder jumper that can enable it)

    For me the solution was to set "#define NRF_SDH_CLOCK_LF_RC_CTIV 4" which was 0 before.

    My clock configuration is now:

    // <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 4
    #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 0
    #endif
    
    // <o> NRF_SDH_CLOCK_LF_XTAL_ACCURACY  - External crystal clock accuracy used in the LL to compute timing windows.
     
    // <0=> NRF_CLOCK_LF_XTAL_ACCURACY_250_PPM 
    // <1=> NRF_CLOCK_LF_XTAL_ACCURACY_500_PPM 
    // <2=> NRF_CLOCK_LF_XTAL_ACCURACY_150_PPM 
    // <3=> NRF_CLOCK_LF_XTAL_ACCURACY_100_PPM 
    // <4=> NRF_CLOCK_LF_XTAL_ACCURACY_75_PPM 
    // <5=> NRF_CLOCK_LF_XTAL_ACCURACY_50_PPM 
    // <6=> NRF_CLOCK_LF_XTAL_ACCURACY_30_PPM 
    // <7=> NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM 
    
    #ifndef NRF_SDH_CLOCK_LF_XTAL_ACCURACY
    #define NRF_SDH_CLOCK_LF_XTAL_ACCURACY 7
    #endif
    
  • Awesome, thank you! (I was using a chinese module which theorically has 32MHz crystal and 32Khz LF crystal)

Reply Children
No Data
Related