ST STM32F40 Series Reference Manual page 1306

Hide thumbs Also See for STM32F40 Series:
Table of Contents

Advertisement

RM0090
2.
The application can only schedule data transfers one frame at a time.
3.
The complete data to be transmitted in the frame must be written into the transmit FIFO
by the application, before the IN token is received. Even when 1 DWORD of the data to
be transmitted per frame is missing in the transmit FIFO when the IN token is received,
the core behaves as when the FIFO is empty. When the transmit FIFO is empty:
4.
For a high-bandwidth IN endpoint with three packets in a frame, the application can
program the endpoint FIFO size to be 2 × max_pkt_size and have the third packet
loaded in after the first packet has been transmitted on the USB.
Internal data flow:
1.
The application must set the transfer size and packet count fields in the endpoint-
specific registers and enable the endpoint to transmit the data.
2.
The application must also write the required data to the associated transmit FIFO for
the endpoint.
3.
Every time the application writes a packet to the transmit FIFO, the transfer size for that
endpoint is decremented by the packet size. The data are fetched from application
memory until the transfer size for the endpoint becomes 0.
4.
When an IN token is received for a periodic endpoint, the core transmits the data in the
FIFO, if available. If the complete data payload (complete packet, in dedicated FIFO
mode) for the frame is not present in the FIFO, then the core generates an IN token
received when TxFIFO empty interrupt for the endpoint.
5.
The packet count for the endpoint is decremented by 1 under the following conditions:
transmit a few maximum-packet-size packets and a short packet at the end of the
transfer, the following conditions must be met:
transfer size[EPNUM] = x × MPSIZ[EPNUM] + sp
(where x is an integer ≥ 0, and 0 ≤ sp < MPSIZ[EPNUM])
If (sp > 0), packet count[EPNUM] = x + 1
Otherwise, packet count[EPNUM] = x;
MCNT[EPNUM] = packet count[EPNUM]
The application cannot transmit a zero-length data packet at the end of a transfer.
It can transmit a single zero-length data packet by itself. To transmit a single zero-
length data packet:
transfer size[EPNUM] = 0
packet count[EPNUM] = 1
MCNT[EPNUM] = packet count[EPNUM]
(MCNT – 1) × MPSIZ ≤ XFERSIZ ≤ MCNT × MPSIZ
PKTCNT = MCNT (in OTG_HS_DIEPTSIZx)
If XFERSIZ < MCNT × MPSIZ, the last data packet of the transfer is a short
packet.
Note that: MCNT is in OTG_HS_DIEPTSIZx, MPSIZ is in OTG_HS_DIEPCTLx,
PKTCNT is in OTG_HS_DIEPTSIZx and XFERSIZ is in OTG_HS_DIEPTSIZx
A zero data length packet would be transmitted on the USB for isochronous IN
endpoints
A NAK handshake would be transmitted on the USB for interrupt IN endpoints
A zero-length data packet is transmitted on the USB for isochronous IN endpoints
A NAK handshake is transmitted on the USB for interrupt IN endpoints
Doc ID 018909 Rev 4
USB on-the-go high-speed (OTG_HS)
1306/1422

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

This manual is also suitable for:

Stm32f41 seriesStm32f42 seriesStm32f43 seriesRm0090

Table of Contents

Save PDF