cancel
Showing results for 
Search instead for 
Did you mean: 

Virtual COM Port (Driver problem)

stefanzimmer9
Associate II
Posted on June 30, 2009 at 07:22

Virtual COM Port (Driver problem)

4 REPLIES 4
stefanzimmer9
Associate II
Posted on May 17, 2011 at 13:16

I made an application with a STM32F103RBT6 based on the USB Virtual COM port demo. On PC side the CDC driver release 1.1.0 is installed (which seems to be the microsoft virtual com port driver).

The communication works fine, but there is one problem:

If I disconnect the controller while the communication active (e.g. Reset-Button, power failure or maybe a watchdog reset) the connection will not work after a reconnection again.

Even the closing of the com port by the application or the restart of the application does not help.

The com port must not be opened by the application when the controlle restarts.

The following sequence works:

close the COM port of the application.

make a (second) restart of the microcontroller

open the COM port again.

The reason for this problem seems to be the microsoft driver USBSER.SYS.

Instead of restarting the controller the deactivation and reactivation of the virtual com port in the device manager helps, too. This is the reason why I think that the microsoft driver is the problem and not the controller application.

Does anybody know a solution for this problem, e.g. where to find a replacement for the driver USBSER.SYS that works better?

Thanks in advance

st3
Associate II
Posted on May 17, 2011 at 13:16

Quote:

The reason for this problem seems to be the microsoft driver USBSER.SYS.

Quite possibly - I have seen similar behaviour with other USB virtual COM ports... :(

But I wouldn't like to say whether it's actually the USBSER.SYS driver, or something lower, or even the application, or what...?

stefanzimmer9
Associate II
Posted on May 17, 2011 at 13:16

st7, Thank you for the answer.

I made an additional test. With hyperterminal (I know, not the ''best'' terminal program) and with ZOC the problem is the same. The only difference to the application is, that this programs send an error message, that the com port cannot be opened, when I close it and try to re-open it after the described communication failure.

So the application seems to be not the problem.

cpryor
Associate II
Posted on May 17, 2011 at 13:16

Hello,

i do have the same problem. After resetting the device, he will again connect the virtual com port. But the old file handle, i have is invalid, so no communication is possible. If I new close this invalid handle, he will delete the new com port from registry. You can see what happen in:

HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM

Only resetting again the device and recreate a new virtual com port will help.

The problem is the driver. He will terminate new COM port if a close old handle.

I can not find out, if there was a reset. No events. No errors. Nothing.

Even if i know, there was a reset. After closing my programm or the file handle, he will terminate the new port.

Can i use different virtual com port driver? like from profolic or FTDI

Thanks.

Edit:

Same Problem:

http://forums.techarena.in/windows-device-drivers/493811.htm

Or here:

I'm currently working with an AVR32 UC3 device with builtin USB. The CDC example from Atmel works fine. But the problem is: if you reset the microcontroller while a Windows application is accessing the virtual com port, you will have to restart your application to regain access to this port! With the FTDI converters you simply close() and open() the port from within your application and it works again! It seems that the usbser.sys from MS isn't written with much effort...

http://www.embeddedrelated.com/groups/AT91SAM/show/1763.php