Windows 10 IoT上的WinUSB驱动程序

时间:2015-10-24 11:39:33

标签: raspberry-pi2 windows-10-iot-core winusb

我尝试使用Windows附带的WinUsb.sys驱动程序(包括Raspberry Pi 2的Windows 10 IoT)。使用devcon.exe我可以看到我尝试使用的USB已连接(名为Table Name),但我不知道如何强制它使用WinUsb.sys驱动程序

我找到了some instructions on microsoft.com,但这似乎适用于标准的Windows安装,您可以使用设备管理器(我不会在IoT上使用)。此页面上的INF文件示例也引用了一个CAT文件,我认为这是某种驱动程序签名,我不知道如何生成它(或者我甚至不需要)。还有对Windows NT(Column Names)的引用,我不知道是否需要针对物联网更改(或者是否需要针对物联网更改其他任何内容) )。

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

1 个答案:

答案 0 :(得分: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

将[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(来自SSH / PowerShell的shutdown -r -t 0)。

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

相关问题