From: Chengda G. <che...@ca...> - 2018-06-22 08:52:13
|
Hi libusb-win32-devel, 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! Thanks! Chengda Guo |
From: Xiaofan C. <xia...@gm...> - 2018-06-23 02:24:42
|
On Fri, Jun 22, 2018 at 4:33 PM, Chengda Guo <che...@ca...> 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 -- Xiaofan |
From: Xiaofan C. <xia...@gm...> - 2018-06-25 11:45:42
|
On Sat, Jun 23, 2018 at 10:24 AM, Xiaofan Chen <xia...@gm...> wrote: > On Fri, Jun 22, 2018 at 4:33 PM, Chengda Guo <che...@ca...> 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 |
From: Xiaofan C. <xia...@gm...> - 2018-06-25 11:57:30
|
On Mon, Jun 25, 2018 at 7:45 PM, Xiaofan Chen <xia...@gm...> wrote: > On Sat, Jun 23, 2018 at 10:24 AM, Xiaofan Chen <xia...@gm...> wrote: >> On Fri, Jun 22, 2018 at 4:33 PM, Chengda Guo <che...@ca...> 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. > ... > So I changed the firmware to instead send DeviceInterfaceGUIDs REG_MULTI_SZ > with just the one GUID. LibUsbDotNet worked perfectly after that. > +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ The other possibility is that your FW is missing DeviceInterfaceGUID handling. Windows may be able to install the device but libusbK or other applications will not be able to find it. Ref: http://www.microchip.com/forums/m802958.aspx http://www.microchip.com/forums/m790429.aspx -- Xiaofan |
From: Chengda G. <che...@ca...> - 2018-06-26 01:42:39
|
Hi Xiaofan, I'm so sorry for my delays in replying to your letter. Your advice is very helpful. I debug the source code of LibUsbK in my application, and I find that DeviceInterfaceGUID is missing. I will check the configuration of my WCID device according to your advice. Thank you very much! Chengda From: Xiaofan Chen <xia...@gm...> To: lib...@li... Date: 2018/06/25 20:05 Subject: Re: [Libusb-win32-devel] About auto install WinUsb driver and use LibusbK to access device On Mon, Jun 25, 2018 at 7:45 PM, Xiaofan Chen <xia...@gm...> wrote: > On Sat, Jun 23, 2018 at 10:24 AM, Xiaofan Chen <xia...@gm...> wrote: >> On Fri, Jun 22, 2018 at 4:33 PM, Chengda Guo <che...@ca...> 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. > ... > So I changed the firmware to instead send DeviceInterfaceGUIDs REG_MULTI_SZ > with just the one GUID. LibUsbDotNet worked perfectly after that. > +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ The other possibility is that your FW is missing DeviceInterfaceGUID handling. Windows may be able to install the device but libusbK or other applications will not be able to find it. Ref: http://www.microchip.com/forums/m802958.aspx http://www.microchip.com/forums/m790429.aspx -- Xiaofan ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Libusb-win32-devel mailing list Lib...@li... https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel |
From: Xiaofan C. <xia...@gm...> - 2018-06-27 13:21:14
|
On Tue, Jun 26, 2018 at 9:42 AM, Chengda Guo <che...@ca...> wrote: > Hi Xiaofan, > > I'm so sorry for my delays in replying to your letter. Your advice is very > helpful. I debug the source code of LibUsbK in my application, and I find > that DeviceInterfaceGUID is missing. I will check the configuration of my > WCID device according to your advice. > For the record, I think it is a libusbK bug. I have reproduce this bug from my side using a defaut Microchip USB demo firmware. c:\libusbK-dev-kit>klist Loading USB ID's maintained by Stephen J. Gowdy <lin...@gm...>.. No devices found. c:\libusbK-dev-kit>c:\work\libusb\bin-1.0.22\examples\bin64\xusb.exe 04d8:0053 Using libusb v1.0.22.11312 Opening device 04D8:0053... Reading device descriptor: length: 18 device class: 0 S/N: 0 VID:PID: 04D8:0053 bcdDevice: 0000 iMan:iProd:iSer: 1:2:0 nb confs: 1 Reading BOS descriptor: no descriptor Reading first configuration descriptor: nb interfaces: 1 interface[0]: id = 0 interface[0].altsetting[0]: num endpoints = 2 Class.SubClass.Protocol: FF.FF.FF endpoint[0].address: 01 max packet size: 0040 polling interval: 01 endpoint[1].address: 81 max packet size: 0040 polling interval: 01 Claiming interface 0... Reading string descriptors: String (0x01): "Microchip Technology Inc." String (0x02): "Microchip Vendor Example Device" Reading Extended Compat ID OS Feature Descriptor (wIndex = 0x0004): 00000000 28 00 00 00 00 01 04 00 01 00 00 00 00 00 00 00 (............... 00000010 00 01 57 49 4e 55 53 42 00 00 00 00 00 00 00 00 ..WINUSB........ 00000020 00 00 00 00 00 00 00 00 ........ Reading Extended Properties OS Feature Descriptor (wIndex = 0x0005): Failed: Pipe error Releasing interface 0... Closing device... -- Xiaofan |
From: Chengda G. <che...@ca...> - 2018-06-28 02:08:48
|
Hi Xiaofan, My WCID device's descriptor like below shows: And when I use xusb.exe to check the device's descriptor, it can't open the device like below shows: And then I debug into the source code of LibUsbk's example "open-device", in the function l_EnumKey_Instances() at lusbk_device_list.c file. When enum DeviceInterface, got an error code 259(No more data is available) like below shows: So I guess maybe my FW is missing DeviceInterfaceGUID handling like your previous mail said. But I'm not the expert of device FW, so I'm not sure about this. Do you agree with me or have some other advice? Thanks a lot! Chengda Guo From: Xiaofan Chen <xia...@gm...> To: lib...@li... Date: 2018/06/27 21:21 Subject: Re: [Libusb-win32-devel] About auto install WinUsb driver and use LibusbK to access device On Tue, Jun 26, 2018 at 9:42 AM, Chengda Guo <che...@ca...> wrote: > Hi Xiaofan, > > I'm so sorry for my delays in replying to your letter. Your advice is very > helpful. I debug the source code of LibUsbK in my application, and I find > that DeviceInterfaceGUID is missing. I will check the configuration of my > WCID device according to your advice. > For the record, I think it is a libusbK bug. I have reproduce this bug from my side using a defaut Microchip USB demo firmware. c:\libusbK-dev-kit>klist Loading USB ID's maintained by Stephen J. Gowdy <lin...@gm...>.. No devices found. c:\libusbK-dev-kit>c:\work\libusb\bin-1.0.22\examples\bin64\xusb.exe 04d8:0053 Using libusb v1.0.22.11312 Opening device 04D8:0053... Reading device descriptor: length: 18 device class: 0 S/N: 0 VID:PID: 04D8:0053 bcdDevice: 0000 iMan:iProd:iSer: 1:2:0 nb confs: 1 Reading BOS descriptor: no descriptor Reading first configuration descriptor: nb interfaces: 1 interface[0]: id = 0 interface[0].altsetting[0]: num endpoints = 2 Class.SubClass.Protocol: FF.FF.FF endpoint[0].address: 01 max packet size: 0040 polling interval: 01 endpoint[1].address: 81 max packet size: 0040 polling interval: 01 Claiming interface 0... Reading string descriptors: String (0x01): "Microchip Technology Inc." String (0x02): "Microchip Vendor Example Device" Reading Extended Compat ID OS Feature Descriptor (wIndex = 0x0004): 00000000 28 00 00 00 00 01 04 00 01 00 00 00 00 00 00 00 (............... 00000010 00 01 57 49 4e 55 53 42 00 00 00 00 00 00 00 00 ..WINUSB........ 00000020 00 00 00 00 00 00 00 00 ........ Reading Extended Properties OS Feature Descriptor (wIndex = 0x0005): Failed: Pipe error Releasing interface 0... Closing device... -- Xiaofan ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Libusb-win32-devel mailing list Lib...@li... https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel |
From: Xiaofan C. <xia...@gm...> - 2018-06-28 11:51:46
|
On Thu, Jun 28, 2018 at 10:08 AM, Chengda Guo <che...@ca...> wrote: > > Hi Xiaofan, > > My WCID device's descriptor like below shows: > That is not really the descriptor. You should have something like this. http://janaxelson.com/files/ms_os_10_descriptors.c More explanation here. https://github.com/pbatard/libwdi/wiki/WCID-Devices > And when I use xusb.exe to check the device's descriptor, it can't open the > device like below shows: Then I think your FW has an issue. Read the above libwdi wiki page and see if you can learn something there. > And then I debug into the source code of LibUsbk's example "open-device", in the > function l_EnumKey_Instances() at lusbk_device_list.c file. When enum > DeviceInterface, got an error code 259(No more data is available) like below shows: As mentioned in the previous email, libusbK has a problem -- it will not work for your use case unfortunately even if you fix your FW. You may want to try out libusb Windows -- still you need to fix your FW. > So I guess maybe my FW is missing DeviceInterfaceGUID handling like your > previous mail said. But I'm not the expert of device FW, so I'm not sure about this. > Do you agree with me or have some other advice? > -- Xiaofan |
From: Xiaofan C. <xia...@gm...> - 2018-06-28 13:09:36
|
Hi Chengda, BTW, are you using Windows 7? If yes, you may want to try out Windows 10 to see if the situation changes. Thanks. -- Xiaofan |
From: Xiaofan C. <xia...@gm...> - 2018-06-29 13:44:55
|
On Thu, Jun 28, 2018 at 7:51 PM, Xiaofan Chen <xia...@gm...> wrote: > On Thu, Jun 28, 2018 at 10:08 AM, Chengda Guo > <che...@ca...> wrote: >> >> Hi Xiaofan, >> >> My WCID device's descriptor like below shows: >> > > That is not really the descriptor. You should have something like this. > http://janaxelson.com/files/ms_os_10_descriptors.c > > More explanation here. > https://github.com/pbatard/libwdi/wiki/WCID-Devices > > >> And when I use xusb.exe to check the device's descriptor, it can't open the >> device like below shows: > > Then I think your FW has an issue. Read the above libwdi wiki page > and see if you can learn something there. > >> And then I debug into the source code of LibUsbk's example "open-device", in the >> function l_EnumKey_Instances() at lusbk_device_list.c file. When enum >> DeviceInterface, got an error code 259(No more data is available) like below shows: > > As mentioned in the previous email, libusbK has a problem -- it will not work > for your use case unfortunately even if you fix your FW. > > You may want to try out libusb Windows -- still you need to fix your FW. > >> So I guess maybe my FW is missing DeviceInterfaceGUID handling like your >> previous mail said. But I'm not the expert of device FW, so I'm not sure about this. >> Do you agree with me or have some other advice? You can take a look here at this firmware. It should work with both libusbK and xusb. https://github.com/TravisRo/libusb_stm32/blob/master/demo/winusb_loop.c -- Xiaofan |
From: Xiaofan C. <xia...@gm...> - 2018-06-29 14:22:16
|
On Fri, Jun 29, 2018 at 9:44 PM, Xiaofan Chen <xia...@gm...> wrote: > On Thu, Jun 28, 2018 at 7:51 PM, Xiaofan Chen <xia...@gm...> wrote: >>> And when I use xusb.exe to check the device's descriptor, it can't open the >>> device like below shows: >> >> Then I think your FW has an issue. Read the above libwdi wiki page >> and see if you can learn something there. >> >>> And then I debug into the source code of LibUsbk's example "open-device", in the >>> function l_EnumKey_Instances() at lusbk_device_list.c file. When enum >>> DeviceInterface, got an error code 259(No more data is available) like below shows: >> >> As mentioned in the previous email, libusbK has a problem -- it will not work >> for your use case unfortunately even if you fix your FW. >> >> You may want to try out libusb Windows -- still you need to fix your FW. Since your FW is already using "DeviceInterfaceGUIDs", the libusbK issue does not affect you. Your FW has an issue. >>> So I guess maybe my FW is missing DeviceInterfaceGUID handling like your >>> previous mail said. But I'm not the expert of device FW, so I'm not sure about this. >>> Do you agree with me or have some other advice? > > You can take a look here at this firmware. It should work with both > libusbK and xusb. > https://github.com/TravisRo/libusb_stm32/blob/master/demo/winusb_loop.c > Ref: https://github.com/pbatard/libwdi/wiki/WCID-Devices#Defining_a_Device_Interface_GUID_or_other_device_specific_properties One item that may be of interest to you, with regards to WCID devices, is the provision of additional device registry settings and especially the provision of the Device Interface GUID that you want your device to be accessed with. Just like with the Compatible ID, this too is done through a Feature Descriptor, called Extended Properties Feature Descriptor and located at wIndex = 0x0005. However, as opposed to the Compatible ID, this should be queried using an Interface Request with the full bmRequestType being set to 0xC1. Your FW needs to handle this. And if you are using Windows XP SP3/Vista/Windows 7, I hear reports sometimes it has a problem, you can test with Windows 10 first. -- Xiaofan |