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

Parents Reply Children
  • Hi,

    Thanks for your replay.

    1、It has out section. Communicate between pc and device(52840).

    #define DEF_HID_DSC_NEXT() { \
    0x05, 0x01, \
    0x09, 0x00, \
    0xa1, 0x01, \
    0x15, 0x00, \
    0x25, 0xff, \
    0x19, 0x01, \
    0x29, 0x08, \
    0x95, 0x40, \
    0x75, 0x08, \
    0x81, 0x02, \
    0x19, 0x01, \
    0x29, 0x08, \
    0x91, 0x02, \
    0xc0 \
    }
    APP_USBD_HID_GENERIC_SUBCLASS_REPORT_DESC(hid_desc,DEF_HID_DSC_NEXT());
    static const app_usbd_hid_subclass_desc_t * reps[] = {&hid_desc};

    2、Independent enable HID or MSD.


    Yes,i'm sure. 

    Thanks.

  • Hi,

     

    I am sorry for the late reply.

    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);

    Have you tried setting the buffers to align the size of your input and output report? Now you have set these to '1' and '0', but it seems that this should be set to 63, 0.

    Could you share a project that is showing this issue?

    Kind regards,

    Håkon

Related