ST STM32F207 Series Reference Manual page 1248

Advanced arm-based 32-bit mcus
Hide thumbs Also See for STM32F207 Series:
Table of Contents

Advertisement

USB on-the-go high-speed (OTG_HS)
Sequence of operations:
1.
Disable the IN endpoint by setting:
2.
Wait for the EPDIS interrupt in OTG_HS_DIEPINTx, which indicates that the IN
endpoint is completely disabled. When the EPDIS interrupt is asserted the following
bits are cleared:
3.
Flush the TxFIFO by programming the following bits:
4.
The application can start polling till TXFFLSH in OTG_HS_GRSTCTL is cleared. When
this bit is cleared, it ensures that there is no data left in the Tx FIFO.
Generic non-periodic IN data transfers
Application requirements:
1.
Before setting up an IN transfer, the application must ensure that all data to be
transmitted as part of the IN transfer are part of a single buffer.
2.
For IN transfers, the Transfer Size field in the Endpoint Transfer Size register denotes a
payload that constitutes multiple maximum-packet-size packets and a single short
packet. This short packet is transmitted at the end of the transfer.
3.
Once an endpoint is enabled for data transfers, the core updates the Transfer size
register. At the end of the IN transfer, the application must read the Transfer size
register to determine how much data posted in the transmit FIFO have already been
sent on the USB.
4.
Data fetched into transmit FIFO = Application-programmed initial transfer size – core-
updated final transfer size
Internal data flow:
1248/1381
EPDIS = 1 in all OTG_HS_DIEPCTLx registers
EPDIS = 0 in OTG_HS_DIEPCTLx
EPENA = 0 in OTG_HS_DIEPCTLx
TXFFLSH = 1 in OTG_HS_GRSTCTL
TXFNUM = "FIFO number specific to endpoint" in OTG_HS_GRSTCTL
To transmit a few maximum-packet-size packets and a short packet at the end of
the transfer:
Transfer size[EPNUM] = x × MPSIZ[EPNUM] + sp
If (sp > 0), then packet count[EPNUM] = x + 1.
Otherwise, packet count[EPNUM] = x
To transmit a single zero-length data packet:
Transfer size[EPNUM] = 0
Packet count[EPNUM] = 1
To transmit a few maximum-packet-size packets and a zero-length data packet at
the end of the transfer, the application must split the transfer into two parts. The
first sends maximum-packet-size data packets and the second sends the zero-
length data packet alone.
First transfer: transfer size[EPNUM] = x × MPSIZ[epnum]; packet count = n;
Second transfer: transfer size[EPNUM] = 0; packet count = 1;
Data transmitted on USB = (application-programmed initial packet count – Core
updated final packet count) × MPSIZ[EPNUM]
Data yet to be transmitted on USB = (Application-programmed initial transfer size
– data transmitted on USB)
RM0033 Rev 9
RM0033

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the STM32F207 Series and is the answer not in the manual?

Questions and answers

Table of Contents