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

lfclk, rtc issue on SDK13

I am trying to set up RTC2 by following an example github.com/.../saadc_low_power I ported it to my project which is running a softdevice on nRF52. It works perfectly fine on SDK11 but has problems on SDK13.0 / 13.1. Seems like nrf_drv_clock_init() or nrf_drv_rtc_init() has conflict with the BLE stack. Any idea what has changed from SDK11 to SDK13?

Parents
  • Hi,

    You can't call nrf_drv_rtc_init() with p_config = NULL. There is an assert inside the function that checks if p_config is set, but this is not firing for some reason. If called without config, the priority will not be set to one of the allowed levels for use with softdevice.

    You should get default config from sdk_config.h like this:

    static void rtc_config(void)
    {
        uint32_t err_code;
    
        //Initialize RTC instance
        nrf_drv_rtc_config_t config = NRF_DRV_RTC_DEFAULT_CONFIG;
        err_code = nrf_drv_rtc_init(&rtc, &config, rtc_handler);
        APP_ERROR_CHECK(err_code);
    }
    

    Best regards,

    Jørgen

Reply
  • Hi,

    You can't call nrf_drv_rtc_init() with p_config = NULL. There is an assert inside the function that checks if p_config is set, but this is not firing for some reason. If called without config, the priority will not be set to one of the allowed levels for use with softdevice.

    You should get default config from sdk_config.h like this:

    static void rtc_config(void)
    {
        uint32_t err_code;
    
        //Initialize RTC instance
        nrf_drv_rtc_config_t config = NRF_DRV_RTC_DEFAULT_CONFIG;
        err_code = nrf_drv_rtc_init(&rtc, &config, rtc_handler);
        APP_ERROR_CHECK(err_code);
    }
    

    Best regards,

    Jørgen

Children
Related