Developping a composite USB device using Microsoft Descriptor

  • Thread starter Thread starter ADB007
  • Start date Start date
A

ADB007

Guest
Hello, I'm currently developping a composite USB device (4 interfaces: CDC/VCOM + 2 * winusb compatible) on an embedded device (microcontroller). To facilitate my device being recognised on a computer, I'm trying to implement "Microsoft Compatible ID Feature Descriptor " and "Microsoft Extended Properties Feature Descriptors" to ensure Windows assigns a winusb driver to my interface. So far, I've only been able to do this for 1 interface but not 2.

The WCID_CompatID_Descriptor and WCID_ExtProp_Descriptor can have multiple sections. Are any working examples available for 2 sections? See what I've done below.

Thanks in advance for your help,

Regards,

Alan


/* WCID USB: Microsoft String Descriptor */
ALIGNED(4) const uint8_t WCID_String_Descriptor[] = {
(8 * 2 + 2), /* bLength (8 Char + Type + length) */
USB_STRING_DESCRIPTOR_TYPE, /* bDescriptorType */
'M', 0,
'S', 0,
'F', 0,
'T', 0,
'1', 0,
'0', 0,
'0', 0,
LUSB_PID, 0,
};

// WCID USB: Microsoft Compatible ID Feature Descriptor
ALIGNED(4) const uint8_t WCID_CompatID_Descriptor[] = {
0x28, 0x00, 0x00, 0x00, // Length 40 bytes
0x00, 0x01, // Version
0x04, 0x00, // Compatibility ID Descriptor index
0x01, // Number of sections
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, // Reserved: 7 bytes


USB_CDC_LIB_NUM, // Interface Number //AB: this is the bInterfaceNumber of the WINUSB device
0x01, // Reserved
'W', 'I', 'N', 'U', 'S', 'B', 0x00, 0x00, // Compatible ID: 8 bytes ASCII
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, // Sub-Compatible ID: 8 bytes ASCII
0x00, 0x00, 0x00, 0x00,

0x00, 0x00, // Reserved: 6 bytes
};



// WCID USB: Microsoft Extended Properties Feature Descriptor
ALIGNED(4) const uint8_t WCID_ExtProp_Descriptor[] = {
0x8E, 0x00, 0x00, 0x00, // Length 142 bytes
0x00, 0x01, // Version
0x05, 0x00, // Extended Properties Feature Descriptor index
0x01, 0x00, // Number of sections

0x84, 0x00, 0x00, 0x00, // Size of the property section
0x01, 0x00, 0x00, 0x00, // Property data type (1 = Unicode REG_SZ, see table below)
0x28, 0x00, // Property name length (40 bytes)
// Property Name ("DeviceInterfaceGUID")
'D', 0, 'e', 0, 'v', 0, 'i', 0, 'c', 0, 'e', 0, 'I', 0, 'n', 0,
't', 0, 'e', 0, 'r', 0, 'f', 0, 'a', 0, 'c', 0, 'e', 0, 'G', 0,
'U', 0, 'I', 0, 'D', 0, 0, 0,
0x4E, 0x00, 0x00, 0x00, // Property data length (78 bytes)
// Property Name "{88BAE032-5A81-49f0-BC3D-A4FF138216D6}" from winusb.inf
'{', 0, '8', 0, '8', 0, 'b', 0, 'a', 0, 'e', 0, '0', 0, '3', 0,
'2', 0, '-', 0, '5', 0, 'a', 0, '8', 0, '1', 0, '-', 0, '4', 0,
'9', 0, 'f', 0, '0', 0, '-', 0, 'b', 0, 'c', 0, '3', 0, 'd', 0,
'-', 0, 'a', 0, '4', 0, 'f', 0, 'f', 0, '1', 0, '3', 0, '8', 0,
'2', 0, '1', 0, '6', 0, 'd', 0, '6', 0, '}', 0, 0, 0,
};

Continue reading...
 
Back
Top