09.12.2012 Views

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

USB on-the-go high-speed (OTG_HS) <strong>RM0090</strong><br />

The following transfer parameters can be programmed:<br />

● Transfer size in bytes<br />

● Number of packets constituting the overall transfer size<br />

● Initial data PID<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_HS_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_HS_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 the<br />

application (AHB) and USB sides<br />

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

from the application<br />

● Associated transmit FIFO 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 />

31.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 the 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_HS_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 />

1167/1416 Doc ID 018909 Rev 3

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

Saved successfully!

Ooh no, something went wrong!