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

OTG_FS_DOEPTSIZx with the data PID of the last isochronous OUT data packet read<br />

from the receive FIFO.<br />

Application programming sequence:<br />

1. Program the OTG_FS_DOEPTSIZx register for the transfer size and the corresponding<br />

packet count<br />

2. Program the OTG_FS_DOEPCTLx register with the endpoint characteristics and set<br />

the Endpoint Enable, ClearNAK, and Even/Odd frame bits.<br />

– EPENA = 1<br />

– CNAK = 1<br />

– EONUM = (0: Even/1: Odd)<br />

3. Wait for the RXFLVL interrupt (in OTG_FS_GINTSTS) and empty the data packets from<br />

the receive FIFO<br />

– This step can be repeated many times, depending on the transfer size.<br />

4. The assertion of the XFRC interrupt (in OTG_FS_DOEPINTx) marks the completion of<br />

the isochronous OUT data transfer. This interrupt does not necessarily mean that the<br />

data in memory are good.<br />

5. This interrupt cannot always be detected for isochronous OUT transfers. Instead, the<br />

application can detect the IISOOXFRM interrupt in OTG_FS_GINTSTS.<br />

6. Read the OTG_FS_DOEPTSIZx register to determine the size of the received transfer<br />

and to determine the validity of the data received in the frame. The application must<br />

treat the data received in memory as valid only if one of the following conditions is met:<br />

– RXDPID = D0 (in OTG_FS_DOEPTSIZx) and the number of USB packets in<br />

which this payload was received = 1<br />

– RXDPID = D1 (in OTG_FS_DOEPTSIZx) and the number of USB packets in<br />

which this payload was received = 2<br />

– RXDPID = D2 (in OTG_FS_DOEPTSIZx) and the number of USB packets in<br />

which this payload was received = 3<br />

The number of USB packets in which this payload was received =<br />

Application programmed initial packet count – Core updated final packet count<br />

The application can discard invalid data packets.<br />

● Incomplete isochronous OUT data transfers<br />

This section describes the application programming sequence when isochronous OUT data<br />

packets are dropped inside the core.<br />

Internal data flow:<br />

1. For isochronous OUT endpoints, the XFRC interrupt (in OTG_FS_DOEPINTx) may not<br />

always be asserted. If the core drops isochronous OUT data packets, the application<br />

could fail to detect the XFRC interrupt (OTG_FS_DOEPINTx) under the following<br />

circumstances:<br />

– When the receive FIFO cannot accommodate the complete ISO OUT data packet,<br />

the core drops the received ISO OUT data<br />

– When the isochronous OUT data packet is received with CRC errors<br />

– When the isochronous OUT token received by the core is corrupted<br />

– When the application is very slow in reading the data from the receive FIFO<br />

2. When the core detects an end of periodic frame before transfer completion to all<br />

isochronous OUT endpoints, it asserts the incomplete Isochronous OUT data interrupt<br />

1137/1416 Doc ID 018909 Rev 3

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

Saved successfully!

Ooh no, something went wrong!