Hello Nordic experts,
I am working with nRF5_SDK_15.2.0_9412b96 SDK.
In example nRF5_SDK_15.2.0_9412b96/examples/ble_peripheral/ble_app_hrs_freertos/main.c I have at line № 969 a call to nrf_sdh_freertos_init. This function is that which instantiates the BLE FreeRTOS task, the handle of which is stored in static variable m_softdevice_task defined at line № 57 of file nRF5_SDK_15.2.0_9412b96/components/softdevice/common/nrf_sdh_freertos.c.
As line № 57 of this file, a function SD_EVT_IRQHandler calls the FreeRTOS primitive xTaskResumeFromISR as follows : « xTaskResumeFromISR( m_softdevice_task ) », which requires from the FreeRTOS perspective that « m_softdevice_task != NULL », otherwise assertion « configASSERT( xTaskToResume ); » at line № 1837 of file nRF5_SDK_15.2.0_9412b96/external/freertos/source/tasks.c will fail.
Now, the issue is that form the code in example nRF5_SDK_15.2.0_9412b96/examples/ble_peripheral/ble_app_hrs_freertos/main.c I am afraid that it is possible that SD_EVT_IRQHandler be called before nrf_sdh_freertos_init, which will cause this assertion to be failed.
Could you please confirm or not my analysis ?
If yes could you please provide a fix, my proposal is to call nrf_sdh_freertos_init immediately before callllble_stack_init at line № 953 of file nRF5_SDK_15.2.0_9412b96/examples/ble_peripheral/ble_app_hrs_freertos/main.c.