|
From: David G. <dav...@gm...> - 2018-05-30 16:10:12
|
I think you need the DeviceInterfaceGUIDs key in the registry (which
can be generated from your INF file). The WinUSB driver looks in the
registry, gets the GUID, and then creates a file thing with that GUID
as part of the name. The name will be something like this (note the
GUID at the end):
\\\\?\\usb#vid_1ffb&pid_da01&mi_00#6&11a23516&18&0000#{99c4bbb0-e925-4397-afee-981cd0702163}
So if you don't have a DeviceInterfaceGUIDs (or DeviceInterfaceGUID)
key, I don't see how WinUSB could create that file, and I suspect you
are opening some other file that can't be used with the WinUSB API.
libusbp provides access to filenames like that with its
libusbp_generic_interface_get_os_filename function, and would complain
if it can't find the DeviceInterfaceGUIDs key.
--David
On Wed, May 30, 2018 at 8:51 AM, Paul Qureshi <pa...@wo...> wrote:
> 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
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> libusb-devel mailing list
> lib...@li...
> https://lists.sourceforge.net/lists/listinfo/libusb-devel
|