Windows GET_DESCRIPTOR won't accept > 255 bytes?

Howdy forum.

I am using the teensy audio usb descriptors as an example for implementing a usb audio class device on the arduino zero.

I ran into a puzzling issue while creating a USB device descriptor, and sending it to the host machine.

The host machine during enumeration, asks in a setup packet for the Configuration Descriptor (0x02). I have the MCU responding with my configuration descriptor, which, when I implement the USB speaker device, it works fine :slight_smile:

But unfortunately when I add the microphone terminals, I end up with an error in the device manager that the Get Configuration Descriptor failed.

I believe the reason is because my USB configuration descriptor with the microphone enabled, is greater than 255 bytes!

I found a document from microsoft that explains, "For compatibility reasons the configuration descriptor request will specify a length of 255 bytes.", but it does not explain why.

I have ensured that there are no buffer overflows on my device side, and that I indeed should be sending the entire descriptor.

Now where I am puzzled, is how can I work around this bug?

The teensy device descriptor is absolutely huge when everything is enabled --far greater than 255 bytes.

Surely there must be a way to do it, but I am puzzled :slight_smile:

Moderator edit: link corrected

Now where I am puzzled, is how can I work around this bug?

The bug in the operating system on your PC? How the f**k does that relate to the Arduino?

I am not sure, but there must be a work-around. For some reason, the PC will accept the configuration descriptor from a teensy with a wTotalLength of 530 bytes, but not an arduino zero with more than 255 bytes.

I am not certain if there is some small USB stack detail I am missing which would cause this.

Edit:
It could also be an issue with the Samd21 Arduino Core that I have not sussed out --as any pluggableUSB module, or sums of pluggableUSB modules, which cause the config descriptor to exceed 255 bytes will cause the problem.

Device Descriptor:
------------------------------
0x12 bLength
0x01 bDescriptorType
0x0101 bcdUSB
0xEF bDeviceClass      (Miscellaneous device)
0x02 bDeviceSubClass   
0x01 bDeviceProtocol   
0x40 bMaxPacketSize0   (64 bytes)
0x16C0 idVendor
0x0476 idProduct
0x0200 bcdDevice
0x01 iManufacturer
0x02 iProduct
0x03 iSerialNumber
0x01 bNumConfigurations

Configuration Descriptor:
------------------------------
0x09 bLength
0x02 bDescriptorType
0x0212 wTotalLength   (530 bytes)
0x0D bNumInterfaces
0x01 bConfigurationValue
0x00 iConfiguration
0xC0 bmAttributes   (Self-powered Device)
0x32 bMaxPower      (100 mA)

Interface Association Descriptor:
------------------------------
0x08 bLength
0x0B bDescriptorType
0x00 bFirstInterface
0x02 bInterfaceCount
0x02 bFunctionClass      (Communication Device Class)
0x02 bFunctionSubClass   (Abstract Control Model - ACM)
0x01 bFunctionProtocol   (ITU-T V.250)
0x04 iFunction

Interface Descriptor:
------------------------------
0x09 bLength
0x04 bDescriptorType
0x00 bInterfaceNumber
0x00 bAlternateSetting
0x01 bNumEndPoints
0x02 bInterfaceClass      (Communication Device Class)
0x02 bInterfaceSubClass   (Abstract Control Model - ACM)
0x01 bInterfaceProtocol   (ITU-T V.250)
0x00 iInterface

Also posted at:

If you're going to do that then please be considerate enough to add links to the other places you cross posted. This will let us avoid wasting time due to duplicate effort and also help others who have the same questions and find your post to discover all the relevant information. When you post links please always use the chain links icon on the toolbar to make them clickable.