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

clock_lf_cfg configuration in SDK15

Hi!

I have strange behavior.

nRF52, SD132 6.0, SDK15

I use RC clock src. 

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
};

When NRF_SDH_CLOCK_LF_RC_CTIV = 16 and NRF_SDH_CLOCK_LF_RC_TEMP_CTIV = 2

project under debug doesn't start first time after start. After call 

ret_code = sd_softdevice_enable(&clock_lf_cfg, app_error_fault_handler); 

function, there is no any answear. If project in a Keil restart, project starts normal. Also if just supply power, project always starts normal many times. But under Keil, first start always fail. 

But if change to 

NRF_SDH_CLOCK_LF_RC_CTIV = 0 and NRF_SDH_CLOCK_LF_RC_TEMP_CTIV = 0

project always starts normal.

???

why?

Parents
  • Hi Mikhail,

     can you post the section of sdk_config.h that sets the NRF_SDH_CLOCK_XXX definitions?  The CTIV and TEMP_CTIV values are correct as far as I can tell. Are you saying that the nRF52 runs the code correctly when you're not debugging, but hangs when you run it in a debug session?

    Is this a NRF52 DK or a custom board?

    Best regards

    Bjørn

  • Thanks for answer. Sorry for long delay.

    This behavior on a custom board.

    Now I use:


    };

        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
        };
        
        
        
    
    // </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
    
    // </h> 

    And seems it works. But it worked since I added back some queue file in the project.

    Very strange.

  • Ok, so you're now able to run the code in a debug session without the code halting?

  • Hi Mikhail,

    I got the same problem.

    I also setted to RC,16,2,500 PPM And it works OK regularly but halts in debug mode

    What do you meen by "queue file" ?!

    B,r 

    Yuval

Reply Children
No Data
Related