2009-08-21 08:51 AM
Detecting USB connection status
2011-05-17 03:50 AM
Hi All,
I'm using a modified version the ST USB virtual com port firmware with some of Lanchon's VCOM incorporated also. What I need is way of knowing when there is a USB connection and when there is not. I'm having problems when USB is disconnected because when I try to send more data bad things happen. I have monitored bDeviceState but this does not help as it only changes state on a new connection -- it does not change on disconnection. I have also placed debug in many of the USB setup functions and again nothing happens on disconnection. How can I prevent problems due to sending data when there is no USB connection present? A solution where the data just gets dumped when no USB connection is acceptable. Thanks Trevor2011-05-17 03:50 AM
Hi Trevor, I´m just facing the same issue here.
How did you solve this problem? Thanks. Bruno2011-05-17 03:50 AM
Hi ,
You can refer to this FAQ : http://www.st.com/stonline/faq/faqview.php?ids=1230 The preferred way is to use a GPIO to detect Vbus Line( 5-volts) coming from the USB cable. Cheers, STOne-32. [ This message was edited by: STOne-32 on 21-08-2009 21:21 ]