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
  • Hi Malki, 

    Do you use nrf_sdh module to enable softdevice and handle softdevice request ? The nrf_clock module is designed with relation with nrf_sdh module.I would suggest to enable softdevice you use the nrf_sdh module instead of using mesh_softdevice_init.c 

    You can refer and test with my example here (I use nrf_sdh in that example instead of mesh_sottdevice_init.c) 

    Please let me know if it works for you. 

Children
Related