问题 Windows 10 IoT上的WinUSB驱动程序


我正在尝试使用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$")我不知道是否需要为物联网更改(或者如果物联网需要更改其他任何内容)。

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


7732
2017-10-24 11:39


起源

这更适合SuperUser。请注意,必须为ARM编译驱动程序。这可能是你的问题吗? - Michael-O
预装了Windows 10 IoT的WinUsb驱动程序已经为ARM编译。这只是告诉Windows(通过devcon.exe和INF文件)将此驱动程序用于特定硬件的问题。 - GTHvidsten


答案:


经过大量的反复试验后,我终于开始工作了。这是一个完整的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

将[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设备通信。


10
2017-11-14 11:59