cancel
Showing results for 
Search instead for 
Did you mean: 

STM3210C_Eval VCP_Demo project failure to open comport

stst9188
Associate
Posted on August 06, 2011 at 18:08

Hi seems I am haveing problem no body ever had before!!!

PLEASE HELP !!!!!!!

Using board STM3210C_EVAL , Compiling VCP Demo project for STM3210C_EVAL board (no modifications made to originaly downloaded code)

Latest driver for Virtual comport is installed   1.3.1.0.

Problem looks same on  5 PC running XP and Vista

Problem looks like this!!!

a) Plugging USB cable to PC.

b) Virtual com port detected and all is fine in device manager and com port is open with no problem.

 com port can be open and closed as many times as needed until  microcontroler reset or usb cable disconnect and reconnect.

a) After disconnect of usb cable or and reconnect  

b) port is detected  and displayed in device manager

all apears to be normal  but opening com port returns error

and it will be not possible to open port until  next reset or usb cable plug unplug

2 REPLIES 2
tbenson
Associate II
Posted on August 08, 2011 at 21:08

I have been fighting this exact issue with a different USB stack. The problem, I have found, lies with the usbser.sys file that is used by the vcp driver. If the device is disconnected while the port is open, then the port must be closed before the device is connected again.

I was able to work around it by checking for the windows message WM_DEVICECHANGE and the DBT_DEVNODES_CHANGED event. Anytime this is received I close the port (if opened). This seems to work, but is very kludgy. I used this as an example: http://msdn.microsoft.com/en-us/library/aa363432%28v=VS.85%29.aspx
vikas_sinha75
Associate II
Posted on August 30, 2011 at 07:04

Hi,

I am also working on the same EVAL-Board. The problem raised by you occurs when we Resets or connect /disconnect USB cable while Hyper terminal is still open (connection is not closed).

The proper way to do this is that before resetting the USB we have to first disconnect the establised connection and then Reset the USB, now it will work fine while establishing new connection. Or we can close the Hyper terminal befor resetting the device and then start it again. But the first way seems to be easy as it avoids reopening hyperterminal program.

Hope it will answer your query

Regards