USB on-the-go full-speed (OTG_FS) RM0402
1106/1163 RM0402 Rev 6
1. Put the core in the Global OUT NAK mode.
2. Disable the required endpoint
– When disabling the endpoint, instead of setting the SNAK bit in OTG_DOEPCTL,
set STALL = 1 (in OTG_DOEPCTL).
The STALL bit always takes precedence over the NAK bit.
3. When the application is ready to end the STALL handshake for the endpoint, the
STALL bit (in OTG_DOEPCTLx) must be cleared.
4. If the application is setting or clearing a STALL for an endpoint due to a
SetFeature.Endpoint Halt or ClearFeature.Endpoint Halt command, the STALL bit must
be set or cleared before the application sets up the status stage transfer on the control
endpoint.
Examples
This section describes and depicts some fundamental transfer types and scenarios.
• Bulk OUT transaction
Figure 353 depicts the reception of a single Bulk OUT data packet from the USB to the AHB
and describes the events involved in the process.
Figure 353. Bulk OUT transaction
After a SetConfiguration/SetInterface command, the application initializes all OUT endpoints
by setting CNAK
= 1 and EPENA = 1 (in OTG_DOEPCTLx), and setting a suitable
XFRSIZ and PKTCNT in the OTG_DOEPTSIZx register.
MS36931V1
init _out_ ep
O
U
T
A
C
K
RXFLVL int ri
Wr_reg(OTG_DOEPTSIZx)
Wr_reg(OTG_DOEPCTLx)
64 bytes
O
U
T
N
A
K
xact_1
XFRC
i
n
t
r
XFRSIZ
=
0
r
idle until intr
rcv_out _pkt()
idle until intr
On new xfer
or RxFIFO
not em pty
1
2
3
4
5
6
7
8
XFRSIZ
= 64 bytes
PKTCNT = 1
EPENA = 1
CNAK = 1
Host USB Device Application
PKTCNT
0
OTG_DOEPCTLx, NAK=1