29.01.2015 Views

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

RM0008<br />

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

26.10.2 Peripheral Tx FIFOs<br />

The shared FIFO implementation is not viable for IN transactions. Pushing back-to-back<br />

packets into a common Tx FIFO would require to know the host sequence in advance or to<br />

predict it by a learning process. That is why in peripheral mode the core is configured to<br />

have individual dedicated FIFOs for each IN endpoint. The application configures FIFO<br />

sizes by writing the non periodic transmit FIFO size register (GNPTXFSIZ) for IN endpoint0<br />

<strong>and</strong> the device IN endpoint transmit FIFOx registers (DIEPTXFx) for IN endpoint-x.<br />

The dedicated transmit FIFO architecture is more flexible. It puts less load on the application<br />

as there is no need for the application to predict the order in which the USB host is going to<br />

access the IN endpoints.<br />

Depending on the configured value of the non-periodic Tx FIFO empty level bit in the AHB<br />

configuration register (TXFELVL bit in OTG_FS_GAHBCFG) the OTG_FS core indicates<br />

that an IN endpoint Tx-FIFO is half or completely empty using the Tx FIFO empty interrupt<br />

(NPTXFE bit in OTG_FS_GINTSTS). The application reads the device all endpoint interrupt<br />

register (DAINT) to know which IN endpoint needs to be served. The application should<br />

preliminarily check that enough free space is available by reading the device IN endpoint-x<br />

transmit FIFO status register (DTXFSTSx). If so, the application then pushes the transmit<br />

data into the Tx-FIFOn by writing to the endpoint-related push address.<br />

26.11 Host FIFO architecture<br />

Figure 267. Host-mode FIFO address mapping <strong>and</strong> AHB FIFO access mapping<br />

Single data<br />

FIFO<br />

Any periodic channel<br />

DFIFO push access<br />

from AHB<br />

MAC pop<br />

Periodic Tx<br />

FIFO control<br />

(optional)<br />

Periodic Tx packets<br />

HPTXFSIZ[31:16]<br />

HPTXFSIZ[15:0]<br />

Any non-periodic<br />

channel DFIFO push<br />

access from AHB<br />

MAC pop<br />

Non-periodic<br />

Tx FIFO control<br />

Periodic Tx packets<br />

NPTXFSIZ[31:16]<br />

NPTXFSIZ[15:0]<br />

Any channel DFIFO pop<br />

access from AHB<br />

MAC push<br />

Rx FIFO control<br />

Rx packets<br />

RXFSIZ[31:16]<br />

Rx start address<br />

fixed to 0<br />

A1 = 0<br />

ai15610<br />

26.11.1 Host Rx FIFO<br />

The host uses one receiver FIFO for all periodic <strong>and</strong> nonperiodic transactions. The FIFO is<br />

used as a receive buffer to hold the received data (payload of the received packet) from the<br />

USB until it is transferred to the system memory. Packets received from any remote IN<br />

endpoint are stacked back-to-back until free space is available. The status of each received<br />

packet with the host channel destination, byte count, data PID <strong>and</strong> validity of the received<br />

Doc ID 13902 Rev 9 713/995

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

Saved successfully!

Ooh no, something went wrong!