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

nrf52840 msd and hid error

Hi,

   My english is not good, please forgive me.

 msd and hid device,set as follow:

//msd-------------------------------------------------------------

APP_USBD_MSC_GLOBAL_DEF(m_app_msc,0,hw_usb_msc_user_ev_handler,(NRF_DRV_USBD_EPIN1,NRF_DRV_USBD_EPOUT1),BLOCKDEV_LIST(),DEF_HW_MSC_WORKBUFFER_SIZE);

//hid

APP_USBD_HID_GENERIC_GLOBAL_DEF(m_app_hid_generic_in,1,hid_user_ev_handler,(NRF_DRV_USBD_EPIN2,NRF_DRV_USBD_EPOUT2),reps,1,0,APP_USBD_HID_SUBCLASS_NONE,APP_USBD_HID_PROTO_GENERIC);

//code

void hw_usb_init(void)
{
    ret_code_t ret;
    static const app_usbd_config_t usbd_config = {
                .ev_state_proc = hw_usb_user_ev_handler//usb常规时间,挂起,停止等
     };

   app_usbd_uninit();
   ret = app_usbd_init(&usbd_config);
   APP_ERROR_CHECK(ret);


//msd
app_usbd_class_inst_t const * class_inst_msc = app_usbd_msc_class_inst_get(&m_app_msc);//获取实例
ret = app_usbd_class_append(class_inst_msc);
APP_ERROR_CHECK(ret);


//hid
app_usbd_class_inst_t const * class_inst_generic;
class_inst_generic = app_usbd_hid_generic_class_inst_get(&m_app_hid_generic);

ret = hid_generic_idle_handler_set(class_inst_generic, idle_handle);
APP_ERROR_CHECK(ret);

ret = app_usbd_class_append(class_inst_generic);
APP_ERROR_CHECK(ret);

}

After running, the error is as follows:

NRF_BREAKPOINT_COND;
// On assert, the system can only recover with a reset.

<info> app: usb started

<info> app: usb suspend

<info> app: usb resume

<error> app: ERROR 3735928559 [Unknown error code] at E:\blue\software\nrf52840 prj\nrf52 sdk\nRF5_SDK_15.2.0_9412b96\components\libraries\usbd\app_usbd.h:579
PC at: 0x00034E11
<error> app: End of error report

Related