Compound Devices

MyUSB Library, Projects Add comments

Right, soon 1.5.1 will be released - found a few more bugs which needed to be quashed, especially the faulty endpoint/pipe size to mask translation routine. One small new thing that will make it into the revision release will be the addition of the Interface Association standard descriptor to StdDescriptors.h.

The IAD is something I stumbled onto by chance while trying to find a link to a thread discussing getting CDC + anything to run as a compound device under Windows. In Windows, devices implementing several classes - called Compound devices - have each interface enumerated separately will different drivers. For most devices that isn’t a problem, but in the case of the CDC class it is disasterous, as the CDC class uses two separate interfaces for the one function.

Having a basic CDC class device is fine under Windows, as Windows then passes the entire device over to the usbser.sys driver file and all is well. However, under compound device mode, the two CDC interfaces are treated as separate functions and the result is a non-functioning CDC. People have posted Windows-specific workarounds based on the shoddyness of the drivers to get it to work, however that breaks functionality on other OSes.

While trying to find the thread which explained all that for the person enquiring about it, I found a mention of the “Interface Association Descriptor”, something I’d missed until now. It turns out that the IAD was a supplement to the USB2.0 standard and was posted as an Engineering Change Notice (ECN) after the specification, meaning that unless I knew to look for it, I wouldn’t have found it.

The IAD is designed to address exactly the above problem. It allows a compound device to specify which interfaces should be grouped and enumerated together under the one driver - allowing the two CDC interfaces to be linked, for example. Damn useful, with only two drawbacks:

1) It is only supported in Windows XP SP2 or higher, and in newer Linux releases
2) It requires the device to use a special class indicating that it is a IAD supporting device, meaning non supporting OSes will fail to enumerate the device completely rather than just some of the functions

However, it will be very useful in the future for all new devices, especially those for Vista and beyond. I’m really glad to have a real solution to the problem, so I’m adding in the descriptor to MyUSB.

You can read the IAD document here.

Leave a Reply

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in