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
  • To be more precise, these are the changes I made to the usbd_hid_generic example in main.c:

    /**
    * @brief HID generic class endpoint number.
    * */
    #define HID_GENERIC_EPIN NRF_DRV_USBD_EPIN1
    #define HID_GENERIC_EPOUT NRF_DRV_USBD_EPOUT1

    #define REPORT_OUT_MAXSIZE 63

    #define ENDPOINT_LIST() \
    ( \
    HID_GENERIC_EPIN,HID_GENERIC_EPOUT \
    )

    #define USBD_GENERIC_REPORT_DESCRIPTOR { \
    0x06, 0xD0, 0xF1 , /*USAGE_PAGE (FIDO Alliance) */ \
    0x09, 0x01 , /* USAGE (U2F HID Authenticator Device) */ \
    0xa1, 0x01 , /* COLLECTION (Application) */ \
    0x09, 0x20 , /*   USAGE (Input Report Data) */ \
    0x15, 0x00 , /*   LOGICAL_MINIMUM (0) */ \
    0x26, 0xff, 0x00 , /*   LOGICAL_MAXIMUM (255) */ \
    0x75, 0x08 , /*   REPORT_SIZE (8) */ \
    0x95, 0x40 , /*   REPORT_COUNT (64) */ \
    0x81, 0x02 , /*   INPUT (Data,Var,Abs) */ \
    0x09, 0x21 , /*   USAGE(Output Report Data) */ \
    0x15, 0x00 , /*   LOGICAL_MINIMUM (0) */ \
    0x26, 0xff, 0x00 , /*   LOGICAL_MAXIMUM (255) */ \
    0x75, 0x08 , /*   REPORT_SIZE (8) */ \
    0x95, 0x40 , /*   REPORT_COUNT (64) */ \
    0x91, 0x02 , /*   OUTPUT (Data,Var,Abs) */ \
    0xc0 , /* END_COLLECTION */ \
    }

    APP_USBD_HID_GENERIC_SUBCLASS_REPORT_DESC(mouse_desc,USBD_GENERIC_REPORT_DESCRIPTOR);

    /**
    * @brief Global HID generic instance
    */
    APP_USBD_HID_GENERIC_GLOBAL_DEF(m_app_hid_generic,
    HID_GENERIC_INTERFACE,
    hid_user_ev_handler,
    ENDPOINT_LIST(),
    reps,
    REPORT_IN_QUEUE_SIZE,
    REPORT_OUT_MAXSIZE,
    APP_USBD_HID_SUBCLASS_NONE, 
    APP_USBD_HID_PROTO_GENERIC);

Reply
  • To be more precise, these are the changes I made to the usbd_hid_generic example in main.c:

    /**
    * @brief HID generic class endpoint number.
    * */
    #define HID_GENERIC_EPIN NRF_DRV_USBD_EPIN1
    #define HID_GENERIC_EPOUT NRF_DRV_USBD_EPOUT1

    #define REPORT_OUT_MAXSIZE 63

    #define ENDPOINT_LIST() \
    ( \
    HID_GENERIC_EPIN,HID_GENERIC_EPOUT \
    )

    #define USBD_GENERIC_REPORT_DESCRIPTOR { \
    0x06, 0xD0, 0xF1 , /*USAGE_PAGE (FIDO Alliance) */ \
    0x09, 0x01 , /* USAGE (U2F HID Authenticator Device) */ \
    0xa1, 0x01 , /* COLLECTION (Application) */ \
    0x09, 0x20 , /*   USAGE (Input Report Data) */ \
    0x15, 0x00 , /*   LOGICAL_MINIMUM (0) */ \
    0x26, 0xff, 0x00 , /*   LOGICAL_MAXIMUM (255) */ \
    0x75, 0x08 , /*   REPORT_SIZE (8) */ \
    0x95, 0x40 , /*   REPORT_COUNT (64) */ \
    0x81, 0x02 , /*   INPUT (Data,Var,Abs) */ \
    0x09, 0x21 , /*   USAGE(Output Report Data) */ \
    0x15, 0x00 , /*   LOGICAL_MINIMUM (0) */ \
    0x26, 0xff, 0x00 , /*   LOGICAL_MAXIMUM (255) */ \
    0x75, 0x08 , /*   REPORT_SIZE (8) */ \
    0x95, 0x40 , /*   REPORT_COUNT (64) */ \
    0x91, 0x02 , /*   OUTPUT (Data,Var,Abs) */ \
    0xc0 , /* END_COLLECTION */ \
    }

    APP_USBD_HID_GENERIC_SUBCLASS_REPORT_DESC(mouse_desc,USBD_GENERIC_REPORT_DESCRIPTOR);

    /**
    * @brief Global HID generic instance
    */
    APP_USBD_HID_GENERIC_GLOBAL_DEF(m_app_hid_generic,
    HID_GENERIC_INTERFACE,
    hid_user_ev_handler,
    ENDPOINT_LIST(),
    reps,
    REPORT_IN_QUEUE_SIZE,
    REPORT_OUT_MAXSIZE,
    APP_USBD_HID_SUBCLASS_NONE, 
    APP_USBD_HID_PROTO_GENERIC);

Children
No Data
Related