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 />

30.10 USB data FIFOs<br />

The USB system features 1.25 Kbyte of dedicated RAM with a sophisticated FIFO control<br />

mechanism. The packet FIFO controller module in the OTG_FS core organizes RAM space<br />

into Tx-FIFOs into which the application pushes the data to be temporarily stored before the<br />

USB transmission, and into a single Rx FIFO where the data received from the USB are<br />

temporarily stored before retrieval (popped) by the application. The number of instructed<br />

FIFOs and how these are organized inside the RAM depends on the device’s role. In<br />

peripheral mode an additional Tx-FIFO is instructed for each active IN endpoint. Any FIFO<br />

size is software configured to better meet the application requirements.<br />

30.11 Peripheral FIFO architecture<br />

Figure 362. Device-mode FIFO address mapping and AHB FIFO access mapping<br />

IN endpoint Tx FIFO #n<br />

DFIFO push access<br />

from AHB<br />

IN endpoint Tx FIFO #1<br />

DFIFO push access<br />

from AHB<br />

Any OUT endpoint DFIFO pop<br />

access from AHB<br />

30.11.1 Peripheral Rx FIFO<br />

MAC pop<br />

MAC pop<br />

Dedicated Tx<br />

FIFO #n control<br />

(optional)<br />

Dedicated Tx<br />

FIFO #1 control<br />

(optional)<br />

IN endpoint Tx FIFO #0 Dedicated Tx<br />

DFIFO push access FIFO #0 control<br />

from AHB (optional)<br />

MAC pop<br />

MAC push<br />

Rx FIFO control<br />

The OTG peripheral uses a single receive FIFO that receives the data directed to all OUT<br />

endpoints. Received packets are stacked back-to-back until free space is available in the<br />

Rx-FIFO. The status of the received packet (which contains the OUT endpoint destination<br />

number, the byte count, the data PID and the validity of the received data) is also stored by<br />

the core on top of the data payload. When no more space is available, host transactions are<br />

NACKed and an interrupt is received on the addressed endpoint. The size of the receive<br />

FIFO is configured in the receive FIFO Size register (GRXFSIZ).<br />

1035/1416 Doc ID 018909 Rev 3<br />

.<br />

Single data<br />

FIFO<br />

Tx FIFO #n<br />

packet<br />

.<br />

Tx FIFO #1 packet<br />

Tx FIFO #0 packet<br />

Rx packets<br />

DIEPTXF2[31:16]<br />

DIEPTXFx[15:0]<br />

.<br />

DIEPTXF2[15:0]<br />

DIEPTXF1[31:16]<br />

DIEPTXF1[15:0]<br />

GNPTXFSIZ[31:16]<br />

GNPTXFSIZ[15:0]<br />

GRXFSIZ[31:16]<br />

A1 = 0<br />

(Rx start<br />

address<br />

fixed to 0)<br />

ai15611

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

Saved successfully!

Ooh no, something went wrong!