English
Language : 

RM0383 Datasheet, PDF (773/837 Pages) STMicroelectronics – This Reference manual targets application developers
RM0383
USB on-the-go full-speed (OTG_FS)
completed. After this entry is popped from the receive FIFO, the core asserts a
Transfer Completed interrupt on the specified OUT endpoint.
5. After the data payload is popped from the receive FIFO, the RXFLVL interrupt
(OTG_FS_GINTSTS) must be unmasked.
6. Steps 1–5 are repeated every time the application detects assertion of the interrupt line
due to RXFLVL in OTG_FS_GINTSTS. Reading an empty receive FIFO can result in
undefined core behavior.
Figure 258 provides a flowchart of the above procedure.
Figure 258. Receive FIFO packet read
wait until RXFLVL in OTG_FS_GINTSTSG
rd_data = rd_reg (OTG_FS_GRXSTSP);
packet
store in
memory
Y
rd_data.BCNT = 0
N
mem[0: word_cnt – 1] =
rd_rxfifo(rd_data.EPNUM,
word_cnt)
rcv_out_pkt ()
word_cnt =
BCNT[11:2] +
(BCNT[1] | BCNT[1])
ai15677b
• SETUP transactions
This section describes how the core handles SETUP packets and the application’s
sequence for handling SETUP transactions.
• Application requirements
1. To receive a SETUP packet, the STUPCNT field (OTG_FS_DOEPTSIZx) in a control
OUT endpoint must be programmed to a non-zero value. When the application
programs the STUPCNT field to a non-zero value, the core receives SETUP packets
and writes them to the receive FIFO, irrespective of the NAK status and EPENA bit
setting in OTG_FS_DOEPCTLx. The STUPCNT field is decremented every time the
control endpoint receives a SETUP packet. If the STUPCNT field is not programmed to
a proper value before receiving a SETUP packet, the core still receives the SETUP
packet and decrements the STUPCNT field, but the application may not be able to
DocID026448 Rev 1
773/836
796