Question
USB virtual COM port hot plug problem
Posted on October 17, 2012 at 16:58
Hi,
I have a problem while developing a USB-to-serial device and I am looking for a solution.I successfully implemented a USB virtual COM port on STM32F407 microcontroller. I can send and receive data to/from the computer via hyperterminal program perfectly using the generic virtual COM driver provided by Windows 7. However, if I unplug the USB cable while Hyperterminal is still in ''connected'' state, the communication cannot be established when I plug it back. To resume the communication, I have to 1. disconnect Hyperterminal, 2. unplug USB cable, 3. plug it back again and then 4. connect Hyperterminal.To clarify the situation I am in, here are two senarios:Senario 1:- plug USB cable- connect Hyperterminal- communication established successfully and worked well- disconnect Hyperminal- unplug USB cable- plug USB cable back - connect Hyperterminal- communication established successfully and worked wellSenario 2:- plug USB cable- connect Hyperterminal- communication established successfully and worked well- unplug USB cable- plug USB cable back - Hyperminal not working (but Windows device manager sees the disappearance and reappearance of the virtual COM port)- disconnect Hyperminal- connect Hyperterminal (FAIL! Hyperterminal cannot connect to this virtual COM port even if device manager has it in the COM port list)- unplug USB cable (now Hyperterminal is in disconnected state)- plug USB cable- connect Hyperterminal- communication established successfully and worked wellI captured the USB traffic with SourceUSB and found that when I tried to disconnect Hyperterminal in Senario 2, it said ''No such device''.Any suggestions are appreciated! Thanks!Shuozhi