Architecture
1626
SPRUH82C – April 2013 – Revised September 2016
Copyright © 2013–2016, Texas Instruments Incorporated
Universal Serial Bus 2.0 (USB) Controller
The host may determine that all the data for a transfer has been sent by knowing the total amount of data
that is expected. Alternatively it may infer that all the data has been sent when it receives a packet which
is smaller than the stated payload (TXMAXP[10-0]). In the latter case, if the total size of the data block is a
multiple of this payload, it will be necessary for the function to send a null packet after all the data has
been sent. This is done by setting TXPKTRDY when the next interrupt is received, without loading any
data into the FIFO.
If large blocks of data are being transferred, then the overhead of calling an interrupt service routine to
load each packet can be avoided by using DMA.
34.2.7.1.2.1.3 Error Handling
If the software wants to shut down the Bulk IN pipe, it should set the SENDSTALL bit (bit 4 of
PERI_TXCSR). When the controller receives the next IN token, it will send a STALL to the host, set the
SENTSTALL bit (bit 5 of PERI_TXCSR) and generate an interrupt.
When the software receives an interrupt with the SENTSTALL bit (bit 5 of PERI_TXCSR) set, it should
clear the SENTSTALL bit. It should however leave the SENDSTALL bit set until it is ready to re-enable the
Bulk IN pipe.
NOTE:
If the host failed to receive the STALL packet for some reason, it will send another IN token,
so it is advisable to leave the SENDSTALL bit set until the software is ready to re-enable the
Bulk IN pipe. When a pipe is re-enabled, the data toggle sequence should be restarted by
setting the CLRDATATOG bit in the PERI_TXCSR register (bit 6).
34.2.7.1.2.2 Bulk OUT Transactions
A Bulk OUT transaction is used to transfer non-periodic data from the host to the function controller.
The following optional features are available for use with an Rx endpoint used in peripheral mode for Bulk
OUT transactions:
•
Double packet buffering: When enabled, up to two packets can be stored in the FIFO on reception
from the host. Double packet buffering is enabled by setting the DPB bit of the RXFIFOSZ register (bit
4).
•
DMA: If DMA is enabled for the endpoint, a DMA request will be generated whenever the endpoint has
a packet in its FIFO. This feature can be used to allow the DMA controller to unload packets from the
FIFO without processor intervention.
When DMA is enabled, endpoint interrupt will not be generated for completion of packet reception.
Endpoint interrupt will be generated only in the error conditions.
34.2.7.1.2.2.1 Setup
In configuring an Rx endpoint for Bulk OUT transactions, the RXMAXP register must be written with the
maximum packet size (in bytes) for the endpoint. This value should be the same as the wMaxPacketSize
field of the Standard Endpoint Descriptor for the endpoint. In addition, the relevant interrupt enable bit in
the INTRRXE register should be set (if an interrupt is required for this endpoint) and the PERI_RXCSR
register should be set as shown in
.
Table 34-5. PERI_RXCSR Register Bit Configuration for Bulk OUT Transactions
Bit Position
Bit Field Name
Configuration
Bit 14
ISO
Cleared to 0 to enable Bulk protocol.
Bit 13
DMAEN
Set to 1 if a DMA request is required for this endpoint.
Bit 12
DISNYET
Cleared to 0 to allow normal PING flow control. This will affect only high speed transactions.
Bit 11
DMAMODE
Always clear this bit to 0.