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

nRF52840 adding out endpoint to usbd_hid_generic example in SDK 15

Hello Nordic experts,

I am trying to add an output endpoint to the usbd_hid_generic example in nRF5_SDK_15.0.0_a53641a. I exactly followed the suggestions in 

https://devzone.nordicsemi.com/f/nordic-q-a/36145/nrf52840-usbd_hid_generic-endpoint-out-error

However, when I monitor the usb with Bus Hound, there is no sign of Endpoint 1 OUT. Please have a look at the attached photo. Can you please help me to understand what I am doing wrong?

Moreover, in the attached photo, you can see that (34) USB Input Device does not have any sub-port/branch, while for the usbd_hid_generic without any modification, there was a sub-port similar to (20) in the attached photo.

Thanks

Parents
  • Hi,

     

    Sorry for the late reply, I can confirm that I see the same thing and it took a bit of time to find the source of the issue.

    This is a bug from our side, where line 452 in app_usbd_hid_generic.c loops over "i" instead of "j".

    If you change it to this, it should work as expected:

    p_cur_ep = app_usbd_class_iface_ep_get(p_cur_iface, j);

     

    Could you try this and report back?

     

    Kind regards,

    Håkon

Reply
  • Hi,

     

    Sorry for the late reply, I can confirm that I see the same thing and it took a bit of time to find the source of the issue.

    This is a bug from our side, where line 452 in app_usbd_hid_generic.c loops over "i" instead of "j".

    If you change it to this, it should work as expected:

    p_cur_ep = app_usbd_class_iface_ep_get(p_cur_iface, j);

     

    Could you try this and report back?

     

    Kind regards,

    Håkon

Children
  • Great, this resolves the issue. Thanks a lot. 

  • Hi,

      I am facing the same related issues,when i change the USBD_GENERIC_REPORT_DESCRIPTOR  to as shown as below:

    #define USBD_GENERIC_REPORT_DESCRIPTOR {                        \
          0x06, 0x01, 0xFF,    /*      Usage Page (unk)         */ \
          0x09, 0x01,          /*   Usage (0x01)                */ \
          0xA1, 0x01,          /*   Collection (Application)    */ \
          0xA1, 0x02,          /*     Collection (Logical)      */ \
          0x85, 0x5B,          /*       Report ID (0x5B)        */ \
          0x09, 0x14,          /*       Usage (0x14)            */ \
          0x15, 0x80,          /*       Logical Minimum (-128)  */ \
          0x25, 0x7F,          /*       Logical Maximum (127)   */ \
          0x75, 0x08,          /*       Report Size (8)         */ \
          0x95, 0x3F,          /*       Report Count (63)       */ \
          0x81, 0x22,          /*       Input (Var, PrefState)  */ \
          0xC0,                /*     End Collection            */ \
          0xA1, 0x02,          /*     Collection (Logical)      */ \
          0x85, 0x5C,          /*       Report ID (0x5C)        */ \
          0x09, 0x14,          /*       Usage (0x14)            */ \
          0x15, 0x80,          /*       Logical Minimum (-128)  */ \
          0x25, 0x7F,          /*       Logical Maximum (127)   */ \
          0x75, 0x08,          /*       Report Size (8)         */ \
          0x95, 0x3F,          /*       Report Count (63)       */ \
          0x81, 0x22,          /*       Input (Var, PrefState)  */ \
          0xC0,                /*     End Collection            */ \
          0xA1, 0x02,          /*     Collection (Logical)      */ \
          0x85, 0x5D,          /*       Report ID (0x5D)        */ \
          0x09, 0x14,          /*       Usage (0x14)            */ \
          0x15, 0x80,          /*       Logical Minimum (-128)  */ \
          0x25, 0x7F,          /*       Logical Maximum (127)   */ \
          0x75, 0x08,          /*       Report Size (8)         */ \
          0x95, 0x3F,          /*       Report Count (63)       */ \
          0x81, 0x22,          /*       Input (Var, PrefState)  */ \
          0xC0,                /*     End Collection            */ \
          0xA1, 0x02,          /*     Collection (Logical)      */ \
          0x85, 0x5E,          /*       Report ID (0x5E)        */ \
          0x09, 0x14,          /*       Usage (0x14)            */ \
          0x15, 0x80,          /*       Logical Minimum (-128)  */ \
          0x25, 0x7F,          /*       Logical Maximum (127)   */ \
          0x75, 0x08,          /*       Report Size (8)         */ \
          0x95, 0x1F,          /*       Report Count (31)       */ \
          0x91, 0x22,          /*       Output (Var, PrefState) */ \
          0xC0,                /*  End Collection               */ \
          0xC0                /*End Collection                 */ \
    }

    it can't work well,can u give me some suggestions?thanks.

Related