cancel
Showing results for 
Search instead for 
Did you mean: 

Is there any driver needed for Composite USB class??

NK
Associate II

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

Composite USB class (MSC+ CustomHID)

4 REPLIES 4
TDK
Guru

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.

If you feel a post has answered your question, please click "Accept as Solution".

>>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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
NK
Associate II

Thank you TDK.

Yes, as you say like device is unable to send response to the host request..the enumeration itself failed.

Actually I am new to this and i am not able to understand for composite class specific to MSC+CustomHID, what are the device descriptors??

Right now I am working on STM32L4R5ZI board and I passed MSC class device descriptor.

VID: 1155

PID: 22314

Could you please suggest me what device descriptor should I used?? Or for composite class how we can get VID and PID which combine both the classes??

Thank you.

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.