I'm on my Windows 10 machine using Segger Embedded Studio V4.52C. I'm using SDK16 and Mesh 4.0.1 with FreeRTOS. I have built the light switch server example found here to understand how to get the mesh and the RTOS to play nicely together. I have the example setup so I can provision and use it on a mesh network with the nRF Mesh app. The switch to a very different module was a bit of a trick to get working, but that's not the main point. I've stitched my project together with the mesh SDK and it does run, however, it crashes on provisioning after doing most of the provisioning.
During provisioning, mesh_provisionee.c requests to shut the softdevice down. I'm not sure why this is needed. The call stack below is where it makes the shut down request.
This happens in both the working example and my not working project. The difference is I get an error on line 107 of nrf_sdh_soc.c because sd_evt_get() return error 2 which means NRF_ERROR_SOFTDEVICE_NOT_ENABLED. My guess is that some observers have not been notified and the request from the softdevice in nrf_sdh_soc_evts_poll() is still made. I tried making this conditional in the softdevice_task() function whence this called:
if(!nrf_sdh_is_suspended()) nrf_sdh_evts_poll();
It appears that nrf_sdh_is_suspended() does not return an accurate status of whether or not the softdevice is on or off. Still, I'm not sure why one project does not have this issue, while the other one does. So I would like some direction on where I should look next.