EasyManua.ls Logo

Cypress EZ-USB FX3 SDK - Memory Usage

Cypress EZ-USB FX3 SDK
56 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1 26
When implementing a typical USB 3.0 device application, the USB and DMA driver
threads are expected to be very active, with the other threads becoming active
quite rarely.
5.2.3 Callback Functions
The FX3 APIs allow users to register a set of callback functions which will called by
the FX3 driver modules s when events of interest occur.
Typically, these callback functions are invoked from the respective driver threads.
For example, the DMA callback functions are called from the DMA driver thread;
and the USB callback (setup as well as event callbacks) are called from the USB
driver thread. As the callback functions are called from the driver threads, they
have the same priorities as the driver threads. This means that DMA callback
functions take higher priority than any other type of callback in the FX3 system.
This is desirable because prompt handling of DMA events is required to achieve
the best possible throughput for USB applications.
The GPIO interrupt callback is an exception to the above rule that callback
functions are invoked from the driver thread. In this case, the callback function is
called from the GPIO interrupt handler itself. Therefore, it is not possible to make
any blocking API calls from a GPIO callback function.
It is possible to make blocking API calls from other callback functions like DMA or
USB callbacks. However, such usage should be restricted because blocking within
a callback will delay other operations to be performed by the driver thread. For
example, blocking within a DMA callback will delay the processing of DMA
interrupts on all channels in the system.
Note: The CyU3PDebugPrint() function is a blocking API call that waits until a DMA
buffer is available for data transfer. Therefore, use of the CyU3PdebugPrint from
within a DMA or USB callback function should be avoided.
5.3 Memory Usage
An FX3 firmware application requires the following memory regions:
Code: This is where all the executable code for the application goes. Part of
the code can be placed in the I-TCM of the FX3 device for faster execution.
The space required for this regions is application specific, and will be lesser
for release builds of the firmware.
Data: This region contains all initialized data variables in the FX3
application. The space required for this region is application specifix.
BSS: This region contains all zero initialized data variables in the
application.
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