Datasheet

Migrating from EZ-USB
®
FX2LP™ Based Design to EZ-USB FX3 Based Design
www.cypress.com Document No. 001-76348 Rev. ** 6
FX3 Firmware Stack
Powerful and flexible applications can be rapidly built
using FX3 firmware framework and FX3 API libraries.
Firmware Framework
The firmware (or application) framework has all the startup
and initialization code. The firmware also contains the
individual drivers for the USB, GPIF, and serial interface
blocks. The framework:
Defines the program entry point
Performs the stack setup
Performs kernel initialization
Provides placeholders for application thread startup
code
Firmware API Library
The FX3 API library provides a comprehensive set of APIs
to control and communicate with the FX3 hardware. These
APIs provide a complete programmatic view of the FX3
hardware.
cyfxapi.a
A full-fledged API library is provided in the FX3 SDK. This
API is similar to EZUSB.LIB in case of FX2LP. You do not
have to manually link this library to your project. The path
of this library will be automatically added to your IDE
during the SDK installation.
cyfxapi.a and the corresponding header files provide all
the APIs required for programming the different blocks of
the FX3. The APIs provide for the following:
Programming each of the individual blocks of the FX3
device - GPIF, USB, and serial interfaces
Programming the DMA engine and setting up of data
flows between these blocks
The overall framework for application development,
including system boot and init, OS entry, and
application init
Threadx OS calls as required by the application
Power management features
Programming low-level DMA engine
Debug capability
Embedded Real Time OS
The FX3 firmware framework makes use of an Embedded
Real-Time Operating System. The drivers for various
peripheral blocks in the platform are typically implemented
as separate threads and other OS services, such as
Semaphores, Message Queues, Mutexes, and Timers are
used for inter-thread communication and task
synchronization.
The framework gives hooks for the application logic to
configure the device behavior and to perform data
transfers through it. The application logic itself can be
implemented across multiple threads and make use of all
of the OS services that are used by the Cypress provided
drivers.
The ThreadX operating system from Express Logic is
used as the embedded RTOS in the FX3 device. All of the
functionality supported by the ThreadX OS is made
available for use by the application logic. Some constraints
on their use are placed to ensure the smooth functioning
of all of the drivers.
The ThreadX services are not directly exposed by the
firmware framework. This is to ensure that the application
logic is independent of the OS used and need not be
changed to accommodate a future changes in the
embedded OS. The OS services are made available
through a set of platform specific wrappers that are placed
around them.
BulkLoop Example on FX3
We can do much complex applications with the help of
FX3. But we are taking you through the steps of bulkloop
firmware development to understand the FX3 firmware
framework easily.
Bulkloop example can be found in the location
(Cypress\EZ-USB FX3 SDK\1.0\firmware\dma_examples\
cyfxbulklpauto) after installing the FX3 SDK.
The bulkloop example consists of the following files:
cyfx_gcc_startup.S: FX3 startup code. Explained in
the later sections.
cyfxbulklpauto.h: This file contains the defines used in
cyfxbulklpdscr.c
cyfxbulklpdscr.c: This file contains the USB
descriptors. This file is similar to dscr.a51 in case of
FX2LP.
cyfxtx.c: This file defines the porting required for the
ThreadX RTOS.
This file shall be provided in source form and must be
compiled with the application source code
cyfxbulklpauto.c: This file contains the main
application logic of the bulkloop example. The
application is explained in the subsequent sections.
The entry point for the FX3 firmware is
CyU3PFirmwareEntry() function. The function is
defined in the FX3 API library and is not visible to the user.