Windows 10 IoT上的WinUSB驱动程序

GTH*_*ten 10 winusb raspberry-pi2 windows-10-iot-core

我正在尝试使用Windows附带的WinUsb.sys驱动程序(包括Raspberry Pi 2的Windows 10 IoT).使用devcon.exe我可以看到我正在尝试使用的USB连接(它被命名USB\VID_1234&PID_ABCD\5&3753427A&0&4),但我不知道如何强制它使用WinUsb.sys驱动程序.

在microsoft.com上找到了一些说明,但这似乎是一个标准的Windows安装,你可以使用设备管理器(我没有IoT).此页面上的INF文件示例也引用了一个CAT文件,我认为这是某种驱动程序签名,我不知道如何生成它(或者我甚至需要).还有一个对Windows NT(Signature = "$Windows NT$")的引用,我不知道是否需要为IoT更改(或者是否需要为IoT更改其他任何内容).

因此,使用devcon.exe和某种INF文件,如何让Windows IoT使用WinUsb.sys作为我附加的USB设备的驱动程序?

GTH*_*ten 12

经过大量的反复试验后,我终于开始工作了.这是一个完整的INF文件,供将来参考:


; 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
Run Code Online (Sandbox Code Playgroud)

将[Standard.NTarm]中的供应商ID(VID)和产品ID(PID)替换为您要添加的USB的相应VID和PID.最后,使用设备的正确信息替换底部附近的ManufacturerName和DeviceName.

使用SMB或FTP将此文件放在Raspberry Pi 2上的某个位置.

SSH或PowerShell到Raspberry Pi 2并转到放置INF文件的文件夹.运行以下命令:devcon dp_add .\<name of your INF file>

您应该看到以下结果: Driver package 'oem0.inf' added.

最后重启RP2(shutdown -r -t 0来自SSH/PowerShell).

当RP2重新启动时,您的设备应列在默认启动应用程序的"已连接设备"下,您现在应该可以使用其中的功能Windows.Devices.Usb与USB设备进行通信.