Using
SW : NRF_SDK_16, SDK_MESH_v4.0
HW: NRF52840 DONGLE.
I have implemented light_switch_client which also has USB part initialization and then added in USB_DONGLE. I have followed below mentioned guide for the necessary changes while loading the code in dongle
Now my PC detects Dongle as one of the USB ports.All I want to do is send the data from serial terminal on detected USB PORT and then publish it over the mesh.
Issue as below :-
I am getting app_error_weak.c, 105, Mesh assert at 0x0002C8FA (:0) upon trying to publish the received data over mesh.
1.I think this issue is related to interrupt priority of USB and MESH. Mesh uses NRF_MESH_IRQ_PRIORITY_LOWEST where as USB uses NRFX_USBD_CONFIG_IRQ_PRIORITY 6 as a interrupt priority levels.
Please see the attached code for the reference
case APP_USBD_CDC_ACM_USER_EVT_RX_DONE:
{
index++;
do
{
if(m_cdc_data_array[index-1]==0xFA && m_cdc_data_array[index-2]==0x5F)
{
__LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "ready to publish\n");
app_onoff_status_publish(&m_onoff_server_0); // publishing the data here which causes the error
index=0;
memset(m_cdc_data_array,0,sizeof(m_cdc_data_array));
}
ret = app_usbd_cdc_acm_read(&m_app_cdc_acm,
&m_cdc_data_array[index],
1);
if (ret == NRF_SUCCESS)
{
index++;
}
__LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "--index=%d-----\n",index);
__LOG_XB(LOG_SRC_APP, LOG_LEVEL_INFO,"RX: Msg : Received", m_cdc_data_array,index);
}while(ret == NRF_SUCCESS);