USB firmware programming

Hi there,

I'm trying to programme a USB to behave like a mass storage device and network unit (rndis) as the same time (only one usb port), i mean, when plug it to a windows PC i would like to see two new devices plugged. Th only way i've found is to show the usb like a hub with virtual unit connected to it, all handled by software. Does anyone knows another way?

Thank you!!

Reply to
hectorhg
Loading thread data ...

Isn't it simply a matter of enumerating with two configurations, each of which enumerates to the two devices you described?

JJS

Reply to
John Speth

It is possible to have multiple configurations, but the host selects only one of them to be active at any given time.

According to USB spec 2.0, section 5.2.3:

"Multiple functions may be packaged together in what appears to be a single physical device. For example, a keyboard and a trackball might be combined in a single package. Inside the package, the individual functions are permanently attached to a hub and it is the internal hub that is connected to the USB. When multiple functions are combined with a hub in a single package, they are referred to as a compound device."

Reply to
Arlet Ottens

You need to present your USB device as a composite device, that is your (USB) configuration exposes the mass storage and RNDIS interface descriptors. So:

Configuration / | \ | | | I/F MSC I/F CDC Control I/C CDC Data

A hub with a device (permanently) attached to one of its ports is a compound device.

Andrew

Reply to
Andrew Jackson

I think a cannot use two configurations, because in order to use rndis have to select a device descriptor, and for masss storage another one that's why i thought it wasn´t possible. How do i present my device as composite device? i couldn't find any device descriptor for that although have read something about them ( maybe i have skipped it by error....).

Thanks to all of you!!!!

and a

i

The

way?

Reply to
hectorhg

I think a cannot use two configurations, because in order to use rndis have to select a device descriptor, and for masss storage another one that's why i thought it wasn´t possible. How do i present my device as composite device? i couldn't find any device descriptor for that although have read something about them ( maybe i have skipped it by error....).

Thanks to all of you!!!!

and a

i

The

way?

Reply to
hectorhg

I've read a little more about composite devices, do you mean that jus adding a new interface to my CDC device with mass storage class should b enough?? will the PC detect it? Is it not necessary a special devic descriptor to represent that, or a protocol, subclass or whatever??

Thank you again.

Reply to
hectorhg

I've read a little more about composite devices, do you mean that jus adding a new interface to my CDC device with mass storage class should b enough?? will the PC detect it? Is it not necessary a special devic descriptor to represent that, or a protocol, subclass or whatever??

Thank you again.

Reply to
hectorhg

Your device descriptor would need to look something like:

Device class 0 Device subclass 0 Device protocol 0

Then you'd have three interface descriptors:

(CDC Abstract Control) Interface class 0x02 Interface subclass 0x02 Interface protocol 0xff (CDC Data) Interface class 0x0a Interface subclass 0x00 Intterface protocol 0x00 (MSC - not values depend on your implementation) Interface class 0x08 Interface subclass 0x06 Interface protocol 0x50

You may need an Interface Association Descriptor to bind the CDC interfaces together.

Andrew

Reply to
Andrew Jackson

Thank you very much. I think that an IAD interface will be necessary sinc data class and CDC class "work" as one (as far as i know, both interfac are intended for the same device, so they should be binded in som way...).

Thank you again, you have helped me a lot

be

Reply to
hectorhg

Please do not top-post. Your answer belongs after (or intermixed with) the quoted material to which you reply, after snipping all irrelevant material. See the following links:

(taming google)

--
 [mail]: Chuck F (cbfalconer at maineline dot net) 
 [page]: 
            Try the download section.


** Posted from http://www.teranews.com **
Reply to
CBFalconer

That should work, but on xp at least it doesn't. I've tried everything can think of, and it seems that if the DeviceClass is not 0x02 then th RNDIS driver will fail to start.

If you change the DeviceClass to 0x02 then RNDIS starts but window doesn't try to load the mass storage driver.

If you then move your ms interface descriptor to be first, then mas storage works but windows doesn't try to load the RNDIS driver.

So it seems that on XP your choice is RNDIS or mass storage, but not both I'd sure like to find a way to get around that (without writing a custo driver).

Reply to
gjm

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.