USB on-the-go high-speed (OTG_HS)
Packet
store in
memory
•
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_HS_DOEPTSIZx) in a control
OUT endpoint must be programmed to a nonzero value. When the application
programs the STUPCNT field to a nonzero value, the core receives SETUP packets
and writes them to the receive FIFO, irrespective of the NAK status and EPENA bit
setting in OTG_HS_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
determine the correct number of SETUP packets received in the Setup stage of a
control transfer.
–
2.
The application must always allocate some extra space in the Receive data FIFO, to be
able to receive up to three SETUP packets on a control endpoint.
–
–
–
1236/1381
Figure 389. Receive FIFO packet read in slave mode
Wait until RXFLVL in OTG_HS_GINTSTSG
rd_data = rd_reg(OTG_HS_GRXSTSP);
Y
rd_data.BCNT = 0
mem[0:dword_cnt-1] =
rd_rxfifo(rd_data.EPNUM,
dword_cnt)
STUPCNT = 3 in OTG_HS_DOEPTSIZx
The space to be reserved is 10 words. Three words are required for the first
SETUP packet, 1 word is required for the Setup stage done word and 6 words are
required to store two extra SETUP packets among all control endpoints.
3 words per SETUP packet are required to store 8 bytes of SETUP data and 4
bytes of SETUP status (Setup packet pattern). The core reserves this space in the
receive data.
FIFO to write SETUP data only, and never uses this space for data packets.
N
RM0033 Rev 9
rcv_out_pkt()
dword_cnt =
BCNT[11:2] +
(BCNT[1]| BCNT[1])
RM0033
MSv65221V1
Need help?
Do you have a question about the STM32F207 Series and is the answer not in the manual?
Questions and answers