Virtual COM port device persists in device manager after hardware disconnect

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
antac_1095701
Level 1
Level 1

I have implemented a VCOM CDC device in my application. The virtual COM port is based on the usbtouart example code from Cypress. My FX3 code implements a composite device with 2 interfaces. One has the 3 endpoints associated with the VCOM port and the other has multiple endpoints associated with my bulk streaming application. There are 2 issues I am observing.

1) When the device is disconnected, the VCOM port persists in device manager? I would expect that the hardware disconnect would cause the host to recognize the device has left. I am guessing there is something not happening correctly in the disconnect routine in the FX3. Would someone please point me in the right direction?

2) This one is more complicated. I have been using the SUPERSPEED EXPLORER KIT as my primary testbed. In this case the VCOM port works as expected. I have another hardware set (it is a development board from Cesys and has an FX3 and FPGA on board together). This board brings up the VCOM port in device manager correctly but I am not seeing any output in the terminal on my host PC. I am routing debug messages over this virtual COM port so I am not able to see any debug messages that may be occurring. I can set the debug messages to flow through the physical UART RX/TX pins, but then I may be missing what is really causing the problem. Everything else about the application seems to work in both cases. Does anyone have ideas what may be different between these two cases such that device manager would enumerate (ie the driver works) but the VCOM port is active in one case but not the other? Would the clocking structure or PIB init have anything to do with the VCOM port?

Thanks in advance.

0 Likes
1 Solution
SrinathS_16
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

Hello,

1. When the VCOM device is removed when it is opened by any of the host applications (such as terminal), the device manager will not detect the device removal. This is because of the "persistent" feature implemented in the Cypress driver. Hence, the host application that uses the COM port must be closed before removing the device to identify the removal. Also, you can use the Microsoft provided CDC class driver which does not implement the "persistent" feature.

NOTE: The purpose of this feature is that the device does not change its COM port number when disconnected and re-connected with the terminal application open.

2. Please let us know if you are using the DMA channel between UART and USB of FX3 or are you sending debug messages from the CPU to USB over the DMA channel. Also, let us know if you are referring to any of the Cypress provided example firmware.

Best regards,

Srinath S

View solution in original post

0 Likes
3 Replies
SrinathS_16
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

Hello,

1. When the VCOM device is removed when it is opened by any of the host applications (such as terminal), the device manager will not detect the device removal. This is because of the "persistent" feature implemented in the Cypress driver. Hence, the host application that uses the COM port must be closed before removing the device to identify the removal. Also, you can use the Microsoft provided CDC class driver which does not implement the "persistent" feature.

NOTE: The purpose of this feature is that the device does not change its COM port number when disconnected and re-connected with the terminal application open.

2. Please let us know if you are using the DMA channel between UART and USB of FX3 or are you sending debug messages from the CPU to USB over the DMA channel. Also, let us know if you are referring to any of the Cypress provided example firmware.

Best regards,

Srinath S

0 Likes

Thank you for the explanation of the persistent driver. I have verified that if the terminal is disconnected from the COM port the device disappears in device manager. When the device is reconnected it is enumerated, sometimes with a different COM port number.

2) I am using the dma Channel between UART and USB. I am sending debug strings over this dma channel by overriding it and manually sending the buffer. See below. You helped me get this working in a separate thread.

CyU3PDmaChannelReset(&glChHandleUarttoUsb);

CyU3PDmaChannelSetupSendBuffer(&glChHandleUarttoUsb, glDebugDmaBuffer);

CyU3PBusyWait(100);

CyU3PDmaChannelSetXfer(&glChHandleUarttoUsb,0);

0 Likes

Hello,

- Please check if any of the APIs that you have mentioned is not returning CY_U3P_SUCCESS.

- Probe the USB lines using a protocol analyzer to check if there is any data transfer happening between FX3 and PC.

Best regards,

Srinath S

0 Likes