How to reconnect a USB device under Windows

I have a FTDI-based USB device. Sometimes his driver gets stuck.

There are no problems on Linux - the device automatically shuts down and reconnects by default, and only the problem is the name of the device, which can be fixed using the udev rules.

Under the windows, when it is stuck, the flow of applications that does read() or write() at this point completely hangs. It cannot be killed by either TerminateThread or KillProcess .

The only way to kill the application is to physically disconnect the USB device.

Is there any way to release a software reconnect device that will fix the driver deadlock and allow you to reopen the port and continue working after?

The administrative rights application may have, if necessary.

+8
deadlock usb device-driver ftdi
source share
1 answer

I would suggest that you move your thinking one step further. You are trying to restart the USB device directly, why not try the hub?

I had a similar problem and I did:

 devcon remove *ROOT_HUB* && devcon rescan 

When connecting a USB device to a hub while hanging it.

Note This will remove all USB devices from the device manager and re-add them. You can use the wait or similarly to make devcon findall *ROOT_HUB* and remove either ROOT_HUB20 or ROOT_HUB30 as necessary.

+5
source share

All Articles