|
From: <sch...@tw...> - 2017-12-01 16:01:24
|
Hello there again, Long story short: It worked when I adjusted the device GUID. For debugging/developing I always incremented the PID(hardware won't leave my Desk and I don't have to cope with cached driver installations.. I thought) But I did not change the WCID device GUID(found in FW USB Stack). I'm not sure why it broke in the first place. It's not a GUID that's listed in any of the System-defined Device setup Classes, but the default one I got with the Modification of the TI USB Stack. So. Maybe you could please help me and point me to something where I find out about these GUIDs. Or tell me if they are: -device-unique? -class-unique? -just arbitrary random numbers I can make of? Why did it break when I recycled the GUID on multiple different VID:PID combinations? On https://github.com/libusb/libusb/wiki/Windows it's only said that the device must have a GUID, but not whether I can recycle it. Thanks in advance From: sch...@tw... [mailto:sch...@tw...] Sent: Freitag, 1. Dezember 2017 12:15 To: 'lib...@li...' <lib...@li...> Subject: Composite WinUSB interface claim fails Hello There, I'm looking for some help in developing a libusb-application. I'm developing the Hardware as well as the software and require some more understanding of the libusb. I'm developing on WIN10. My current situation is following: I'm using a composite Device having winUSB attached to the first two interfaces, using WCID. (Next two interfaces are CDC Devices) They get reported as IF0/1 by USB tree Viewer. So I have to open interface 0/1 with libusb? The first attempt to open this device fails, as expected, because to being the composite parent, The second one succeeds. Claiming Interface 1 works(my application and xusb report no error on this) Claiming Interface 0 returns a -12(libusb_not_supported) error, xusb reports 6 Ifs being present(one more than expected) And fails on all except Interface 1. The Docs say that claiming is a purely logical operation, which means my firmware does not have to do anything with it. So I assume this is a Windows/libusb error I have to deal with. I was using libusb 1.0.20 when I somewhen found out that the composite device support is much better on 1.0.21. Now I'm using the github Version, compiled with MSVC2015(was just compiling fine - awesome) Could you please give me advice on how I can get fixed this? My current code is attached. bool deviceFound = false; int i = -1; while ((deviceFound == false) && ( (++i) < numDevices)) { dev = usbDevices[i]; libusb_get_device_descriptor(dev, &desc); if ((desc.idVendor == TIVA_USB_VID) & (desc.idProduct == TIVA_USB_PID)) { //Found some candidate; int tst = libusb_open(dev, &m_pUSB); //crashes, when being composite parent if ( tst > -1) { if (m_pUSB != NULL ) { deviceFound = true; this->setIdentifier(QString("XCD Bulk Pipe")); } } } }//End of while loop if(usbDevices) { libusb_free_device_list(usbDevices, 1); } } //Make the device available to this applicatrion; if(!retValue.containsError()) { int test = 0; //set default Configuration value; //detaching kernel drivers is mostly needed when interfaceing to HID Devices(especially on MAC OS and Linux m_autoDetach = (libusb_set_auto_detach_kernel_driver(m_pUSB, 1) == LIBUSB_SUCCESS) ; //Try setting Kernel detach; int val; status = libusb_get_configuration(m_pUSB, &val); status = libusb_set_configuration(m_pUSB, val); libusb_config_descriptor *config; status = libusb_get_config_descriptor(libusb_get_device(m_pUSB), 0, &config); status = libusb_claim_interface(m_pUSB, TIVA_INTERFACE_NUMBER); // -> FAILS ON IF0, SUCCEEDS on IF1 if (status < 0) { retValue += ito::RetVal(ito::retError, status, libusb_error_name(status)); } } |