Phantom usb to serial port

My program speaks to various electronic devices through ftdi usb

to serial port

. On the hardware side, it can happen that the ftdi chip is broken by a short power off. If this happens, the software should reset the connection and continue talking to the device. This works fine while the power is off (>~0.5 s)

. If it's very short (for example <~0.1 s

), the reset connection is no longer possible for a few minutes. Every connection to a port fails with a message that the port is still in use. So, here's what I've tried so far:

Performing API ftdi teams FT_ResetDevice

, FT_CyclePort

and even FT_Rescan

and FT_Reload

does not help.

Disconnecting the device from USB and power and replacing it does not help. The port is still blocked.

Even when the USB cable is disconnected, the phantom port is still displayed in the Windows Device Manager. All attempts to connect to that port fail with the port usage message, no matter what program I use to connect to the port.

I could also reproduce the effect if the port was not open when the power failure occurred.

So far, the only action that has helped is restarting windows or waiting for a few minutes. Of course, this is not a viable option.

What I'm looking for is a way to reset the USB / serial port programmatically if it ended up in a phantom state. Perhaps this can be handled directly via the Windows API rather than the ftdi API.

+3


source to share





All Articles