USB inf

I am teaching myself how to write a USB driver using osrusbfx2 and thought that I could just change the HW ID to match the ATMEL ARM 9261 board and I would be able to install the device (NOT)… I contacted the OSR hw support staff and they have directed me here…

To make a long story short, I ran the modified INF file through the ChkInf tool and have some errors. What is missing to cause the below errors?

What is USB\VID_045E&PID_930A?
%USB\VID_045E&PID_930A.DeviceDesc%=osrusbfx2.Dev, USB\VID_03EB&PID_0001;
(E22.1.1120) String token “USB\VID_045E&PID_930A.DeviceDesc” not defined.

What purpose does this INF line serve?
Switch.DeviceDesc%=Switch.Dev, {6FDE7521-1B65-48ae-B628-80BE62016026}\OsrUsbFxRawPdo

Is this really needed?
AddReg = osrusbfx2.AddReg;
(E22.1.1003) Section [osrusbfx2.AddReg] not defined.

Currently I get an error msg that there is no driver that matches the hardware and I suspect it is from one of the above errors.

xxxxx@mpr.com wrote:

I am teaching myself how to write a USB driver using osrusbfx2 and thought that I could just change the HW ID to match the ATMEL ARM 9261 board and I would be able to install the device (NOT)… I contacted the OSR hw support staff and they have directed me here…

To make a long story short, I ran the modified INF file through the ChkInf tool and have some errors. What is missing to cause the below errors?

What is USB\VID_045E&PID_930A?
%USB\VID_045E&PID_930A.DeviceDesc%=osrusbfx2.Dev, USB\VID_03EB&PID_0001;
(E22.1.1120) String token “USB\VID_045E&PID_930A.DeviceDesc” not defined.

The percent signs in an INF file mark variable substitutions. It looks
the variable name up in the [Strings] section. In this case, it will
look for a line that says

[Strings]
USB\VID_045E&PID_930A.DeviceDesc=…xxx…

The error says that line is missing.

There is a mistaken belief that the string variable name has to match
the device ID string. That’s not true. The string variable name can be
anything. If you’d rather, you can say:

%MyCoolDeviceDescription% = osrusbfx2.Dev, USB\VID_03EB&PID_0001

[Strings]
MyCoolDeviceDescription = …xxx…

045E/930A happens to be the VID and PID of the OSR FX2 board.

What purpose does this INF line serve?
Switch.DeviceDesc%=Switch.Dev, {6FDE7521-1B65-48ae-B628-80BE62016026}\OsrUsbFxRawPdo

The sample driver acts as a bus, exposing additional child devices, one
for each switch on the board. That line matches the device ID of those
created child devices and matches them to a driver section.

Is this really needed?
AddReg = osrusbfx2.AddReg;
(E22.1.1003) Section [osrusbfx2.AddReg] not defined.

Obviously not, since the section is not present. Many drivers have
AddReg needs, but not all. Remember, these are just samples.

Currently I get an error msg that there is no driver that matches the hardware and I suspect it is from one of the above errors.

What is the VID and PID for your hardware? You’re saying the VID is
03EB and the PID is 0001. Is that really what your descriptors expose?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

How does a person overcome the device cannot start (code10)?

My Atmel ARM board has a hw id of 03EB and the PID is 0001 but I changed
it and reloaded the firmware so it matches the osrusbfx2.inf (0547 and
1002) file, it will load the driver but not start it. I get the msg
“This device cannot start. (Code 10)”

I tried rebooting the system and reinstalling the driver and no avail.
By looking at the usb sniffer I see:

Connection Status

Device connected

Current Configuration

0

Speed

Low

Device Address

0

Number Of Open Pipes

0

Device Descriptor

Offset

Field

Size

Value

Description

0

bLength

1

12h

1

bDescriptorType

1

01h

Device

2

bcdUSB

2

0200h

USB Spec 2.0

4

bDeviceClass

1

00h

Class info in Ifc Descriptors

5

bDeviceSubClass

1

00h

6

bDeviceProtocol

1

00h

7

bMaxPacketSize0

1

08h

8 bytes

8

idVendor

2

0547h

Anchor Chips, Inc.

10

idProduct

2

1002h

12

bcdDevice

2

0000h

0.00

14

iManufacturer

1

00h

15

iProduct

1

00h

16

iSerialNumber

1

00h

17

bNumConfigurations

1

01h

I also tried restarting the device via devcon.exe… and no luck.

;/*++

;

;Copyright (c) Microsoft Corporation. All rights reserved.

;

; THIS CODE AND INFORMATION IS PROVIDED “AS IS” WITHOUT WARRANTY OF
ANY

; KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE

; IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR

; PURPOSE.

;

;Module Name:

;

; OSRUSBFX2.INF

;

;Abstract:

; Installation inf for OSR USB-FX2 Learning Kit

;

;–*/

[Version]

Signature=“$WINDOWS NT$”

Class=Sample

ClassGuid={78A1C341-4539-11d3-B88D-00C04FAD5171}

Provider=%MSFT%

DriverVer=10/18/2010,6.1.7600.16385

CatalogFile=KmdfSamples.cat

; ================= Class section =====================

[ClassInstall32]

Addreg=SampleClassReg

[SampleClassReg]

HKR,0,%ClassName%

HKR,Icon,-5

; ================= Device section =====================

[Manufacturer]

%MfgName%=Microsoft,NTx86

; For Win2K

[Microsoft]

%USB\VID_045E&PID_930A.DeviceDesc%=osrusbfx2.Dev, USB\VID_0547&PID_1002

%Switch.DeviceDesc%=Switch.Dev,
{6FDE7521-1B65-48ae-B628-80BE62016026}\OsrUsbFxRawPdo

; For XP and later

[Microsoft.NTx86]

%USB\VID_045E&PID_930A.DeviceDesc%=osrusbfx2.Dev, USB\VID_0547&PID_1002

%Switch.DeviceDesc%=Switch.Dev,
{6FDE7521-1B65-48ae-B628-80BE62016026}\OsrUsbFxRawPdo

[osrusbfx2.Dev.NT]

CopyFiles=osrusbfx2.Files.Ext

[Switch.Dev.NT]

;dummy section

[Switch.Dev.NT.Services]

AddService = , %SPSVCINST_ASSOCSERVICE%,

[osrusbfx2.Dev.NT.Services]

AddService = osrusbfx2, %SPSVCINST_ASSOCSERVICE%, osrusbfx2.AddService

[osrusbfx2.AddService]

DisplayName = %osrusbfx2.SvcDesc%

ServiceType = 1 ; SERVICE_KERNEL_DRIVER

StartType = 3 ; SERVICE_DEMAND_START

ErrorControl = 1 ; SERVICE_ERROR_NORMAL

ServiceBinary = %10%\System32\Drivers\osrusbfx2.sys

AddReg = osrusbfx2.AddReg

LoadOrderGroup = Base

[osrusbfx2.Files.Ext]

osrusbfx2.sys

[SourceDisksNames]

1=%Disk_Description%,

[SourceDisksFiles]

osrusbfx2.sys = 1

[DestinationDirs]

DefaultDestDir = 12

;-------------- WDF Coinstaller installation

[DestinationDirs]

CoInstaller_CopyFiles = 11

[osrusbfx2.Dev.NT.CoInstallers]

AddReg=CoInstaller_AddReg

CopyFiles=CoInstaller_CopyFiles

[CoInstaller_CopyFiles]

WdfCoInstaller01009.dll

[SourceDisksFiles]

WdfCoInstaller01009.dll=1 ; make sure the number matches with
SourceDisksNames

[CoInstaller_AddReg]

HKR,CoInstallers32,0x00010000, “WdfCoInstaller01009.dll,WdfCoInstaller”

[osrusbfx2.Dev.NT.Wdf]

KmdfService = osrusbfx2, osrusbfx2_wdfsect

[osrusbfx2_wdfsect]

KmdfLibraryVersion = 1.9

;---------------------------------------------------------------;

[Strings]

MSFT=“Microsoft”

MfgName=“OSR”

Disk_Description=“OSRUSBFX2 Installation Disk”

USB\VID_045E&PID_930A.DeviceDesc=“WDF Sample Driver for OSR USB-FX2
Learning Kit”

osrusbfx2.SvcDesc=“WDF Sample Driver for OSR USB-FX2 Learning Kit”

ClassName = “Sample Device”

Switch.DeviceDesc = “OsrUsbFX2 RawPdo For Switch”

SPSVCINST_ASSOCSERVICE= 0x00000002

  • Julia Merritt

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Tuesday, October 19, 2010 2:09 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] USB inf

xxxxx@mpr.com wrote:

I am teaching myself how to write a USB driver using osrusbfx2 and
thought that I could just change the HW ID to match the ATMEL ARM 9261
board and I would be able to install the device (NOT)… I contacted the
OSR hw support staff and they have directed me here…

To make a long story short, I ran the modified INF file through the
ChkInf tool and have some errors. What is missing to cause the below
errors?

What is USB\VID_045E&PID_930A?

%USB\VID_045E&PID_930A.DeviceDesc%=osrusbfx2.Dev,
USB\VID_03EB&PID_0001;

(E22.1.1120) String token “USB\VID_045E&PID_930A.DeviceDesc” not
defined.

The percent signs in an INF file mark variable substitutions. It looks

the variable name up in the [Strings] section. In this case, it will

look for a line that says

[Strings]

USB\VID_045E&PID_930A.DeviceDesc=…xxx…

The error says that line is missing.

There is a mistaken belief that the string variable name has to match

the device ID string. That’s not true. The string variable name can be

anything. If you’d rather, you can say:

%MyCoolDeviceDescription% = osrusbfx2.Dev, USB\VID_03EB&PID_0001

[Strings]

MyCoolDeviceDescription = …xxx…

045E/930A happens to be the VID and PID of the OSR FX2 board.

What purpose does this INF line serve?

Switch.DeviceDesc%=Switch.Dev,
{6FDE7521-1B65-48ae-B628-80BE62016026}\OsrUsbFxRawPdo

The sample driver acts as a bus, exposing additional child devices, one

for each switch on the board. That line matches the device ID of those

created child devices and matches them to a driver section.

Is this really needed?

AddReg = osrusbfx2.AddReg;

(E22.1.1003) Section [osrusbfx2.AddReg] not defined.

Obviously not, since the section is not present. Many drivers have

AddReg needs, but not all. Remember, these are just samples.

Currently I get an error msg that there is no driver that matches the
hardware and I suspect it is from one of the above errors.

What is the VID and PID for your hardware? You’re saying the VID is

03EB and the PID is 0001. Is that really what your descriptors expose?

Tim Roberts, xxxxx@probo.com

Providenza & Boekelheide, Inc.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:

http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Merritt, Julia wrote:

How does a person overcome the device cannot start (code10)?

My Atmel ARM board has a hw id of 03EB and the PID is 0001 but I
changed it and reloaded the firmware so it matches the osrusbfx2.inf
(0547 and 1002) file, it will load the driver but not start it. I
get the msg “This device cannot start. (Code 10)”

The fact that it has FOUND your driver tells you that it wasn’t the VID
and PID causing this. Code 10 means your driver failed during its
initialization.

Are you, perhaps, trying to run a 32-bit driver on a 64-bit operating
system? Which operating system are you running?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

I have a XP OS on my laptop and the Atmel Arm board is a at91sam9261.
Both are 32 bit.

  • Julia Merritt

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Tuesday, October 19, 2010 5:00 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] USB inf

Merritt, Julia wrote:

How does a person overcome the device cannot start (code10)?

My Atmel ARM board has a hw id of 03EB and the PID is 0001 but I
changed it and reloaded the firmware so it matches the osrusbfx2.inf
(0547 and 1002) file, it will load the driver but not start it. I
get the msg “This device cannot start. (Code 10)”

The fact that it has FOUND your driver tells you that it wasn’t the VID
and PID causing this. Code 10 means your driver failed during its
initialization.

Are you, perhaps, trying to run a 32-bit driver on a 64-bit operating
system? Which operating system are you running?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Merritt, Julia wrote:

I have a XP OS on my laptop and the Atmel Arm board is a at91sam9261.
Both are 32 bit.

The device is irrelevant here.

Did you use the XP build environment when you built your driver? If you
send me the binary by private email, I will look to see if it uses any
APIs that aren’t available on XP.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

On Wed, Oct 20, 2010 at 4:16 AM, Merritt, Julia wrote:
>
> How does a person overcome the device cannot start (code10)?

One option is to check the firmware.

> Speed
> Low

Are you sure this is a low speed device?


Xiaofan