Page 1
Cypress EZ-USB® FX3™ SDK Quick Start Guide Version 1.3.1 Cypress Semiconductor 198 Champion Court San Jose, CA 95134-1709 Phone (USA): 800.858.1810 Phone (Intl): 408.943.2600 http://www.cypress.com Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
Page 2
PARTICULAR PURPOSE. Cypress reserves the right to make changes without further notice to the materials described herein. Cypress does not assume any liability arising out of the application or use of any product or circuit described herein. Cypress does not authorize its products for use as critical components in life-support systems where a malfunction or failure may reasonably be expected to result in significant injury to the user.
Embedded Operating System ................... 24 Memory Usage ........................26 USB Device Handling ......................27 Support for different FX3 parts ..................30 Porting Applications from SDK 1.2 to SDK 1.2.1 ............... 31 Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
Page 4
CX3 MIPI CSI-2 Interface ......................44 Introduction to the CX3 device ..................44 CX3 MIPI CSI-2 interface ....................45 Configuring the CX3 MIPI CSI-2 Interface................. 49 Fixed function GPIF-2 interface on the CX3 ..............55 Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
FX3 SDK Device Overview Cypress EZ-USB FX3 is the next generation USB3.0 peripheral controller which is highly integrated, flexible and enables system designers to add USB 3.0 capability to any system. The EZ-USB FX3S device is an extension to the FX3 device, which adds the capability to control SD, eMMC and SDIO peripherals to the list of features supported.
EEPROM). FX3 SDK Overview Cypress delivers the complete software and firmware stack for FX3/FX3S/CX3 in order to easily integrate all USB applications in the embedded system environment. The software development kit comes with application examples which help accelerate application development.
Isochronous or Bulk endpoints. FX3 DVK Board Overview Cypress provides a FX3 DVK board that can be used for firmware and system development using the FX3 device. The DVK board provides the means to connect an external processor or device to the GPIF interface and to connect slave devices to the I2C, SPI and I2S interfaces.
Page 8
Please refer to the FX3 DVK User Guide for additional information regarding the DVK board. Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
“Custom” option on the installer. The default installation path for the FX3 SDK is: C:\Program Files\Cypress\EZ-USB FX3 SDK\<version>, where 1.3 is the version for this release of the SDK. Note: On 64-bit Windows installations, the default installation path for the SDK is: C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\<version>...
Installed Directory Structure The following figure shows the FX3 firmware related files in the FX3 SDK installation. Figure 2-1: FX3 SDK Installed Directory Structure Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
Page 11
The following figure shows the USBSuite related files in the FX3 SDK installation. C# Sample Applications C++ Sample Applications CyUsb3.sys driver C# API library C++ API library Figure 2-2: USBSuite Installed Directory Structure Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
The instructions for building and running the Firmware examples using the Eclipse IDE and GNU tool-chain are provided in detail in Section 11.2.2 of the FX3 Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
The steps for installation and binding of the host drivers for different Windows platforms are described in section 3 of the host driver help file, CyUSB.pdf, installed as part of the USB Suite. Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
USB 2.0 device with VID=0x04B4 and PID=0x00F3. Select the “Install from a specific location” and point to the <Installation Root>/driver/bin/<os>/<arch>/cyusb3.inf file to bind the device with the Cypress CyUsb3.sys driver. To bind with a new device or application with a different VID/PID pair; the corresponding VID/PID entries must be made in the cyusb3.inf file.
9. cyfxbulklpmulticast: This example makes use of the Multichannel DMA MULTICAST for the loopback between endpoints. 10. cyfxbulklpman_removal: This example demonstrates the use of DMA MANUAL channels where a header and footer get removed from the data before sending Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
FX3S device. 2. GpifToStorage: Example that shows how to access SD/eMMC storage devices from an external processor that connects to the FX3S device through the GPIF port. Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
3. cyfxslaveasync5bit: Asynchronous mode Slave FIFO example using 5 bit FIFO address. 4. cyfxslavesync5bit: Synchronous mode Slave FIFO example using 5 bit FIFO address. The above examples are implemented to work at USB 2.0 and USB 3.0 speeds. Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
3. cyfxusbspigpiomode: This example demonstrates the use of GPIO to build an SPI master. The example read / writes data to an SPI Flash attached to the FX3 device using FX3 GPIOs. Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
USB Bulk Streams example This example illustrates data source and data sink mechanism with two USB Bulk Endpoints using the Bulk Streams. A set of Bulk Streams are defined for each of the Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
A simple set of APIs have been provided as a separate library to implement two stage booting. This example demonstrates the use of these APIs. Configuration files that can be used for Real View Tool chain are also provided. Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
CX3 APIs using an Omnivision OV5640 sensor. This example streams Uncompressed 16-Bit YUV video from the image sensor over the CX3 to the host PC. Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
>setSysClk400 parameter passed to this function needs to be set to CyTrue to enable this frequency change. If this parameter is set to CyTrue, the firmware causes the master clock frequency to be changed to 403.2 MHz. Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
Page 23
If the firmware application makes use of any CPU bound data copy actions, turning the data cache on will improve the performance significantly. The instruction and data caches are enabled/disabled using the CyU3PDeviceCacheControl() API. Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
(fx3_release) build. 5.2.1 Execution Model The ThreadX operating system supports the creation of multiple threads with different priority levels. There is no direct restriction on the number of threads. Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
Page 25
All of the driver thread stacks are created on the Memory Heap that is initialized through the CyU3PMemInit() function. The FX3 framework code requires about 10 KB of space in this memory heap. Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
Mem Heap: This is a heap region that is used for runtime allocation of thread resources like stacks and message queues. The FX3 firmware library requires 10 KB of memory from this heap. Additional memory will be Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
The advantage of this model is that allows the application to implement any number of configurations and provides greater flexibility. The model of enumeration is selected using the CyU3PUsbRegisterSetupCallback() API. Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
Page 28
(receives two full packets) or if a short packet is received. If only one full packet is Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
Page 29
In the case of other endpoints, it is possible that the data transfer be blocked because the link is stuck in a low power mode. It is recommended that any applications that do not use the CyU3PUsbLPMDisable() API, should call the Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
1. If using the full firmware library: i. Copy the contents of the fx3_256k.ld file into the fx3.ld file. The original linker settings will still be available in the fx3_512k.ld file. Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
Please refer to the Release Notes document for details on the defect fixes and feature additions that have been included. The following points can be considered to make better use of the SDK changes in the application. Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
Page 32
CyU3PConnectState() API has not been called. It is possible for a self-powered FX3 application to wait until the Vbus voltage is available before enabling the USB connection through the CyU3PConnectState() API. Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
This change means that buffers placed in the runtime stack can no longer be used for DMA transfers. The CY_FX3_BOOT_ERROR_INVALID_DMA_ADDR error code will be returned by the CyFx3BootUsbDmaXferData, CyFx3BootSpiDmaXferData, CyFx3BootI2cDmaXferData and CyFx3BootUartDmaXferData APIs if a DTCM address is used for the DMA buffer. Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
1. The lvGpioState field has been added to the CyU3PSibIntfParams_t structure passed to the CyU3PSibSetIntfParams API. This field should be initialized with the polarity of the GPIO used for SD voltage control. Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
The easiest way to create a new FX3 firmware project under the Eclipse IDE, is to import an existing project; and make changes to it. 1. Start the EZ USB Suite IDE from the Cypress group in the Start Menu. When prompted for workspace selection, provide a path to an existing workspace, or type in the path where the new workspace is to be created.
Page 36
Figure 6-2: Project Import Dialog 3. In the “Browse for Folder” window that pops up, navigate into the firmware/basic_examples/cyfxgpiftousb folder in the FX3 SDK installation. Figure 6-3: Folder Browse Dialog Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
Page 37
The respective source files in the project can also be renamed as desired. If the header files are renamed, references to the header file in the source files will need to be updated. Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
7. Build the project to verify that the project import and renaming is successful. Application Description 6.2.1 Application Outline The GpifToUsb example demonstrates moving data from the GPIF-II port of the FX3 device to the USB port through a BULK-IN endpoint. Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
Page 39
ARM9 CPU. Once these functions are performed, the entry jumps back to the CyU3PToolChainInit function that is defined in the cyfx_gcc_startup.S file. Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
Page 40
CyTrue in the device IO configuration. Steps 1 through 4 are expected to be similar in all FX3 applications. Only the parameters passed to the functions will change based on the system design. Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
Page 41
USB descriptors with the USB driver. At a minimum, the USB 2.0 and 3.0 device descriptors; the USB-FS, HS and SS configuration descriptors; and the BOS descriptor should be registered using this API call. Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
Page 42
The CyU3PGpifLoad API is used to load the GPIF-II state machine configuration onto the device registers. The configuration data is taken from the cyfxgpif2config.h header file. Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
Page 43
12. The application identifies a USB disconnect event through the USB event callback. It then de-initializes the DMA channel, the GPIF state machine and the USB endpoints through the CyFxApplnStop function. Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
CX3 Receiver Configuration tool available as part of the Cypress EZ USB Suite Eclipse based IDE. More details on the CX3 part are available on the Cypress website at http://www.cypress.com/cx3/...
RGB 666 format 24- bits CY_U3P_CSI_DF_RGB666_1 0x23 Mode 1 per pixel data stream. B[5:0] 24 Bit Output: RGB565 RGB 565 format 24- bits 2‟b0,R[4:0],3‟b0,G[5:0], CY_U3P_CSI_DF_RGB565_0 0x22 Mode 0 per pixel data stream. 2‟b0,B[4:0],1‟b0 Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
Page 46
PLL and multiple clock dividers on the PLL generated clock. Clock configuration parameters are a part of the CyU3PMipicsiCfg_t structure which passed to the CyU3PMipicsiSetIntfParams() API to configure the CSI-2 interface. Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
Page 47
0 if PLL Clock is between 500MHz- 1GHz. 1 if PLL Clock is between 250MHz- 500MHz. 2 if PLL Clock is between 125MHz- 250MHz. 3 if PLL Clock is between 62.5MHz- 125MHz. E.g.: Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
Page 48
4, mClkCtl to 0x0203 to get MCLK = (672/4) / ((2+1) + (3+1)) = 168/ 7 = 24 MHz The MCLK is only output when both HighByte(mClkCtl) and LowByte(mClkCtl) are non-zero. Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
A preliminary release of a graphical tool (CX3 Receiver Configuration Tool) that can be used to generate the CyU3PMipicsiCfg_t structure object is provided as part of the EZ-USB Suite Eclipse based IDE provided by Cypress. This section provides the steps required to create the configuration data from the graphical tool.
Page 50
„/*‟ or „*/‟. Figure 7-6: Configuration Name Selection 4. Configure the MIPI CSI-2 Inputs The MIPI CSI-2 inputs section should be configured to match the Image Sensor‟s output parameters. Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
Page 51
Value, PLL Out Range and Multiplier of Unit Clock are used to generate the pllPRD, pllFbd and pllFrs parameters which provide the PLL_CLK frequency using the equation listed in Section 7.2.3 above. Figure 7-8: CSI-2 Interface Configuration Parameters Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
Page 52
RED color as shown in the following image and a small RED x mark is shown to the right of the input box. Hovering over the x will show the user the permitted values for the field. Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
Page 53
C file using the provided export options. The user can also copy just the structure and use in their source files. Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
Page 54
Please note that error and warning messages are only displayed for the active configuration that is displayed. Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
Application Note on “How to interface a MIPI CSI-2 Image Sensor with EZ-USB® CX3” which will be made available from the Cypress website. Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
Page 56
Socket 0, in Socket 1, Socket 0, Socket 1, Intr CPU Intr CPU Intr CPU Intr CPU Figure 7-20: CX3 Fixed Function GPIFII State Machine Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1...
Need help?
Do you have a question about the EZ-USB FX3 SDK and is the answer not in the manual?
Questions and answers