RM0082
HS_USB 2.0 device
Doc ID 018672 Rev 1
471/844
Figure 41.
Linked-list memory structure in DMA mode
In DMA mode, before starting any action, the application must both initialize the buffer
descriptor chains in the DMA data memory structure for all active endpoints of the UDC-
AHB subsystem, and configure the required CSRs during the USB reset.
A brief description of both in and out operation in DMA mode.
23.4.2 In
operation
(Data transfer To USB host)
If the UDC-AHB subsystem receives an in token from a USB host for a non-isochronous
endpoint (such as, bulk, interrupt or control), it checks the corresponding TxFIFO for data
availability. If data is available, the TxFIFO is read and the data is provided to the UDC for
transfer to USB host. In contrast, if the TxFIFO is empty (no data), the UDC-AHB subsystem
sends an interrupt to the application and the UDC sends a NAK handshake to the USB Host
connected to that endpoint.
On receiving the interrupt, at first the application probes the endpoint interrupt register,
Endpoint interrupt register on page 497
to determine which endpoint has requested the
interrupt. Having determined this endpoint, then the application probes the endpoint status
register,
Endpoint status register on page 499
to determine the interrupt’s cause.
Upon notification that this is an in token for a particular endpoint, the application updates the
addressed endpoint’s system memory buffer with data. Besides, the application reports to
the DMA the availability of such data by setting the poll demand bit in the subsystem’s
CSRs.
Note:
Each endpoint has a dedicated poll demand bit within CSRs, specifically in the endpoint-
specific endpoint control register,
Endpoint control register on page 498
Now the DMA transfers the data from the system memory to the relevant endpoint FIFO. As
shown in
, these endpoint buffers are RAM-based implementations with
programmable sizes. When the USB host retries with another in token, the UDC-AHB
subsystem provides the data to the UDC reading the endpoint buffers for transmission to
Setup Buffer
Pointer
IN Data Descriptor
Pointer
Setup buffer Status Quadlet
In buffer Status Quadlet
In buffer Status Quadlet
In buffer Status Quadlet
Data
R
R
R
R
Data
Next Pointer
Next Pointer
Next Pointer
Buffer
Buffer
Buffer
OUT Data
Descriptor Pointer
OUT buffer Status Quadlet
OUT buffer Status Quadlet
OUT buffer Status Quadlet
R
R
R
Next Pointer
Next Pointer
Next Pointer
Buffer
Buffer
Buffer