Modifying CyUSB3.INF

CYUSB3

Modifying CyUSB3.INF

Top Previous Next

The CYUSB3.INF file can be modified to accomplish several different objectives. These are:

 

1. Add a device's identifiers to the driver

2. Replace Cypress strings that are displayed during driver installation

3. Implement a custom GUID for the driver

 

NOTE: x86 refers to the 32bit OS and amd64 refers to 64 bit OS.

 

 

Add a device's identifiers to the driver

 

The following steps describe the process of adding a device's vendor ID and product ID to the CYSUB3.INF file.

 

1. Locate the following sections [Device],[Device.NT],[Device.Ntx86] and [Device.Ntamd64]  and remove the semicolon of  each item under the each section

  ;%VID_XXXX&PID_XXXX.DeviceDesc%=CyUSB3, USB\VID_XXXX&PID_XXXX

 

2. Change the VID_XXXX to contain the hexadecimal value of the VendorID for the device and  

  change the PID_XXXX to contain the hexadecimal value of the ProductID for the device

 

   For example, a device with vendorID 0x04B4 and productID 0xDE01 would have a new entry in the above listed sections like

   following

   %VID_04B4&PID_DE01.DeviceDesc%=CyUSB3, USB\VID_04B4&PID_DE01

 

3. Change [String] section for Device Description according to the Vendor ID and Product ID. 

    VID_XXXX&PID_XXXX.DeviceDesc="Cypress USB3.0 Generic Driver" 

 

4. Change the VID_XXXX to contain the hexadecimal value of the VendorID for the device

 

 Change the PID_XXXX to contain the hexadecimal value of the ProductID for the device 

 

  For example, a device with vendorID 0x04B4 and productID 0xDE01 would have a new entry in the [Strings] section like the

  following

  VID_04B4&PID_DE01.DeviceDesc="Cypress FX3 Bulk sample"

 

 

 

Replace Cypress strings

 

If you plan to do more than just add your device's VID/PID to the CYUSB3.INF file, it is strongly recommended that you create your own .INF file and a copy of CYUSB3.SYS that you have re-named. The remaining instructions assume that you have created your own .INF file to match your newly named copy of CYUSB3.SYS.

 

The driver can be customized to report a company other than Cypress as its manufacturer and provider.

 

1. Locate the [Strings] section at the bottom of the CYUSB3.INF file.

 

2. Change the quoted CYUSB3_Provider string.

 

3. Change the quoted CYUSB3_DisplayName string.

 

4. Change the quoted CYUSB3_Company string.

 

5. Change the quoted CYUSB3_Description string. 

 

 

Implement a custom GUID

 

Applications software usually accesses the driver using the driver's Global Unique IDentifier (GUID). Each driver in the Windows system should have a unique GUID. By employing distinct GUIDs, multiple instances of CYUSB3.SYS from different hardware vendors can exist on a given system without colliding.

 

1. To change the driver's GUID,

 

2. Use the GUIDGEN.EXE utility (distributed with Microsoft Visual Studio) to get a new GUID.

 

3. Locate the [Strings] section in the CyUSB3.inf file

 

4. Locate the line

   CYUSB3.GUID="{AE18AA60-7F6A-11d4-97DD-00010229B959}"

   and replace the quoted GUID string with the new one you created. (Retain the curly braces.)

 

Execute a script at start-up

The CYUSB3.SYS driver can be used to perform transfers to the default control endpoint (endpoint address 0) when the device is started.

To configure the driver to perform a control transfer at startup

1. Use the CyControl.exe application to create a script file containing the control transfer commands.

2. Save the script as a file named MyDevice.SPT

3. Place that script file in the same directory as the the driver's .INF file

A common use of this feature is to have the driver play a script which downloads a firmware image to the USB device, thereby modifying its "personality" and usually causing it to re-enumerate on the bus. If this re-enumeration occurs with the same VID/PID as the original "personality", the script will be executed again and again in an un-ending loop.

To avoid this endless loop scenario, the second personality should enumerate with a different VID/PID than the one which caused the script to play.

The .inf file can be modified to play a script when one VID/PID is enumerated and to simply load the driver when a different VID/PID is detected.

How to disable the CyScript feature

To disable this feature the user needs to delete the key  'DriverEXECSCRIPT' from the registry.

The following steps should be followed to delete the key.

 

1. Execute the 'regedit.exe' application.

2. Search for the 'DriverEXECSCRIPT'.

3. Delete the  key 'DriverEXECSCRIPT'.

4. Close 'regedit.exe'.

 

The following is an excerpt from a .inf file that plays a script called MyDevice.spt when VID/PID of 04B4/00F3 is enumerated. If VID/PID 0547/00F0 enumerates, the script is not played.

 

NOTE:  For FX3 devices, the MyDevice.spt script will play only when the connected device supports FX3 boot commands.

 

Sample CYUSB3.INF file using the CyScript feature with VID-0x04B4 and PID-0x00F3 and 0x00F0

 

 

 

; Installation INF for the Cypress Generic USB Driver for OS unknown

; Processor support for x86 based platforms.

;

; (c) Copyright 2012 Cypress Semiconductor Corporation

;

 

[Version]

Signature="$WINDOWS NT$"

Class=USB

ClassGUID={36FC9E60-C465-11CF-8056-444553540000}

provider=%CYUSB3_Provider%

CatalogFile=CYUSB3.cat

DriverVer=01/23/2012,1.0.0.01

 

[SourceDisksNames]

1=%CYUSB3_Install%,,,

 

[SourceDisksFiles]

CYUSB3.sys = 1

 

[DestinationDirs]

CYUSB3.Files.Ext = 10,System32\Drivers

MyDevice.Files.Ext = 10,System32\MyDevice

 

[ControlFlags]

ExcludeFromSelect = *

 

[Manufacturer]

%CYUSB3_Provider%=Device,NT,NTx86,NTamd64

 

;for all platforms

[Device.NT]

%VID_04B4&PID_00F3.DeviceDesc%=MyDevice, USB\VID_04B4&PID_00F3

%VID_04B4&PID_00F0.DeviceDesc%=CYUSB3, USB\VID_04B4&PID_00F0

 

;for x86 platforms

[Device.NTx86]

%VID_04B4&PID_00F3.DeviceDesc%=MyDevice, USB\VID_04B4&PID_00F3

%VID_04B4&PID_00F0.DeviceDesc%=CYUSB3, USB\VID_04B4&PID_00F0

 

 

;for x64 platforms

[Device.NTamd64]

%VID_04B4&PID_00F3.DeviceDesc%=MyDevice, USB\VID_04B4&PID_00F3

%VID_04B4&PID_00F0.DeviceDesc%=CYUSB3, USB\VID_04B4&PID_00F0

 

[MyDevice]

CopyFiles=CYUSB3.Files.Ext,MyDevice.Files.Ext

AddReg=CYUSB3.AddReg

 

[MyDevice.HW]

AddReg=MyDevice.AddReg.Guid

 

[MyDevice.Services]

Addservice = CYUSB3,2,CYUSB3.AddService

 

[MyDevice.NT]

CopyFiles=CYUSB3.Files.Ext, MyDevice.Files.Ext

AddReg=CYUSB3.AddReg

 

[MyDevice.NT.HW]

AddReg=MyDevice.AddReg.Guid

 

[MyDevice.NT.Services]

Addservice = CYUSB3,2,CYUSB3.AddService

 

[MyDevice.NTx86]

CopyFiles=CYUSB3.Files.Ext, MyDevice.Files.Ext

AddReg=CYUSB3.AddReg

 

[MyDevice.NTx86.HW]

AddReg=MyDevice.AddReg.Guid

 

[MyDevice.NTx86.Services]

Addservice = CYUSB3,2,CYUSB3.AddService

 

[MyDevice.NTamd64]

CopyFiles=CYUSB3.Files.Ext, MyDevice.Files.Ext

AddReg=CYUSB3.AddReg

 

[MyDevice.NTamd64.HW]

AddReg=MyDevice.AddReg.Guid

 

[MyDevice.NTamd64.Services]

Addservice = CYUSB3,2,CYUSB3.AddService

 

[MyDevice.AddReg.Guid]

HKR,,DriverGUID,,%CYUSB3.GUID%

HKR,,DriverEXECSCRIPT,,%MyDevice.EXECSCRIPT%

 

[MyDevice.Files.Ext]

MyDevice.spt

 

[CYUSB3.NT]

CopyFiles=CYUSB3.Files.Ext

AddReg=CYUSB3.AddReg

 

[CYUSB3.NT.HW]

AddReg=CYUSB3.AddReg.Guid

 

[CYUSB3.NT.Services]

Addservice = CYUSB3,2,CYUSB3.AddService

 

 

[CYUSB3.NTx86]

CopyFiles=CYUSB3.Files.Ext

AddReg=CYUSB3.AddReg

 

[CYUSB3.NTx86.HW]

AddReg=CYUSB3.AddReg.Guid

 

[CYUSB3.NTx86.Services]

Addservice = CYUSB3,2,CYUSB3.AddService

 

[CYUSB3.NTamd64]

CopyFiles=CYUSB3.Files.Ext

AddReg=CYUSB3.AddReg

 

[CYUSB3.NTamd64.HW]

AddReg=CYUSB3.AddReg.Guid

 

[CYUSB3.NTamd64.Services]

Addservice = CYUSB3,2,CYUSB3.AddService

 

 

[CYUSB3.AddReg]

; Deprecating - do not use in new apps to identify a CYUSB3 driver

HKR,,DevLoader,,*ntkern

HKR,,NTMPDriver,,CYUSB3.sys

; You may optionally include a check for DriverBase in your application to check for a CYUSB3 driver

HKR,,DriverBase,,CYUSB3.sys

HKR,"Parameters","MaximumTransferSize",0x10001,4096

HKR,"Parameters","DebugLevel",0x10001,2

HKR,,FriendlyName,,%CYUSB3_Description%

 

[CYUSB3.AddService]

DisplayName    = %CYUSB3_Description%

ServiceType    = 1                  ; SERVICE_KERNEL_DRIVER

StartType      = 3                  ; SERVICE_DEMAND_START

ErrorControl   = 1                  ; SERVICE_ERROR_NORMAL

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

AddReg         = CYUSB3.AddReg

LoadOrderGroup = Base

 

[CYUSB3.Files.Ext]

CYUSB3.sys

 

[CYUSB3.AddReg.Guid]

HKR,,DriverGUID,,%CYUSB3.GUID%

 

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

[SourceDisksFiles]

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

 

[DestinationDirs]

CoInstaller_CopyFiles = 11

 

[CYUSB3.NTamd64.CoInstallers]

AddReg=CoInstaller_AddReg

CopyFiles=CoInstaller_CopyFiles

 

[CYUSB3.NTx86.CoInstallers]

AddReg=CoInstaller_AddReg

CopyFiles=CoInstaller_CopyFiles

 

[CoInstaller_CopyFiles]

WdfCoInstaller01009.dll

 

[CoInstaller_AddReg]

HKR,,CoInstallers32,0x00010000, "WdfCoInstaller01009.dll,WdfCoInstaller"

 

[CYUSB3.NTamd64.Wdf]

KmdfService = CYUSB3, CYUSB3_wdfsect

 

[CYUSB3.NTx86.Wdf]

KmdfService = CYUSB3, CYUSB3_wdfsect

 

[CYUSB3_wdfsect]

KmdfLibraryVersion = 1.9

 

 

[Strings]

CYUSB3_Provider    = "Cypress"

CYUSB3_Company     = "Cypress Semiconductor Corporation"

CYUSB3_Description = "Cypress Generic USB3.0 Driver"

CYUSB3_DisplayName = "Cypress USB3.0 Generic"

CYUSB3_Install     = "Cypress CYUSB3.0 Driver Installation Disk"

VID_04B4&PID_00F3.DeviceDesc="Cypress USB BootLoader"

VID_04B4&PID_00F0.DeviceDesc="Cypress BULK LOOP"

CYUSB3.GUID="{AE18AA60-7F6A-11d4-97DD-00010229B959}"

CYUSB3_Unused      = "."

MyDevice.EXECSCRIPT="\systemroot\system32\MyDevice\MyDevice.spt"