09.12.2012 Views

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

USB on-the-go full-speed (OTG_FS) <strong>RM0090</strong><br />

Host channel status/interrupt<br />

The host channel-x interrupt register (HCINTx) indicates the status of an endpoint with<br />

respect to USB- and AHB-related events. The application must read these register when the<br />

host channels interrupt bit in the core interrupt register (HCINT bit in OTG_FS_GINTSTS) is<br />

set. Before the application can read these registers, it must first read the host all channels<br />

interrupt (HCAINT) register to get the exact channel number for the host channel-x interrupt<br />

register. The application must clear the appropriate bit in this register to clear the<br />

corresponding bits in the HAINT and GINTSTS registers. The mask bits for each interrupt<br />

source of each channel are also available in the OTG_FS_HCINTMSK-x register.<br />

● The host core provides the following status checks and interrupt generation:<br />

– Transfer completed interrupt, indicating that the data transfer is complete on both<br />

the application (AHB) and USB sides<br />

– Channel has stopped due to transfer completed, USB transaction error or disable<br />

command from the application<br />

– Associated transmit FIFO is half or completely empty (IN endpoints)<br />

– ACK response received<br />

– NAK response received<br />

– STALL response received<br />

– USB transaction error due to CRC failure, timeout, bit stuff error, false EOP<br />

– Babble error<br />

– fraMe overrun<br />

– dAta toggle error<br />

30.6.4 Host scheduler<br />

The host core features a built-in hardware scheduler which is able to autonomously re-order<br />

and manage the USB transaction requests posted by the application. At the beginning of<br />

each frame the host executes the periodic (isochronous and interrupt) transactions first,<br />

followed by the nonperiodic (control and bulk) transactions to achieve the higher level of<br />

priority granted to the isochronous and interrupt transfer types by the USB specification.<br />

The host processes the USB transactions through request queues (one for periodic and one<br />

for nonperiodic). Each request queue can hold up to 8 entries. Each entry represents a<br />

pending transaction request from the application, and holds the IN or OUT channel number<br />

along with other information to perform a transaction on the USB. The order in which the<br />

requests are written to the queue determines the sequence of the transactions on the USB<br />

interface.<br />

At the beginning of each frame, the host processes the periodic request queue first, followed<br />

by the nonperiodic request queue. The host issues an incomplete periodic transfer interrupt<br />

(IPXFR bit in OTG_FS_GINTSTS) if an isochronous or interrupt transaction scheduled for<br />

the current frame is still pending at the end of the current frame. The OTG HS core is fully<br />

responsible for the management of the periodic and nonperiodic request queues.The<br />

periodic transmit FIFO and queue status register (HPTXSTS) and nonperiodic transmit<br />

1031/1416 Doc ID 018909 Rev 3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!