不管是使用STM32官方提供的驱动,还是使用网上下载的.inf文件,在windows7下安装驱动,能够安装上,可以很多时候是出现黄色的小叹号,说设备无法启动,错误代码:10。导致无法使用。
今天本人就成功地安装上驱动了,很是高兴。原先也是试验了多次,没有成功。就手动修改inf文件,终于成功了!
成功的关键所在: USB\VID_10c4&PID_ea60;此处的VID和PID一定要和你程序中使用的ID相同。
以下是本人使用的inf文件:
;------------------------------------------------------------------------------
; STMicroelectronics Comunication Device Class driver (CDC) INF FILE
; (C)2009 Copyright STMicroelectronics
;------------------------------------------------------------------------------
[Version]
Signature="$Windows NT$"
Class=Ports
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
Provider=%MANUFACTURER%
LayoutFile=layout.inf
;CatalogFile=%FILENAME%.cat
DriverVer= 9/20/2009,1.2.0
[Manufacturer]
%MANUFACTURER%=DeviceList,NTamd64
[DestinationDirs]
DefaultDestDir=12
;------------------------------------------------------------------------------
; Windows 2000/XP/Vista32 Support
;------------------------------------------------------------------------------
[DriverInstall.nt]
include=mdmcpq.inf
CopyFiles=DriverCopyFiles.nt
AddReg=DriverInstall.nt.AddReg
[DriverCopyFiles.nt]
usbser.sys,,,0x20
[DriverInstall.nt.AddReg]
HKR,,DevLoader,,*ntkern
HKR,,NTMPDriver,,%DRIVERFILENAME%.sys
HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
[DriverInstall.nt.Services]
AddService=usbser, 0x00000002, DriverService.nt
[DriverService.nt]
DisplayName=%SERVICE%
ServiceType=1
StartType=3
ErrorControl=1
ServiceBinary=%12%\%DRIVERFILENAME%.sys
;------------------------------------------------------------------------------
; Windows Vista64 Support
;------------------------------------------------------------------------------
[DriverInstall.NTamd64]
include=mdmcpq.inf
CopyFiles=DriverCopyFiles.NTamd64
AddReg=DriverInstall.NTamd64.AddReg
[DriverCopyFiles.NTamd64]
%DRIVERFILENAME%.sys,,,0x20
[DriverInstall.NTamd64.AddReg]
HKR,,DevLoader,,*ntkern
HKR,,NTMPDriver,,%DRIVERFILENAME%.sys
HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
[DriverInstall.NTamd64.Services]
AddService=usbser, 0x00000002, DriverService.NTamd64
[DriverService.NTamd64]
DisplayName=%SERVICE%
ServiceType=1
StartType=3
ErrorControl=1
ServiceBinary=%12%\%DRIVERFILENAME%.sys
;------------------------------------------------------------------------------
; VID/PID Settings
;------------------------------------------------------------------------------
[SourceDisksFiles]
[SourceDisksNames]
[DeviceList]
%DESCRIPTION%=DriverInstall,USB\VID_10c4&PID_ea60
[DeviceList.NTamd64]
%DESCRIPTION%=DriverInstall,USB\VID_10c4&PID_ea60
;------------------------------------------------------------------------------
; String Definitions
;------------------------------------------------------------------------------
[Strings]
FILENAME="ST_Virtual"
DRIVERFILENAME ="usbser"
MANUFACTURER="STMicroelectronics"
INSTDISK="CDC_DISK"
DESCRIPTION="STM Virtual COM Port"
SERVICE="Virtual Com Driver" |
共1人点赞
|