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

nrf_drv_clock_lfclk_request required by freeRTOS but is part of legacy drivers

SDK 15.2

port_cmsis_systick.c 

void vPortSetupTimerInterrupt( void )
{
    /* Request LF clock */
    nrf_drv_clock_lfclk_request(NULL);

    /* Configure SysTick to interrupt at the requested rate. */
    nrf_rtc_prescaler_set(portNRF_RTC_REG, portNRF_RTC_PRESCALER);
    nrf_rtc_int_enable   (portNRF_RTC_REG, RTC_INTENSET_TICK_Msk);
    nrf_rtc_task_trigger (portNRF_RTC_REG, NRF_RTC_TASK_CLEAR);
    nrf_rtc_task_trigger (portNRF_RTC_REG, NRF_RTC_TASK_START);
    nrf_rtc_event_enable(portNRF_RTC_REG, RTC_EVTEN_OVRFLW_Msk);

    NVIC_SetPriority(portNRF_RTC_IRQn, configKERNEL_INTERRUPT_PRIORITY);
    NVIC_EnableIRQ(portNRF_RTC_IRQn);
}

 nrf_drv_clock_lfclk_request is part of the legacy drivers that will eventually be removed? 

Does this mean for FreeRTOS I need to keep using the legacy clock driver?

Is this likely to change?

Parents
  • Hi Ceri,

    The nrf_drv_clock_lfclk_request is actually used as a wrapper and if you take a look inside the function you will see it uses nrfx_clock_lfclk_start to start timers. This is not likely to change in the near future.

    To enable the NRF_CLOCK module in sdk_config.h, just search for the following lines of code:

    // <e> NRF_CLOCK_ENABLED - nrf_drv_clock - CLOCK peripheral driver - legacy layer
    //==========================================================
    #ifndef NRF_CLOCK_ENABLED
    #define NRF_CLOCK_ENABLED 1
    #endif

    You will also need to enabled the NRFX_CLOCK module in the same way.

    Best Regards,

    Marjeris

  • Ok so what is rule with sdk_config.h and nrfx_config.h?

    I have both at the moment with the nrfx drivers in nrfx_config.h and anything else in sdk_config.h It looks like it is just picking up the nrfx_drivers. If I put it in the sdk_confif.h then it does not find it.

    I added your above code to the nrfx_driver file and it is compiling fine.

Reply Children
Related