USB on-the-go high-speed (OTG_HS)
RM0090
1514/1731
DocID018909 Rev 11
Figure 426. Slave mode bulk OUT transaction
After a SetConfiguration/SetInterface command, the application initializes all OUT endpoints
by setting CNAK = 1 and EPENA = 1 (in OTG_HS_DOEPCTLx), and setting a suitable
XFRSIZ and PKTCNT in the OTG_HS_DOEPTSIZx register.
1.
Host attempts to send data (OUT token) to an endpoint.
2. When the core receives the OUT token on the USB, it stores the packet in the RxFIFO
because space is available there.
3. After writing the complete packet in the RxFIFO, the core then asserts the RXFLVL
interrupt (in OTG_HS_GINTSTS).
4. On receiving the PKTCNT number of USB packets, the core internally sets the NAK bit
for this endpoint to prevent it from receiving any more packets.
5. The application processes the interrupt and reads the data from the RxFIFO.
6. When the application has read all the data (equivalent to XFRSIZ), the core generates
an XFRC interrupt (in OTG_HS_DOEPINTx).
7. The application processes the interrupt and uses the setting of the XFRC interrupt bit
(in OTG_HS_DOEPINTx) to determine that the intended transfer is complete.
IN data transfers
•
Packet write
This section describes how the application writes data packets to the endpoint FIFO in Slave
mode when dedicated transmit FIFOs are enabled.
init_out_ep
Host
Device
USB
OUT
ACK
RXFLVL intr
i
wr_reg (DOEPTSIZx)
wr_reg(DOEPCTLx)
512 bytes
OUT
NAK
xact_1
Application
XFRC
intr
DOEPCTLx.NA
K=1
PKTCNT 0
XFRSIZ = 0
r
idle until intr
rcv_out _pkt()
idle until intr
On new xfer
or RxFIFO
not empty
1
2
3
4
5
6
7
8
XFRSIZ = 512 bytes
PKTCNT = 1
EPENA = 1
CNAK = 1
ai15679