Skip to main content
Visitor II
May 7, 2020
Question

Is there any driver needed for Composite USB class??

  • May 7, 2020
  • 1 reply
  • 952 views

Composite USB class device is not detected. It always shows device descriptor failed error.

Composite USB class (MSC+ CustomHID)

    This topic has been closed for replies.

    1 reply

    Super User
    May 7, 2020

    I don't think you need a custom driver for the composite class, just the individual ones, unless they also use built-in drivers. Not 100% sure on that.

    I'd use Wireshark/USBPcap to figure out what's happening on the bus. Device descriptor failed sounds like the device isn't even sending a response to the request, not that a driver doesn't exist.

    Graduate II
    May 7, 2020

    >>Device descriptor failed sounds like the device isn't even sending a response to the request..

    I'd probably focus on validating the integrity of the descriptor, if it's not constructed properly it is going to get ignored/rejected. Check that it is being requested/sent from the device side.

    NKAuthor
    Visitor II
    May 8, 2020

    Thank you clive1.

    Could please tell me that how I can check whether the response is sent by device or not??

    It would be a great help,as I am totally new to this and not understanding it how should I proceed to debug this problem??

    #define USB_MSC_CUSTOMHID_INTERFACE_NBR      2

    #define USB_CUSTMHID_INTERFACE            0

    #define USB_MSC_INTERFACE              1

    #define MSC_EPIN_NUM             0x02

    #define MSC_EPIN_ADDR            0x82

    #define MSC_EPOUT_NUM            0x02

    #define MSC_EPOUT_ADDR            0x02

    #define CUSTOM_HID_EPIN_NUM         0x01

    #define CUSTOM_HID_EPIN_ADDR         0x81

    #define CUSTOM_HID_EPIN_SIZE         0x02

    #define CUSTOM_HID_EPOUT_NUM         0x01

    #define CUSTOM_HID_EPOUT_ADDR        0x01

    #define CUSTOM_HID_EPOUT_SIZE        0x02

    Descriptors are as follows:

    Device descriptor:

     0x12,            /*bLength */

     USB_DESC_TYPE_DEVICE,    /*bDescriptorType*/

     0x02,

     0x00,            /*bDeviceClass*/

     0x00,            /*bDeviceSubClass*/

     0x00,            /*bDeviceProtocol*/

     USB_MAX_EP0_SIZE,      /*bMaxPacketSize*/

     LOBYTE(USBD_VID),      /*idVendor*/

     HIBYTE(USBD_VID),      /*idVendor*/

     LOBYTE(USBD_PID_FS),    /*idProduct*/

     HIBYTE(USBD_PID_FS),    /*idProduct*/

     0x00,            /*bcdDevice rel. 2.00*/

     0x02,

     USBD_IDX_MFC_STR,      /*Index of manufacturer string*/

     USBD_IDX_PRODUCT_STR,    /*Index of product string*/

     USBD_IDX_SERIAL_STR,    /*Index of serial number string*/

     USBD_MAX_NUM_CONFIGURATION /*bNumConfigurations*/

    Configuration descriptor:

     0x09,  /* bLength: Configuation Descriptor size */

     USB_DESC_TYPE_CONFIGURATION,  /* bDescriptorType: Configuration */

     LOBYTE(USB_MSC_CUSTOMHID_CONFIG_DESC_SIZ), /* wTotalLength in byte */

     HIBYTE(USB_MSC_CUSTOMHID_CONFIG_DESC_SIZ),

     USB_MSC_CUSTOMHID_INTERFACE_NBR,  /* bNumInterfaces: 2 interface */

     0x01,  /* bConfigurationValue: */

     0x04,  /* iConfiguration: */

     0xC0,  /* bmAttributes: */

     0x32,  /* MaxPower 100 mA */

    Is there anything missing or wrong in descriptors?

    Thank you.