I have a custom composite USB device with usbser, winusb, usbstor interfaces.
We have a few hundred devices running for three ish years now, with billions of libusb operations. (Thanks folks!) on win7,8,10.
We have a few hundred devices running for three ish years now, with billions of libusb operations. (Thanks folks!) on win7,8,10.
If you are porting a libusb 0.1.x based program from Unix style systems to Windows, please take note that libusb-win32 differentiates IN Endpoints and OUT Endpoints. So IN Endpoint 1 is 0x81 and OUT Endpoint 1 is 0x01. One more difference is that you need to call usbsetconfiguration before usbclaiminterface. This is especially for the. Sep 18, 2019 libusb-win32 is a port of libusb-0.1 under Windows Brought to you by: donpedro2, stemeyer, trobinso, xiaofanc.
Libusb-win32 Install Windows 10
The unit has a feature in which I send a command to the winusb interface to reconfigure it's usb serial#.
The device soft disconnects from the USB bus, changes part of it's descriptor (the serial number), waits 500ms (or 2seconds, doesn't help the issue) and then reconnects.
Under windows 7, and the virus known as windows 8, this works fine.
Under windows 10, I get a duplicate entry of the old device in my libusb_get_device_list structure.
The device soft disconnects from the USB bus, changes part of it's descriptor (the serial number), waits 500ms (or 2seconds, doesn't help the issue) and then reconnects.
Under windows 7, and the virus known as windows 8, this works fine.
Under windows 10, I get a duplicate entry of the old device in my libusb_get_device_list structure.
Below is a data dump. I have libusb debugging turned on (hence the first 3 lines)
The first line (VID 046D) is a USB flash drive that was unplugged during a PRIOR power cycle of the box. Where or why libusb is complaining about this device is a mystery to me. At the same time it may likely be a clue to the what is going on.
Using usbdview, all 3 errant devices are not present.
The first line (VID 046D) is a USB flash drive that was unplugged during a PRIOR power cycle of the box. Where or why libusb is complaining about this device is a mystery to me. At the same time it may likely be a clue to the what is going on.
Using usbdview, all 3 errant devices are not present.
The second 2 lines (VID 2B2A) refer to the winusb and msc interfaces on my composite device, and the parent id of 17AD5DBB is the old parent from the previous enumeration of my device. (with the old serial number). 2B2A is a private USB VID.
Finally, the 0), 1), 2), is a simple crawl of the libusb_get_device_list with libusb_get_devicedescriptor
There should be only one VID 2B2A in this list (as there is on win7/8); there is only 1 device attached to the PC.
There should be only one VID 2B2A in this list (as there is on win7/8); there is only 1 device attached to the PC.
If I reboot, there is in fact only 1 device present, and things work. However, rebooting isn't really an option for the actual use case of the product. (but I still get the gripe about the USB flash drive)
libusb: error [init_device] device '.USB#VID_046D&PID_C080&MI_01#6&33F61665&0&0001' is no longer connected!
libusb: error [init_device] device '.USB#VID_2B2A&PID_0156&MI_02#6&17AD5DBB&1&0002' is no longer connected!
libusb: error [init_device] device '.USB#VID_2B2A&PID_0156&MI_03#6&17AD5DBB&1&0003' is no longer connected!
libusb: error [init_device] device '.USB#VID_2B2A&PID_0156&MI_02#6&17AD5DBB&1&0002' is no longer connected!
libusb: error [init_device] device '.USB#VID_2B2A&PID_0156&MI_03#6&17AD5DBB&1&0003' is no longer connected!
Libusb-win32 Windows 10 Signed
- VID 1B21 PID 1242 CLS 0000 PROT 00
- VID 1B1C PID 1B15 CLS 0000 PROT 00
- VID 1B1C PID 1B15 CLS 0000 PROT 00
- VID 046D PID C080 CLS 0000 PROT 00
- VID 2B2A PID 0156 CLS 00EF PROT 01
- VID 2B2A PID 0156 CLS 00EF PROT 01
- VID 8086 PID A12F CLS 0000 PROT 00
Libusb For Windows
Any suggestions are welcome. I unload libusb as soon as possible after firing off the call that causes the disconnect/modification of the serial number/reconnect. I am confident that I have unloaded the libusb default context, closed libusb, and exited my program before the USB endpoint device performs the soft-disconnect.
The errant behavior happens on 3 different windows 10 Pro boxes. In all cases, the device is connected to the root hub embedded in the Intel chipset. (USB xHCI )
The errant behavior happens on 3 different windows 10 Pro boxes. In all cases, the device is connected to the root hub embedded in the Intel chipset. (USB xHCI )
-Steve