6Cypress CyUsb3.sys Programmer's Reference
? 2012 Cypress Semiconductor
Modifying CyUSB3.INF72Modifying CyUSB3.INF
The CYUSB3.INF file can be modified to accomplish several different objectives. These are: 1. Add a device's identifiers to the driver2. Replace Cypress strings that are displayed during driver installation3. 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] andremove 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 theabove 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=\ 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=\ Replace Cypress strings If you plan to do more than just add your device's VID/PID to the CYUSB3.INF file, it is stronglyrecommended 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 namedcopy 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.? 2012 Cypress Semiconductor
8Cypress CyUsb3.sys Programmer's Reference 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, multipleinstances of CYUSB3.SYS from different hardware vendors can exist on a given system withoutcolliding. 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=\18AA60-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-upThe CYUSB3.SYS driver can be used to perform transfers to the default control endpoint (endpointaddress 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 theUSB device, thereby modifying its \f thisre-enumeration occurs with the same VID/PID as the original \again and again in an un-ending loop.
To avoid this endless loop scenario, the second personality should enumerate with a different VID/PIDthan 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 thedriver 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.
? 2012 Cypress Semiconductor
Modifying CyUSB3.INF91. 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 of04B4/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 FX3boot commands.Sample CYUSB3.INF file using the CyScript feature with VID-0x04B4 and PID-0x00F3 and0x00F0 ; 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=\NDOWS NT$\Class=USB
ClassGUID={36FC9E60-C465-11CF-8056-444553540000}provider=%CYUSB3_ProviderêtalogFile=CYUSB3.cat
DriverVer=01/23/2012,1.0.0.01[SourceDisksNames]1=%CYUSB3_Install%,,,[SourceDisksFiles]CYUSB3.sys = 1
[DestinationDirs]CYUSB3.Files.Ext = 10,System32\\DriversMyDevice.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
? 2012 Cypress Semiconductor
10Cypress CyUsb3.sys Programmer's Reference;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.ExtAddReg=CYUSB3.AddReg [MyDevice.HW]
AddReg=MyDevice.AddReg.Guid
[MyDevice.Services]
Addservice = CYUSB3,2,CYUSB3.AddService [MyDevice.NT]
CopyFiles=CYUSB3.Files.Ext, MyDevice.Files.ExtAddReg=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.ExtAddReg=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.ExtAddReg=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.ExtAddReg=CYUSB3.AddReg[CYUSB3.NT.HW]
? 2012 Cypress Semiconductor