Re: About auto install WinUsb driver and use LibusbK to access device

Xiaofan Chen <[email protected]> Mon, 25 Jun 2018 19:45:33 +0800
Newsgroups gmane.comp.lib.libusb.devel.windows
Message-ID <CAGjSPUDF3C-_zQBDzYZFKC2ABcemoSz5xyLWe-EB40+QdBFA8A@mail.gmail.com>
On Sat, Jun 23, 2018 at 10:24 AM, Xiaofan Chen <[email protected]> wrote:
> On Fri, Jun 22, 2018 at 4:33 PM, Chengda Guo <[email protected]> wrote:
>> I had used the libusbk and winUsb driver which created by the libusbk-inf-wizard.exe
>> for installing my device, both of them are OK. And I can access the device by
>> LibUsbk.dll in my application. Now I would like to automatically install winusb driver
>> by Windows OS when the device plug into the system, and then use LibUsbk.dll
>> to access the device in my application. The first step automatically install winusb
>> driver was successful like below screen shot shows.
>> But in my application, the device can't be accessed by LibUsbk.dll(Din't find
>> the device, LstK_Init() succeed, but LstK_Count() return 0 device count).
>>
>> Whether this way is feasible or not? What do I need to pay attention to?
>> Look forward to your kind advice. Thank you very much!
>>
>
> A few questions.
> 1) What is the OS version?
>
> 2) How do you automatically install WinUSB driver by Windows OS?
> If you use the Windows OS Descriptor, please check the following. You
> can post the whole USB Descriptor of your device.
> https://github.com/pbatard/libwdi/wiki/WCID-Devices
>
> 3) As the above website suggests, you can download libusb-1.0 Windows
> binary and use xusb to test your WCID device.
> https://github.com/libusb/libusb/releases
>

One thing you can try.
https://github.com/BrandonLWhite/Stellaris-LaunchPad-UsbDevBulk-AutoWinusbInstall

It could be libusbK is the same as libusbdotnet. I need to check.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
####DeviceInterfaceGUIDs vs. DeviceInterfaceGUID In my original
firmware, I had it sending
DeviceInterfaceGUID (REG_SZ) to the host when asked for the Microsoft
Extended Properties
Feature Descriptor just like the MSDN docs say to do. When trying to
use LibUsbDotNet,
I immediately ran into problems getting it to find my device. It turns
out that LibUsbDotNet is
hardcoded to look for DeviceInterfaceGUIDs as part of locating WinUSB
devices. As such,
it won't identify a WinUSB device that sends DeviceInterfaceGUID.

What I learned is that in the years prior, whenever you created an
.INF file to load
WinUSB the old way, you included something like this:

[Dev_AddReg]
HKR,,DeviceInterfaceGUIDs,0x10000,"{6E45736A-2B1B-4078-B772-B3AF2B6FDE1C}"

That's actually straight out of the TI usb_dev_bulk.inf file, but
there's plenty of examples
out there doing the same thing. So it's perfectly normal, in fact I'll
go so far as to say
de facto, that you specify the multiple-form
DeviceInterfaceGUIDscontaining exactly
one GUID.

So I changed the firmware to instead send DeviceInterfaceGUIDs REG_MULTI_SZ
with just the one GUID. LibUsbDotNet worked perfectly after that.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



-- 
Xiaofan

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot