|
From: Paul Q. <pa...@wo...> - 2018-05-30 15:51:57
|
Hi David. On Wed, 30 May 2018 at 16:31, David Grayson <dav...@gm...> wrote: > WinUSB works fine on composite devices and I've released several > products relying on this. I don't know what stumbling blocks you were > encountering but here is the driver for our latest composite WinUSB > device, which has WinUSB on interface 0, and two CDC ACM ports on > interfaces 1 through 4. That's interesting. Looking at your inf file I can't see much different to the way I have it set up, except that I'm using HID instead of CDC. In any case, for me if I call CreateFile on the composite device then WinUSB_Initialize() fails with code 8 "not enough storage is available to process this command". That's not unexpected as it's the composite driver. If I try to use SetupDiEnumDeviceInterfaces() on the child WinUSB device of the composite device (found using cfgmgr32) the list it returns is empty. I can't see any other way to get the Device Path needed for CreateFile(). I have tried with the WinUSB interface on interface 0 and on interface 1. I'll give libusbp a try. I noticed that you say having "DeviceInterfaceGUIDs" in the registry is a requirement for libusbp... Maybe this is the key to getting WinUSB working. WinUSB works fine without it on non-composite devices, but perhaps it's needed for composite. It isn't hard to add so I'll give it a try. > Maybe you already thought of this, but you would just need one command > to get each of those different device types into bootloader mode, and > then after that it could appear as a new non-composite device with one > native USB interface, and then you can use a richer set of commands to > actually operate on it as a bootloader. For example, for a CDC > device, you could connect to it and set the baud rate to some special > value as a signal to go into bootloader mode. Yes, that was the plan. It would just be nice to have a generic DFU tool that worked with everything on every platform, but due to limitations of libusb that may be tricky. At this point I'll settle for just DFU on Windows with composite devices. That was the reason for this patch, which fixes dfu-util on Windows: https://github.com/libusb/libusb/pull/398 Regards, Paul |