cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 composite USB device

romanetz4
Associate II
Posted on November 22, 2015 at 03:49

I need to create UAC+CDC USB device. I have now two different projects with UAC and CDC implemented. How to organize them into composite device?

My solution now is to describe device as 

0x12,                       /*bLength */

USB_DEVICE_DESCRIPTOR_TYPE, /*bDescriptorType*/

0x00,                       /*bcdUSB */

0x02,

0xEF,                       /*bDeviceClass*/ /* Misc class */

0x02,                       /*bDeviceSubClass*/ /* Common class */

0x01,                       /*bDeviceProtocol*/ /*IAD*/

USB_OTG_MAX_EP0_SIZE,      /*bMaxPacketSize*/

LOBYTE(USBD_VID),           /*idVendor*/

HIBYTE(USBD_VID),           /*idVendor*/

LOBYTE(USBD_PID),           /*idVendor*/

  HIBYTE(USBD_PID),           /*idVendor*/

  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_CFG_MAX_NUM            /*bNumConfigurations*/

 and describe interfaces with two IADs?

0x08, // bLength: Interface Descriptor size

0x0B, // bDescriptorType: IAD

0x00, // bFirstInterface

0x02, // bInterfaceCount

0x02, // bFunctionClass: CDC

0x02, // bFunctionSubClass: ACM

0x01, // bFunctionProtocol 

0x01, // iFunction

for CDC and

0x08, // bLength: Interface Descriptor size

0x0B, // bDescriptorType: IAD

0x02, // bFirstInterface

0x02, // bInterfaceCount

0x01, // bFunctionClass: UAC

0x01, // bFunctionSubClass: Audio control interface

0x00, // bFunctionProtocol: Protocol undefined

0x02 // iFunction

for UAC. Is it correct?

0 REPLIES 0