2
\$\begingroup\$

I'm looking to use an LPC1345 microcontroller to run a USB hub. Thanks to this question, I know that a single USB device can be used to act as multiple classes but how many?

The USB hub would have four slots, so I'd need four MSD classes implemented if I understand this properly. It'd also be nice to have the DFU class in case I need to update the firmware at a later time.

Is there a limit in the USB standard on how many classes that can be implemented in a composite device or is there some characteristic of a particular controller I'd need to look into to determine if the controller is capable of doing so?

\$\endgroup\$

2 Answers 2

2
\$\begingroup\$

You have limit to the number of endpoints in a device (16). If you only need one endpoint per interface (that's where you have a chance to specify the class different from one given in a device descriptor) you can have 15 classes. You may want to take a look at the config descriptor of any modern non-smart phone, Bluetooth dongle, or a webcam - all of them are typically quite large and contain several classes.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ You can have up to 30 endpoints (15 in and 15 out), and the default (zero) control pipe endpoint can be used between multiple interfaces. And you don't actually need an endpoint for some interfaces. \$\endgroup\$
    – Passerby
    Commented Apr 6, 2015 at 4:02
  • \$\begingroup\$ There are devices that have a (virtual) hub to implement multiple USB device, but the ability to respond to multiple device numbers requires hardware support. \$\endgroup\$
    – CL.
    Commented Apr 6, 2015 at 8:45
1
\$\begingroup\$

Looking over the USB 2.0 spec, it seems that a composite device, aka a single device with multiple interfaces, would be limited by the number of interfaces in a single configuration.

enter image description here

Since bNumInterfaces is a size of 1 Byte, that means the theoretical limit is 255. Beyond practical.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.