RM0082
HS_USB 2.0 device
Doc ID 018672 Rev 1
475/844
In operation (Data transfer to USB host)
If the UDC-AHB subsystem receives an in token from an USB Host for a non-isochronous
endpoint (such as, bulk, interrupt or control), it checks the associated TxFIFO (
FIFO controller (Transmit FIFO controller) on page 467
) for data availability. If data is
available, the UDC reads the data from the TxFIFO, otherwise if the TxFIFO does not
contain data, the UDC sends an interrupt to the application, and the USB host retries the in
token.
Upon receiving the interrupt, at first the application reads the endpoint interrupt register
(
Endpoint interrupt register on page 497
) to determine which endpoint requested the
interrupt, and then probes the endpoint status register (
) to determine the interrupt’s cause.
Once the application determines that an in token for the endpoint requested the interrupt, it
writes the packet directly to the address where the associated TxFIFO is mapped. As soon
as the packet data has been completely written into the FIFO, the application performs then
a single write to a predefined address (pointed by the write confirmation register, see
, of the relevant in endpoint) indicating to the subsystem that the packet transfer is
done.
When the USB host retries the in token, the subsystem provides the associated endpoint
TxFIFO data to the UDC for transmission to the USB host. The sequence of these events for
a non-isochronous (interrupt, bulk, or control) endpoint is shown in
.
Note:
The application does not receive status update regarding the packet, because the
subsystem must transmit this data. However, the application may flush the packet from the
relevant TxFIFO by setting the F bit in the endpoint control register (
).