USB Device Multiple Functions

Hi All!

At first I apologize for my silly questions but I am new in driver development. I allready wrote very “small drivers” on Windows and Linux system, but I can’t say the I’m familiar with this.

So my problem is that I want a driver for my USB device. Going threw the documents from the MSDN I decide to choose WINUSB instead of making a new driver.

My problem is that my device has two functions: responds for the incoming commands (not a big deal some calculations, …) but also has an SD Card which stores information which I want to make accessible for the users.

My question is the WINUSB can supply both of the functions of the device.
It’s enough to make the .inf file similar to provide this two interface or what is the trick.

Thanks,
Platini

Pls find the paper on MSDN
How to Use WinUSB to Communicate with a USB Device

Communication with the device is one thing and using the SD card like a mass-storage is another thing.
And I don’t know, how to to do both of them.

You are looking to do a composite device.
In your .inf file, where you do USB\VID_AAAA&PID_BBBB add &MI_##, where

is the interface number.

I do this between mass storage, my own custom driver, and HID. Works nicely.

James

On 7/17/2012 8:35 AM, xxxxx@yahoo.com wrote:

Communication with the device is one thing and using the SD card like a mass-storage is another thing.
And I don’t know, how to to do both of them.

xxxxx@yahoo.com wrote:

So my problem is that I want a driver for my USB device. Going threw the documents from the MSDN I decide to choose WINUSB instead of making a new driver.

My problem is that my device has two functions: responds for the incoming commands (not a big deal some calculations, …) but also has an SD Card which stores information which I want to make accessible for the users.

My question is the WINUSB can supply both of the functions of the device.
It’s enough to make the .inf file similar to provide this two interface or what is the trick.

Does your device has two interfaces, one for each “function”? If so,
that’s easy. Windows assigns a different driver to each function, so
you could attach WinUSB to your command function, and let the standard
USB Storage Class driver handle your SD card.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

So it is possible? Let’s say It is possible to copy something to the SDCard and meanwhile also I query some information from my device?

xxxxx@yahoo.com wrote:

So it is possible? Let’s say It is possible to copy something to the SDCard and meanwhile also I query some information from my device?

I answered this question yesterday. Did you read that answer?

If your device has two interfaces (one mass storage, one custom), then
the system will load two different drivers, one for each interface. The
two drivers operate independently. Each one will talk to its own endpoints.

Is that what you want to do?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Yes.

Thank you Tim.

Can you provide me a documentation about the making the .inf file. Searching through the net I didn’t find an example which is similar to my problem. (I saw .inf for composite devices, but somehow still is not clear for me)

Regards,
Michel

xxxxx@yahoo.com wrote:

Can you provide me a documentation about the making the .inf file. Searching through the net I didn’t find an example which is similar to my problem. (I saw .inf for composite devices, but somehow still is not clear for me)

In this whole exchange, you have never told what your hardware actually
looks like. I have been repeating “**IF** your hardware has multiple
interfaces”, but you’ve never confirmed that.

So, DO you actually have one interface that is a standard USB Mass
Storage device, and another interface that is a custom device? If so,
here’s your solution. You do not need an INF for the composite device.
The operating system will handle that. You do not need an INF for the
mass storage interface. The operating system will handle that. For
your custom interface, if I were you, I would use WinUSB. There are
sample INF files that show how to write an INF file to load USB. Once
you do that, you can access your device using WinUSB functions from a
normal user-mode program.

In your INF, when you want to match only one particular interface, you
use MI. So, your device ID might be VID_1234&PID_5678&MI_01 for
interface #1.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.