经过大量的试验和错误,我终于让它工作了。这是一个完整的 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 设备通信。