This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Code10 after installing own driver on x64 win 7 prof

Hello everyone,

I tried to install an driver via INF-file for USB-CDC (based on mcb2300_vcom.inf) on Windows 7 Professional x64 (in the following text called 'target system'). This is to get a COM-Port to send data via USB to an LPC2368 microcontroller.

The installation failed the first time with the message that the driver is not a x64-based system driver.

So I changed the driver as described in MSDN-article for "Cross-Platform INF Files". After a day of hard mind-work I finished the driver and tried to install it again. Now the installation starts on the target system, gives a message about the missing signature, and finishes with following message:

Driver software was found, but an error occured while installation.
The device could not be started. (Code 10)

I checked the INF-file with ChkInf (WDK 7.1.0) on the target system and got only one error (no warnings):

Line x: ERROR: (E22.1.1081) Directive: CatalogFile required (and must not be blank) in section [Version] for WHQL digital signature.

I do not think this error is the reason for Code10.

I furthermore checked the usbser.sys on the target system. It's version is 6.1.7600.16385.
It's date is 14.07.2009 02:06.

I do not know what to do now to make the driver work.

Finally, here is my revised INF source:

[Version]
Signature="$Windows NT$"
Class=Ports
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
Provider=%MYCOMPANY%
DriverVer=10/13/2010,5

[DestinationDirs]
FakeModemCopyFileSection=12
DefaultDestDir=12

[Manufacturer]
%MYCOMPANY%=USBDevice,NTia64,NTamd64

;------------------------------------------------------------------------------
; Models sections
;------------------------------------------------------------------------------

[USBDevice]
%DRIVERNAME%=InstallXXUSB, USB\VID_c251&PID_1705

[USBDevice.NTia64]
%DRIVERNAME%=InstallXXUSB, USB\VID_c251&PID_1705

[USBDevice.NTamd64]
%DRIVERNAME%=InstallXXUSB, USB\VID_c251&PID_1705

[SourceDisksFiles]

[SourceDisksNames]

;------------------------------------------------------------------------------
; Installation
;------------------------------------------------------------------------------

[InstallXXUSB]
include=mdmcpq.inf
CopyFiles=FakeModemCopyFileSection
AddReg=XXUSB.AddReg

[XXUSB.AddReg]
HKR,,DevLoader,,*ntkern
HKR,,NTMPDriver,,usbser.sys
HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"

[InstallXXUSB.Services]
AddService=usbser, 0x00000002, DriverService

[DriverService]
DisplayName=%DRIVERNAME%
Description=%DESCRIPTION%
ServiceType=1
StartType=3
ErrorControl=1
ServiceBinary=%12%\usbser.sys


;------------------------------------------------------------------------------
;  String Definitions
;------------------------------------------------------------------------------

[Strings]
MYCOMPANY="The name of my company"
DRIVERNAME="XX USB VCom Port"
DESCRIPTION="Provides a virtual COM-Port when connecting an XX via USB"

Has anyone hints for me to solve the problem and make the port work?

Best regards

Parents
  • Searching this forum again for possible solutions i found the following information in thread http://www.keil.com/forum/16550/:

    [Version]
    Signature="$Windows NT$"
    Class=Ports
    ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
    Provider=%STM%
    LayoutFile=layout.inf
    DriverVer=01/06/07
    
    [Manufacturer]
    %STM%=DeviceList, NTamd64
    
    [DestinationDirs]
    ;FakeModemCopyFileSection=12
    ;FakeModemCopyFileSection.NTamd64=12
    DefaultDestDir=12
    
    
    [DeviceList]
    %DESCRIPTION%=STMUSB, USB\VID_0483&PID_5740
    [DeviceList.NTamd64]
    %DESCRIPTION%=STMUSB, USB\VID_0483&PID_5740
    
    ;------------------------------------------------------------------------------
    ;  Windows 2000/XP Sections
    ;------------------------------------------------------------------------------
    
    [STMUSB.nt]
    include=mdmcpq.inf
    ;CopyFiles=FakeModemCopyFileSection
    CopyFiles=DriverCopyFiles.nt
    AddReg=STMUSB.nt.AddReg
    
    
    [STMUSB.nt.AddReg]
    HKR,,NTMPDriver,,*ntkern
    HKR,,NTMPDriver,,usbser.sys
    HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
    HKR,,PortSubClass,1,01
    
    [STMUSB.nt.Services]
    include=mdmcpq.inf
    AddService=usbser, 0x00000002, DriverService
    
    
    [DriverService]
    DisplayName=%DESCRIPTION%
    ServiceType=1
    StartType=3
    ErrorControl=1
    ServiceBinary=%12%\usbser.sys
    HKR,,PortSubClass,1,01
    
    [STMUSB.nt.HW]
    include=mdmcpq.inf
    
    ;------------------------------------------------------------------------------
    ;  Windows 7-64bit Sections
    ;------------------------------------------------------------------------------
    
    [STMUSB.NTamd64]
    include=mdmcpq.inf
    ;CopyFiles=FakeModemCopyFileSection.NTamd64
    CopyFiles=DriverCopyFiles.NTamd64
    AddReg=STMUSB.NTamd64.AddReg
    
    
    [STMUSB.NTamd64.AddReg]
    HKR,,NTMPDriver,,*ntkern
    HKR,,NTMPDriver,,usbser.sys
    HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
    HKR,,PortSubClass,1,01
    
    [STMUSB.NTamd64.Services]
    include=mdmcpq.inf
    

    The user who posted this file used it for USBCDC with Windows 7 x64.

    I found some differences to my INF file and have some questions on them:

    1. LayoutFile in [Version] section is included in the posted file. I excluded it from my Inf, because msdn writes: "If possible, INF files that are not distributed with the operating system should omit this entry."
    So I have to leave it out, right?

    2. The posted INF uses DriverCopyFiles instead of FakeModemCopyFileSection in CopyFiles directive.
    I read a lot about this directive. It is marked as very important to find usbser.sys on target os when using the INF on different operating systems than 2k / XP. Why the posted INF file worked on Windows 7 anyway?
    Could it be that the necessary usbser.sys was copied to driver directory previously?

    3. The posted INF has platform-specific sections. The sections for 2k / XP have platform extensions (.NT). But msdn writes about 'Cross-Platform INF Files': "Include [...] sections that are required for an x86-based installation. Do not include an .ntx86 platform extension on the names of these sections."
    Do I have do include .NT sections for a 2k compliant INF file?

    4. The AddReg sections in the posted INF differ from my AddReg sections. In the first line there ist HKR,,NTMPDriver,,*ntkern instead of HKR,,DevLoader,,*ntkern. Why?

    Furthermore there is an additional line: HKR,,PortSubClass,1,01. What does that mean?

    I would be happy to get some answers.

    Best regards

Reply
  • Searching this forum again for possible solutions i found the following information in thread http://www.keil.com/forum/16550/:

    [Version]
    Signature="$Windows NT$"
    Class=Ports
    ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
    Provider=%STM%
    LayoutFile=layout.inf
    DriverVer=01/06/07
    
    [Manufacturer]
    %STM%=DeviceList, NTamd64
    
    [DestinationDirs]
    ;FakeModemCopyFileSection=12
    ;FakeModemCopyFileSection.NTamd64=12
    DefaultDestDir=12
    
    
    [DeviceList]
    %DESCRIPTION%=STMUSB, USB\VID_0483&PID_5740
    [DeviceList.NTamd64]
    %DESCRIPTION%=STMUSB, USB\VID_0483&PID_5740
    
    ;------------------------------------------------------------------------------
    ;  Windows 2000/XP Sections
    ;------------------------------------------------------------------------------
    
    [STMUSB.nt]
    include=mdmcpq.inf
    ;CopyFiles=FakeModemCopyFileSection
    CopyFiles=DriverCopyFiles.nt
    AddReg=STMUSB.nt.AddReg
    
    
    [STMUSB.nt.AddReg]
    HKR,,NTMPDriver,,*ntkern
    HKR,,NTMPDriver,,usbser.sys
    HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
    HKR,,PortSubClass,1,01
    
    [STMUSB.nt.Services]
    include=mdmcpq.inf
    AddService=usbser, 0x00000002, DriverService
    
    
    [DriverService]
    DisplayName=%DESCRIPTION%
    ServiceType=1
    StartType=3
    ErrorControl=1
    ServiceBinary=%12%\usbser.sys
    HKR,,PortSubClass,1,01
    
    [STMUSB.nt.HW]
    include=mdmcpq.inf
    
    ;------------------------------------------------------------------------------
    ;  Windows 7-64bit Sections
    ;------------------------------------------------------------------------------
    
    [STMUSB.NTamd64]
    include=mdmcpq.inf
    ;CopyFiles=FakeModemCopyFileSection.NTamd64
    CopyFiles=DriverCopyFiles.NTamd64
    AddReg=STMUSB.NTamd64.AddReg
    
    
    [STMUSB.NTamd64.AddReg]
    HKR,,NTMPDriver,,*ntkern
    HKR,,NTMPDriver,,usbser.sys
    HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
    HKR,,PortSubClass,1,01
    
    [STMUSB.NTamd64.Services]
    include=mdmcpq.inf
    

    The user who posted this file used it for USBCDC with Windows 7 x64.

    I found some differences to my INF file and have some questions on them:

    1. LayoutFile in [Version] section is included in the posted file. I excluded it from my Inf, because msdn writes: "If possible, INF files that are not distributed with the operating system should omit this entry."
    So I have to leave it out, right?

    2. The posted INF uses DriverCopyFiles instead of FakeModemCopyFileSection in CopyFiles directive.
    I read a lot about this directive. It is marked as very important to find usbser.sys on target os when using the INF on different operating systems than 2k / XP. Why the posted INF file worked on Windows 7 anyway?
    Could it be that the necessary usbser.sys was copied to driver directory previously?

    3. The posted INF has platform-specific sections. The sections for 2k / XP have platform extensions (.NT). But msdn writes about 'Cross-Platform INF Files': "Include [...] sections that are required for an x86-based installation. Do not include an .ntx86 platform extension on the names of these sections."
    Do I have do include .NT sections for a 2k compliant INF file?

    4. The AddReg sections in the posted INF differ from my AddReg sections. In the first line there ist HKR,,NTMPDriver,,*ntkern instead of HKR,,DevLoader,,*ntkern. Why?

    Furthermore there is an additional line: HKR,,PortSubClass,1,01. What does that mean?

    I would be happy to get some answers.

    Best regards

Children