cancel
Showing results for 
Search instead for 
Did you mean: 

COM port disconnect from USB way to know it STM32F205

Barbie
Associate II
Posted on November 17, 2014 at 07:29

I use today the USB OTG with ST example stm32_vcp_1.3.1.

I want to know if there a way to know that a connection I made with teh PC by openning COM port close.

I use today the function  

DCD_OTG_ISR(USB_OTG_CORE_HANDLE *pdev)

 but it only tell me whne a phisical connection was remove.

Thanks

Bar.

#stm32f205-usb-otg-stm32_vcp_1.3.
2 REPLIES 2
chen
Associate II
Posted on November 17, 2014 at 11:44

Hi

I do not think there is any way to tell on a USB CDC device if the host VirtualCOM port has been closed.

''I use today the function  

DCD_OTG_ISR(USB_OTG_CORE_HANDLE *pdev)

 but it only tell me whne a phisical connection was remove.''

Yes, that is correct. The USB device can tell if it has been unplugged.

A way you will be able to tell is to implement a message protocol that includes a 'ping' and detect if the 'ping' stops.

Posted on January 29, 2015 at 17:14

Hi Strauss,

If I have well understood your query, you need to know when user opens/closes the com port? If so, this is possible from USB point of view but host terminal dependent.

Which terminal are you using ?

Note that with some terminal, it may be impossible to report com port open/close events.

With regards,