cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Virtual COM port STM32

seriouserg
Associate II
Posted on March 23, 2009 at 07:54

Multiple Virtual COM port STM32

15 REPLIES 15
seriouserg
Associate II
Posted on May 17, 2011 at 13:06

Anybody know, it is possible or not?

How to create it from base sample ''STM32 Virtual COM''

brunoalltest
Associate II
Posted on May 17, 2011 at 13:06

I think it´s possible, but you will have a lot of work to do.

I´m trying to do a similar thing with an audio device. Windows is already enumareting it correctly but the second interface isn´t working yet.

Beside the descriptors, I´ve got to change the xxx_Get_Interface_Setting() function to get the second interface to enumerate.

[ This message was edited by: brunoalltest on 18-03-2009 04:29 ]

seriouserg
Associate II
Posted on May 17, 2011 at 13:06

Can I see your sources? (descriptors section)

seriouserg
Associate II
Posted on May 17, 2011 at 13:06

Thank you. I tryed it.

May be, ''device'' should have its own descriptors.

This - ''Virtual_Com_Port_DeviceDescriptor'', and this - ''Virtual_Com_Port_ConfigDescriptor'' ?

I find this:

 

void USB_Init(void)

 

{

 

pInformation = &Device_Info;

 

pInformation->ControlState = 2;

 

pProperty = &Device_Property;

 

pUser_Standard_Requests = &User_Standard_Requests;

 

/* Initialize devices one by one */

 

pProperty->Init();

 

}

 

Look at comment. What do you think about it? May be, that my suggestion is true?

There are some difficulties... What about endp0, that can be only single, and deny any sharing between devices.

brunoalltest
Associate II
Posted on May 17, 2011 at 13:06

My single device project is avaible on the topic

http://www.st.com/mcu/forums-cat-8010-23.html

My multiple device project isn´t working the way I want yet. I prefer not to to share until it´s working.

About the configuration descriptors. For one audio device it was:

->Configuration Descriptor:

-->Interface Descriptor:

--->Audio Control Interface Header Descriptor:

---->Audio Control Input Terminal Descriptor:

----->Audio Control Feature Unit Descriptor:

---->Audio Control Output Terminal Descriptor:

---->Interface Descriptor:

---->Interface Descriptor:

----->Audio Streaming Class Specific Interface Descriptor:

------>Audio Streaming Format Type Descriptor:

----->Endpoint Descriptor:

------>Audio Streaming Class Specific Audio Data Endpoint Descriptor:

And now for two audio devices it is:

->Configuration Descriptor:

-->Interface Descriptor:

--->Audio Control Interface Header Descriptor:

---->Audio Control Input Terminal Descriptor:

----->Audio Control Feature Unit Descriptor:

---->Audio Control Output Terminal Descriptor:

---->Interface Descriptor:

---->Interface Descriptor:

----->Audio Streaming Class Specific Interface Descriptor:

------>Audio Streaming Format Type Descriptor:

----->Endpoint Descriptor:

------>Audio Streaming Class Specific Audio Data Endpoint Descriptor:

-->Interface Descriptor:

--->Audio Control Interface Header Descriptor:

---->Audio Control Input Terminal Descriptor:

----->Audio Control Feature Unit Descriptor:

---->Audio Control Output Terminal Descriptor:

---->Interface Descriptor:

---->Interface Descriptor:

------>Audio Streaming Class Specific Interface Descriptor:

------->Audio Streaming Format Type Descriptor:

----->Endpoint Descriptor:

------>Audio Streaming Class Specific Audio Data Endpoint Descriptor:

brunoalltest
Associate II
Posted on May 17, 2011 at 13:06

USB Composite Devices have only one Device Descriptor and the application(and Class) is specified on Configuration Descriptor.

So the bDeviceClass, bDeviceSubClass and bDeviceProtocol of the Device Descriptor are all set to 0x00.

The audio example I´ve working on came this way, but I´ve just looked the Serial Port Example descriptors(attached) and the bDeviceClass of the Device Descriptor is set to 0x02 (CDC).

I don´t know if the CDC class need it to be defined on the Device Descriptor or it was decision of the ST Applicaton Team. You should check the usb.org documents or

http://https://www.usb.org/phpbb/

.

I´ve remembered that my USB JTAG DEBUGGER(Olimex ARM-USB-TINY) is a composite device and has a Virtual Comport and decided to check its descriptors(attached) on

http://www.ftdichip.com/Resources/Utilities/usbview.zip

and USBlyzer.

It don´t use the CDC class anywhere. It uses two Vendor-Specifc interfaces(bDeviceClass=0xFF) on the Configuration Descriptor, which means writing your own drivers.

So... I don´t think you will get multiple serial with bDeviceClass set 0x02 in the Device Descripotr as in the ST example (maybe I´m wrong).

And if bDeviceClass=0x02 in the Device Descriptor is a must for CDC class, it probably won´t be possible to have multiple serial based on the CDC class. (maybe wrong too).

But if I´m right and I think I am... it´s only possible to have multiple seriall using Vendor-Specific class on the interfaces and custom drivers on your Operating System. And that´s painful.

-----------

About the pProperty->Init(), it´s just a indirect call to Speaker_init().

Regarding enumeration, there´s nothing to change there.

[ This message was edited by: brunoalltest on 19-03-2009 04:31 ]

[ This message was edited by: brunoalltest on 19-03-2009 04:35 ]

brunoalltest
Associate II
Posted on May 17, 2011 at 13:06

Found something.

Check

http://www.usb.org/phpbb/viewtopic.php?t=13308

, option 4.

seriouserg
Associate II
Posted on May 17, 2011 at 13:06

Cognitive... Thanks!

I tryed to use bDeviceClass, bDeviceSubClass and bDeviceProtocol 0x00.

OS detect my hardware as composite device, but catastrophic crash happend if use ''usbser.sys''. My config in attach.

I read usb.org forum, but no information found about twice CDC (exactly Virtual COM).

Somewhere I found information, that usbser.sys not support multiple CDC, and I think nothing.. because WDM and driver development is ''dark wood'' for me...

seriouserg
Associate II
Posted on May 17, 2011 at 13:06

See that about IAD, and how to add it I dont know.

Now I try to read and understand monster USB specification about this.