1

I usually don't crosspost like this, but a user on stackoverflow suggested this might belong here. There's also a small bounty to be had on stackoverflow if anybody's interested.

I'm trying to use the WinUsb.sys driver that comes with Windows (including Windows 10 IoT of Raspberry Pi 2). Using devcon.exe I can see that the USB I'm trying to use is connected (it is named USB\VID_00E3&PID_6324\5&3753427A&0&4), but I don't know how to force it to use the WinUsb.sys driver.

I found some instructions on microsoft.com but that seems to be for a standard Windows installation where you have Device Manager available (which I don't have on IoT). The INF file example on this page also refers to a CAT-file, which I assume this is some sort of driver signature, and I don't know how to generate this (or if I even need to). There's also a reference to Windows NT (Signature = "$Windows NT$") and I don't know if that needs to be changed for IoT or not (or if anything else needs to be changed for IoT for that matter).

So, using devcon.exe and some sort of INF file, how can I get Windows IoT to use WinUsb.sys as a driver for the USB device I'm attaching?

TheHvidsten
  • 181
  • 2
  • 10
  • You do understand you need to write the .INF file yourself right? – Ramhound Oct 28 '15 at 18:22
  • [I can't view the tutorial but this should help](https://ms-iot.github.io/content/en-US/win10/samples/DriverLab.htm). [This](https://ms-iot.github.io/content/en-US/win10/samples/DriverLab3.htm) I know will help. – Ramhound Oct 28 '15 at 18:25
  • Yes, I know I need an INF-file, but I don't know what it needs to contain for IoT because the sample I linked to is for regular Windows. Also, the tutorial you linked to is to create a driver for GPIO-devices, not USB-devices. – TheHvidsten Oct 28 '15 at 18:33
  • The instructions will be identical once you have the .INF file. If you build the sample and follow the tutorial you will get a starting place or your .INF file. We can't provide that information ( we know nothing about the device ) except its a USB device. – Ramhound Oct 28 '15 at 18:35
  • Not knowing about the USB device is the beauty of the WinUsb-driver, though. You only need the PID+VID of the device and with the WinUsb-driver hooked up for the hardware you have everything you need to communicate with it, without having to have any knowledge of what kind of device it is, other than it is a USB device. I'll take a more detailed look at the tutorial you linked to, though, and see if the INF file in that project can help me get further. – TheHvidsten Oct 28 '15 at 18:45
  • While that specific fact alluded me. The point of the comment was that we are not in a position to generate the .INF file for you. You also seem confused about how to force a device to use a driver, which was the point of the tutorial, it specifically has a section on how to do that. This question is difficult to answer since it likely is the first Windows 10 IOT question I personally have seen here. – Ramhound Oct 28 '15 at 18:51
  • I had hoped that there would be someone here that could provide me with an example file that would work on Windows 10 IoT, but I can understand it might be hard to come up with concrete examples. I know Windows 10 IoT is relatively new, but didn't think I would be first to ask questions about it. Somebody's gotta be the first, right? ;) – TheHvidsten Oct 28 '15 at 18:58
  • I suggest you come into chat to discuss this. I am going to bring up the question if this question should be here or [Raspberry Pi SE](http://raspberrypi.stackexchange.com/). Of course we allowed Windows RT questions, and there is only a small difference, between your `Raspberry Pi 2` and those devices. I will ping a moderator in the chat in a few, create a meta, ect. – Ramhound Oct 28 '15 at 19:03
  • Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/30834/discussion-between-gthvidsten-and-ramhound). – TheHvidsten Oct 28 '15 at 20:15

1 Answers1

3

After a lot of trial and error I finally got it working. Here's a complete INF-file for future reference:


; WinUSB installation file for USB device

[Version]
Signature = "$Windows NT$"
Class     = USBDevice
ClassGUID = {88BAE032-5A81-49f0-BC3D-A4FF138216D6}
Provider  = %ManufacturerName%
CatalogFile = WinUSBInstallation.cat
DriverVer=09/04/2012,13.54.20.543

; ========== Manufacturer/Models sections ===========
[Manufacturer]
%ManufacturerName%=Standard,NTarm

[Standard.NTarm]
%DeviceName% =USB_Install, USB\VID_1234&PID_ABCD

; ========== Class definition ===========
[ClassInstall32]
AddReg = ClassInstall_AddReg

[ClassInstall_AddReg]
HKR,,,,%ClassName%
HKR,,NoInstallClass,,1
HKR,,IconPath,%REG_MULTI_SZ%,"%systemroot%\system32\setupapi.dll,-20"
HKR,,LowerLogoVersion,,5.2

; =================== Installation ===================
[USB_Install]
Include = winusb.inf
Needs   = WINUSB.NT

[USB_Install.Services]
Include =winusb.inf
Needs   = WINUSB.NT.Services

[USB_Install.HW]
AddReg=Dev_AddReg

[Dev_AddReg]
HKR,,DeviceInterfaceGUIDs,0x10000,"{ec55ee47-5758-4378-926b-68ed0aec8170}"

; =================== Strings ===================
[Strings]
ManufacturerName="The name of the company producing your device"
ClassName="Universal Serial Bus devices"
DeviceName="The name of your device"
REG_MULTI_SZ = 0x00010000

Replace the Vendor ID (VID) and Product ID (PID) in [Standard.NTarm] with the corresponding VID and PID of the USB you're adding. Finally replace the ManufacturerName and DeviceName near the bottom with the correct info for your device.

Put this file somewhere on the Raspberry Pi 2, using either SMB or FTP.

SSH or PowerShell to the Raspberry Pi 2 and go to the folder where you put the INF file. Run the following command: devcon dp_add .\<name of your INF file>

You should see the following result: Driver package 'oem0.inf' added.

Finally restart the RP2 (shutdown -r -t 0 from SSH/PowerShell).

When the RP2 gets back up your device should be listed under "Connected Devices" on the default startup app, and you should now be able to use functionality from Windows.Devices.Usb to communicate with the USB device.

TheHvidsten
  • 181
  • 2
  • 10