FX3 Programmers Manual, Doc. # 001-64707 Rev. *C 59
FX3 Firmware
The thread stacks are allocated from the RTOS managed heap area using the CyU3PMemAlloc()
function.
5.1.3.6 DMA buffer area
DMA buffer area is managed by helper functions provided as source incyfxtx.cfile. These are
CyU3PDmaBufferInit(), CyU3PDmaBufferAlloc(), CyU3PDmaBufferFree()
and
CyU3PDmaBufferDeInit(). All available memory above the RTOS managed heap to the top of
the SYS_MEM is allocated as the DMA buffer area.
The memory allocated for this region can be modified by changing the definition for the following in
cyfxtx.c.
#define CY_U3P_BUFFER_HEAP_BASE
((uint32_t) CY_U3P_MEM_HEAP_BASE + CY_U3P_MEM_HEAP_SIZE)
#define CY_U3P_BUFFER_HEAP_SIZE
(CY_U3P_SYS_MEM_TOP - CY_U3P_BUFFER_HEAP_BASE)
5.2 API Library
A full fledged API library is provided in the FX3 SDK. The API library 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
5.2.1 USB Block
The FX3 device has a USB-OTG PHY built-in and is capable of:
■ USB peripheral - super speed, high speed, and full speed
■ USB host - high speed and full speed only
■ Charger detection
The USB driver provided as part of the FX3 firmware is responsible for handling all the USB
activities. The USB driver runs as a separate thread and must be initialized from the user application.
After initialization, the USB driver is ready to accept commands from the application to configure the
USB interface of the FX3.
The USB driver handles both the USB device mode and the USB host mode of operation.