![]() |
![]() |
|
|||||||
| Register | Forum Rules | Getting Started! - Guide | Blog | Videos | Gallery | Members List | Social Groups | Mark Forums Read |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 |
|
Guest
Posts: n/a
|
Implementing Multiple CDCs
Dear All,
I'm a novice in the USB world, and appreciate if you can answer my questions and/or give me some suggestions. I'm working on an ARM-based board. The ARM processor has an internal USB controller (USB device not USB host), which can support upto six endpoints. What I want to do is to implement at least three CDC devices so that when the board is connected to a USB port on PC (probably running windows 2000 or XP, but I can't assume that it is always XP and supports IADs), three different virtual com ports are added (those three serial ports are used to communicate with three different modules on the board and should be independent from each other). For this stage, the speed is not an issue. I have the following questions: 1. If I go with implementing a USB composite device, my understanding of CDC devices, is that each requires at least two bulk endpoints (in and out) and we need a shared controlling end point (endpoint 0), so overally we need 7 endpoints, there is an interrupt type endpoint for each CDC device, that is used for event notification which seems to be optional. Are the above assumptions correct ? 2. If I go with compound USB device. I need a usb hub controller, but the board doesn't have any space for adding more hardware. My understanding from a hub controller is that it is another USB device when it is viewed from the upper usb host. So, can I implement a minimal hub in FW using the six available endpoints, and then add more code for virtual CDC devices ? I don't know why, but whenever I've seen the recommendations for building a compound usb device, they say that a usb hub controller hardware is required, I don't see why I can't implement it in software. 3. Currently I have a working implementation of CDC-ACM device. When I was reading the cdc document from (http://www.usb.org/developers/devcla.../usbcdc11.pdf), I noticed that I can implement a multi-channel control model (subclass 4) or CAPI control model (subclass 5). My understanding from these devices is that I can still have independent serial data streams between my device and usb host over a fewer number of endpoints. Is the above reasoning correct ? 3.1. Are there any built-in windows drivers for the multi-channel or CAPI types ? I prefer to stay away from driver implementation as much as possible. 3.2. If the answer to 3.1 is yes, is it possible to identify those devices as independent virtual com ports in windows ? If not, what is the procedure to send/receive data to a particular stream ? Thank you so much in advance for your help. |
|
|
|
#2 |
|
Guest
Posts: n/a
|
RE: Implementing Multiple CDCs
Can you tell what is your real goal:
emulate certain device types that have in-box Windows drivers, or create your own aplication to talk to your very special device? In the latter case, you can try WinUSB based solution and avoid writing drivers. WinUSB is part of the latest WDK. --PA "Hapary" wrote: > Dear All, > > I'm a novice in the USB world, and appreciate if you can answer my > questions and/or give me some suggestions. > > I'm working on an ARM-based board. The ARM processor has an internal > USB controller (USB device not USB host), which can support upto six > endpoints. > > What I want to do is to implement at least three CDC devices so that > when the board is connected to a USB port on PC (probably running > windows 2000 or XP, but I can't assume that it is always XP and > supports IADs), three different virtual com ports are added (those > three serial ports are used to communicate with three different modules > on the board and should be independent from each other). For this > stage, the speed is not an issue. > > I have the following questions: > > 1. If I go with implementing a USB composite device, my understanding > of CDC devices, is that each requires at least two bulk endpoints (in > and out) and we need a shared controlling end point (endpoint 0), so > overally we need 7 endpoints, there is an interrupt type endpoint for > each CDC device, that is used for event notification which seems to be > optional. Are the above assumptions correct ? > > 2. If I go with compound USB device. I need a usb hub controller, but > the board doesn't have any space for adding more hardware. My > understanding from a hub controller is that it is another USB device > when it is viewed from the upper usb host. So, can I implement a > minimal hub in FW using the six available endpoints, and then add more > code for virtual CDC devices ? I don't know why, but whenever I've seen > the recommendations for building a compound usb device, they say that a > usb hub controller hardware is required, I don't see why I can't > implement it in software. > > 3. Currently I have a working implementation of CDC-ACM device. When I > was reading the cdc document from > (http://www.usb.org/developers/devcla.../usbcdc11.pdf), I noticed > that I can implement a multi-channel control model (subclass 4) or CAPI > control model (subclass 5). My understanding from these devices is that > I can still have independent serial data streams between my device and > usb host over a fewer number of endpoints. Is the above reasoning > correct ? > > 3.1. Are there any built-in windows drivers for the multi-channel or > CAPI types ? I prefer to stay away from driver implementation as much > as possible. > > 3.2. If the answer to 3.1 is yes, is it possible to identify those > devices as independent virtual com ports in windows ? If not, what is > the procedure to send/receive data to a particular stream ? > > Thank you so much in advance for your help. > > |
|
|
|
#3 |
|
Guest
Posts: n/a
|
Re: Implementing Multiple CDCs
Hi there, Thanks for your reply. Maybe I wasn't clear enough about what I'm trying to do. My ultimate goal is using/writing a driver in the windows side, such that, when my usb device is connected to the PC, three COM ports are added. There are some applications running on the PC side that each requires sending/receiving data to a certain COM port independently from the others. I have enough freedom on the external device to define the device type/class/... and multiplex the data from three sources with any required protocol. I checked WinUSB, but it seems that it is only available on Vista (and probably windows XP), but my device might be connected to windows 2000 boxes as well. Regads, Pavel A. wrote: > Can you tell what is your real goal: > emulate certain device types that have in-box Windows drivers, or > create your own aplication to talk to your very special device? > > In the latter case, you can try WinUSB based solution and avoid > writing drivers. WinUSB is part of the latest WDK. > > --PA > > > "Hapary" wrote: > > Dear All, > > > > I'm a novice in the USB world, and appreciate if you can answer my > > questions and/or give me some suggestions. > > > > I'm working on an ARM-based board. The ARM processor has an internal > > USB controller (USB device not USB host), which can support upto six > > endpoints. > > > > What I want to do is to implement at least three CDC devices so that > > when the board is connected to a USB port on PC (probably running > > windows 2000 or XP, but I can't assume that it is always XP and > > supports IADs), three different virtual com ports are added (those > > three serial ports are used to communicate with three different modules > > on the board and should be independent from each other). For this > > stage, the speed is not an issue. > > > > I have the following questions: > > > > 1. If I go with implementing a USB composite device, my understanding > > of CDC devices, is that each requires at least two bulk endpoints (in > > and out) and we need a shared controlling end point (endpoint 0), so > > overally we need 7 endpoints, there is an interrupt type endpoint for > > each CDC device, that is used for event notification which seems to be > > optional. Are the above assumptions correct ? > > > > 2. If I go with compound USB device. I need a usb hub controller, but > > the board doesn't have any space for adding more hardware. My > > understanding from a hub controller is that it is another USB device > > when it is viewed from the upper usb host. So, can I implement a > > minimal hub in FW using the six available endpoints, and then add more > > code for virtual CDC devices ? I don't know why, but whenever I've seen > > the recommendations for building a compound usb device, they say that a > > usb hub controller hardware is required, I don't see why I can't > > implement it in software. > > > > 3. Currently I have a working implementation of CDC-ACM device. When I > > was reading the cdc document from > > (http://www.usb.org/developers/devcla.../usbcdc11.pdf), I noticed > > that I can implement a multi-channel control model (subclass 4) or CAPI > > control model (subclass 5). My understanding from these devices is that > > I can still have independent serial data streams between my device and > > usb host over a fewer number of endpoints. Is the above reasoning > > correct ? > > > > 3.1. Are there any built-in windows drivers for the multi-channel or > > CAPI types ? I prefer to stay away from driver implementation as much > > as possible. > > > > 3.2. If the answer to 3.1 is yes, is it possible to identify those > > devices as independent virtual com ports in windows ? If not, what is > > the procedure to send/receive data to a particular stream ? > > > > Thank you so much in advance for your help. > > > > |
|
|
|
#4 |
|
Guest
Posts: n/a
|
Re: Implementing Multiple CDCs
Hapary wrote:
> My ultimate goal is using/writing a driver in the windows side, such > that, when my usb device is connected to the PC, three COM ports are > added. There are some applications running on the PC side that each > requires sending/receiving data to a certain COM port independently > from the others. I have enough freedom on the external device to define > the device type/class/... and multiplex the data from three sources > with any required protocol. It sounds like what you want is a composite device with three interfaces. Each interface will have two bulk and (maybe) one interrupt endpoint. Then you load the generic parent on top of that device (which can be done automatically if you tweak your device and config descriptors appropriately), and then load some sort of USB <==> serial driver (maybe usbser.sys, or your own creation, say, in KMDF) on top of the three child devices. |
|
|
|
#5 |
|
Guest
Posts: n/a
|
Re: Implementing Multiple CDCs
Hi there,
Thanks for your reply. I've already thought about implementing a composite device but there are a few problems: 1. Each CDC requires two interfaces, so for three CDCs we need to define 6 interfaces, but in order to tell the driver how to combine the relevant interfaces together, I have to use IADs, but IADs are only supported in Win XP SP2 and Vista (while the device might be connected to a Win 2K box). 2. Even if there is a work around for the above problem, I need at least, 7 end points (3 bulk-in, 3 bulk out and the end point 0 which is used for control), while I have only 6. I've already found an example with source code that uses the same idea: http://www.standardics.nxp.com/suppo...df/an10420.pdf http://www.standardics.nxp.com/suppo...pc214x.usb.zip But it requires writing a device driver. I'm looking into some way to implement this using the built-in windows drivers (does windows have a driver for multi-port serial devices, if yes, can anybody point me to some references about them). Bests, chris.aseltine@gmail.com wrote: > Hapary wrote: > > > My ultimate goal is using/writing a driver in the windows side, such > > that, when my usb device is connected to the PC, three COM ports are > > added. There are some applications running on the PC side that each > > requires sending/receiving data to a certain COM port independently > > from the others. I have enough freedom on the external device to define > > the device type/class/... and multiplex the data from three sources > > with any required protocol. > > It sounds like what you want is a composite device with three > interfaces. Each interface will have two bulk and (maybe) one > interrupt endpoint. > > Then you load the generic parent on top of that device (which can be > done automatically if you tweak your device and config descriptors > appropriately), and then load some sort of USB <==> serial driver > (maybe usbser.sys, or your own creation, say, in KMDF) on top of the > three child devices. |
|
|
|
#6 |
|
Guest
Posts: n/a
|
Re: Implementing Multiple CDCs
Hapary wrote:
> 1. Each CDC requires two interfaces, so for three CDCs we need to > define 6 interfaces, but in order to tell the driver how to combine the > relevant interfaces together, I have to use IADs, but IADs are only > supported in Win XP SP2 and Vista (while the device might be connected > to a Win 2K box). Again, what I'm suggesting you do is put all three endpoints under one interface. Then the generic parent will not be confused. I think usbser.sys understands this configuration, but I'm not sure. (Plus, there's a KB article saying usbser doesn't play nice with IADs anyway). The alternative is to use split interfaces and then write your own generic parent. > 2. Even if there is a work around for the above problem, I need at > least, 7 end points (3 bulk-in, 3 bulk out and the end point 0 which is > used for control), while I have only 6. Does endpoint zero really "count" in this manner? I would think not, but don't really know. |
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
< Home - Windows Help - MS Office Help - Hardware Support >
| New To Site? | Need Help? |