RM0033
c)
d)
e)
f)
g)
30.13.6
Device programming model
Endpoint initialization on USB reset
1.
Set the NAK bit for all OUT endpoints
–
2.
Unmask the following interrupt bits
–
–
–
–
–
–
3.
Set up the Data FIFO RAM for each of the FIFOs
–
–
4.
Program the following fields in the endpoint-specific registers for control OUT endpoint
0 to receive a SETUP packet
–
5.
In DMA mode, the DOEPDMA0 register should have a valid memory address to store
any SETUP packets received.
At this point, all initialization required to receive SETUP packets is done.
The OTG_HS host attempts to send the start split IN token at the beginning of the
next odd micro-frame.
The OTG_HS host generates the CHH interrupt after successfully transmitting the
start split IN token.
In response to the CHH interrupt, set the COMPLSPLT bit in HCSPLT2 to send the
complete split.
As soon as the packet is received successfully, the OTG_HS host starts writing the
data to the system memory.
The OTG_HS host generates the CHH interrupt after transferring the received
data to the system memory. In response to the CHH interrupt, de-allocate the
channel or reinitialize the channel for the next start split.
SNAK = 1 in OTG_HS_DOEPCTLx (for all OUT endpoints)
INEP0 = 1 in OTG_HS_DAINTMSK (control 0 IN endpoint)
OUTEP0 = 1 in OTG_HS_DAINTMSK (control 0 OUT endpoint)
STUP = 1 in DOEPMSK
XFRC = 1 in DOEPMSK
XFRC = 1 in DIEPMSK
TOC = 1 in DIEPMSK
Program the OTG_HS_GRXFSIZ register, to be able to receive control OUT data
and setup data. If thresholding is not enabled, at a minimum, this must be equal to
1 max packet size of control endpoint 0 + 2 words (for the status of the control
OUT data packet) + 10 words (for setup packets).
Program the OTG_HS_TX0FSIZ register (depending on the FIFO number
chosen) to be able to transmit control IN data. At a minimum, this must be equal to
1 max packet size of control endpoint 0.
STUPCNT = 3 in OTG_HS_DOEPTSIZ0 (to receive up to 3 back-to-back SETUP
packets)
USB on-the-go high-speed (OTG_HS)
RM0033 Rev 8
1231/1378
1258
Need help?
Do you have a question about the STM32F205 series and is the answer not in the manual?
Questions and answers