Windows 10 IoT 上的 WinUSB 驱动程序 [英] WinUSB driver on Windows 10 IoT

查看:113
本文介绍了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 驱动程序.

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_1234&PID_ABCD\5&3753427A&0&4), but I don't know how to force it to use the WinUsb.sys driver.

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

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).

那么,使用 devcon.exe 和某种 INF 文件,如何让 Windows IoT 使用 WinUsb.sys 作为我连接的 USB 设备的驱动程序?

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?

推荐答案

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

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

<小时>

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


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.

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

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

通过 SSH 或 PowerShell 连接到 Raspberry Pi 2,然后转到放置 INF 文件的文件夹.运行以下命令:devcon dp_add .\<您的 INF 文件的名称>

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>

您应该会看到以下结果:已添加驱动程序包oem0.inf".

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

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

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

当 RP2 备份时,您的设备应列在默认启动应用程序的已连接设备"下,您现在应该能够使用 Windows.Devices.Usb 中的功能与USB 设备.

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.

这篇关于Windows 10 IoT 上的 WinUSB 驱动程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆