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

clock issue in FreeRTOS integration with Mesh code

Hi,

I'm using nRF52840 (rev 1.0.0) and Mesh 2.0.1 and SD 15.0.0. 

I added FreeRTOS following the example "hrs FreeRTOS".

In FreeRTOS, the source clock (configTICK_SOURCE) is configured as FREERTOS_USE_SYSTICK.

When I call nrf_drv_clock_init() and then sd_softdevice_enable(...), I get error 0x1001 "NRF_ERROR_SDM_INCORRECT_INTERRUPT_CONFIGURATION".

Without the *** init function, when FreeRTOS tries to setup the RTC in

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

The call request for the clock fail cause the module ( clock) is not initialized ! " ASSERT(m_clock_cb.module_initialized);"

how can I initialize the clock and not get an error from the softdevice init function ?

Parents Reply
  • I tested this on the light switch provisionner and added nrf_drv_clock_init(); before the soft device init function, so the code looks like below but still I got the same error in sd_softdevice_enable()

    I still ge the same error 0x1001  in sd_softdevice_enable()

        ret_code_t err_code = nrf_drv_clock_init();
        APP_ERROR_CHECK(err_code);
    
        /* Mesh Init */
        nrf_clock_lf_cfg_t lfc_cfg = DEV_BOARD_LF_CLK_CFG;
        ERROR_CHECK(mesh_softdevice_init(lfc_cfg));
        mesh_init();

Children
Related