
USB on-the-go full-speed (OTG_FS)
RM0351
1636/1830
DocID024597 Rev 5
The mask bits for each interrupt source of each channel are also available in the
OTG_HCINTMSKx register.
•
The host core provides the following status checks and interrupt generation:
–
Transfer completed interrupt, indicating that the data transfer is complete on both
the application (AHB) and USB sides
–
Channel has stopped due to transfer completed, USB transaction error or disable
command from the application
–
Associated transmit FIFO is half or completely empty (IN endpoints)
–
ACK response received
–
NAK response received
–
STALL response received
–
USB transaction error due to CRC failure, timeout, bit stuff error, false EOP
–
Babble error
–
frame overrun
–
data toggle error
47.7.4 Host
scheduler
The host core features a built-in hardware scheduler which is able to autonomously re-order
and manage the USB transaction requests posted by the application. At the beginning of
each frame the host executes the periodic (isochronous and interrupt) transactions first,
followed by the nonperiodic (control and bulk) transactions to achieve the higher level of
priority granted to the isochronous and interrupt transfer types by the USB specification.
The host processes the USB transactions through request queues (one for periodic and one
for nonperiodic). Each request queue can hold up to 8 entries. Each entry represents a
pending transaction request from the application, and holds the IN or OUT channel number
along with other information to perform a transaction on the USB. The order in which the
requests are written to the queue determines the sequence of the transactions on the USB
interface.
At the beginning of each frame, the host processes the periodic request queue first, followed
by the nonperiodic request queue. The host issues an incomplete periodic transfer interrupt
(IPXFR bit in OTG_GINTSTS) if an isochronous or interrupt transaction scheduled for the
current frame is still pending at the end of the current frame. The OTG_FS core is fully
responsible for the management of the periodic and nonperiodic request queues.The
periodic transmit FIFO and queue status register (OTG_HPTXSTS) and nonperiodic
transmit FIFO and queue status register (OTG_HNPTXSTS) are read-only registers which
can be used by the application to read the status of each request queue. They contain:
•
The number of free entries currently available in the periodic (nonperiodic) request
queue (8 max)
•
Free space currently available in the periodic (nonperiodic) Tx FIFO (out-transactions)
•
IN/OUT token, host channel number and other status information.
As request queues can hold a maximum of 8 entries each, the application can push to
schedule host transactions in advance with respect to the moment they physically reach the
SB for a maximum of 8 pending periodic transactions plus 8 pending nonperiodic
transactions.
To post a transaction request to the host scheduler (queue) the application must check that
there is at least 1 entry available in the periodic (nonperiodic) request queue by reading the