Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1 25
However, each thread requires a set of resources (memory for context data
structures and thread stack, as well as a CPU execution time); and there will be a
practical limit which is application specific.
ThreadX assigns thread priorities ranging from 0 to 31, with 0 being the highest
priority. It is expected that the highest thread priorities are reserved for the driver
threads described in section 5.2.2. User level application threads are
recommended to use priorities ranging from 8 and lower.
While the ThreadX scheduler supports Pre-emption and time slicing, it is
recommended that a co-operative scheduling mechanism be used in FX3 firmware
applications. The FX3 drivers and APIs have only been tested under co-operative
scheduling conditions, and the use of time slices can cause errors.
5.2.2 Driver Threads
The FX3 firmware framework makes use of a set of driver threads, which are
started up before the user hook for application definition (CyFxApplicationDefine) is
called. The table below shows the threads that are started up by the FX3
framework.
DMA driver that handles various DMA
related interrupts from all hardware blocks
in the FX3 device. This thread implements
most of the data processing logic
associated with manual DMA channels.
PIB/GPIF driver that handles GPIF and
MMC Slave related interrupts.
Serial peripheral driver that handles
interrupts raised by all serial peripheral
interfaces (UART, I2C, SPI, I2S and
GPIO) on the FX3 device.
USB driver thread that handles all USB
related interrupts (USB 3.0, USB 2.0, and
USB 2.0 host/OTG) on the FX3 device.
Debug log handler. Takes care of sending
CyU3PDebugPrint and CyU3PDebugLog
messages out through the selected debug
port.
Storage driver that handles SD/MMC
interface related interrupts and processes
device hotplug events.
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.