Modifying CyUSB3.INF |
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
|