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

How to detect the external low-frequency vibration crystal work?When it doesn't work how to switch frequency crystals?

52832,SDK12.0.0

I met such a situation: In the use of JLink burning program or air upgrade, after the completion of the program card died in initialization low-frequency crystals.

"sd_softdevice_enable(p_clock_lf_cfg, softdevice_fault_handler);"

Parents
  • You need to modify the NRF_CLOCK_LFCLKSRC in the pca10040.h or custom_board.h to the following

    #define NRF_CLOCK_LFCLKSRC      {.source        = NRF_CLOCK_LF_SRC_RC,            \
    
                                     .rc_ctiv       = 16,                             \
    
                                     .rc_temp_ctiv  = 2,                              \
    
                                     .xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_250_PPM }
    
  • yes.I read 0x00010000 from the LFCLKSTAT register. I use projects: SDK12.0.0 ; examples\ble_peripheral\ble_app_hrs_freertos The following code:

    int main(void)
    {
        ret_code_t err_code;
        uint32_t lfclk_state = 1;
        
        while(lfclk_state)
        {
            lfclk_state = NRF_CLOCK->LFCLKSTAT; //lfclk_state =0x00010000
        }
        
        err_code = nrf_drv_clock_init();
        APP_ERROR_CHECK(err_code);
    ....
    }
    

    After the exception occurs, I put the low-frequency clock configuration set to use internal frequency clock, the program can run, but related to low frequency clock driver is invalid, such as app_timer, WDT, etc

    After this exception occurs,Cut off the chip power supply, and then to electricity to make the program run normally

Reply
  • yes.I read 0x00010000 from the LFCLKSTAT register. I use projects: SDK12.0.0 ; examples\ble_peripheral\ble_app_hrs_freertos The following code:

    int main(void)
    {
        ret_code_t err_code;
        uint32_t lfclk_state = 1;
        
        while(lfclk_state)
        {
            lfclk_state = NRF_CLOCK->LFCLKSTAT; //lfclk_state =0x00010000
        }
        
        err_code = nrf_drv_clock_init();
        APP_ERROR_CHECK(err_code);
    ....
    }
    

    After the exception occurs, I put the low-frequency clock configuration set to use internal frequency clock, the program can run, but related to low frequency clock driver is invalid, such as app_timer, WDT, etc

    After this exception occurs,Cut off the chip power supply, and then to electricity to make the program run normally

Children
No Data
Related