MAX32665-MAX32668 User Guide
Maxim Integrated Page 406 of 457
If the DMA is enabled for a Bulk IN endpoint (USBHS_INCSRU.dmareqenab = 1), a DMA request is
generated whenever the endpoint can accept another packet in its FIFO. The DMA request is
terminated when the entire packet is loaded into the DMA or when the USBHS_INCSRL.inpktrdy bit
field is set indicating a packet in the FIFO was transmitted.
For Bulk IN endpoints, the DMA is set to DMA Request Mode 1 where a DMA request is generated
each time a packet is received. The DMA completes burst transfers based on the maximum packet
size for the endpoint: 512 bytes for Hi-Speed and 64 bytes for full speed. DMA burst transfers
continue until the entire data block is transferred.
When the AutoSet feature is enabled (USBHS_INCSRU.autoset = 1) for a Bulk IN endpoint, the IN
Packet Ready bit field USBHS_INCSRL.inpktrdy is automatically set when a packet of USBHS_INMAXP
bytes is loaded into the FIFO.
Automatic Packet Splitting
For some USB transfers, it might be necessary to write larger amounts of data to an endpoint than
you can transfer in a single USB operation. For these transfers, the USBHS supports split transactions
where large data packets that are written to Bulk endpoints are split into multiple smaller packets.
The necessary packet size information is set in the USBHS_INCSRU register.
A STALL packet is used to indicate that an endpoint has had an error. To shut down the Bulk IN
endpoint transfer, set the USBHS_INCSRL.sendstall bit field. When the USBHS receives the next IN
token, it then sends a STALL to the Host, sets the USBHS_INCSRL.sentstall bit field, and generates an
interrupt.
21.8.2 Bulk OUT Endpoints
A Bulk OUT endpoint is used to transfer non-periodic data from the Host to the function controller. Five optional features
are available for use with a Bulk OUT endpoint.
When the value written to the USBHS_OUTMAXP register is less than or equal to half the size of the
FIFO allocated to the endpoint, and double packet buffering is allowed
(USBHS_OUTCSRU.dpktbufdis = 0), double packet buffering is enabled. This allows storage of up to
two packets in the FIFO for transmission to the Host.
DMA transfers for an OUT endpoint depend on the DMA Request Mode selected with the
USBHS_OUTCSRU.dmareqmode bit field.
In DMA Request Mode 0, a DMA request is generated when a data packet is available in the OUT
Endpoint FIFO. The DMA request is terminated when the last byte of the data packet is read from
the OUT FIFO, or when the USBHS_OUTCSRL.outpktrdy bit is cleared indicating the OUT FIFO is
empty.
In DMA Request Mode 1, the DMA request line only goes high when the packet received is of the
maximum packet size set in the USBHS_OUTMAXP register. If the packet received is of some other
size, a DMA request is not generated, leaving the packet in the FIFO with the
USBHS_OUTCSRL.outpktrdy bit still set.
When the AutoClear feature is enabled (USBHS_OUTCSRU.autoclear = 1), the
USBHS_OUTCSRL.outpktrdy bit is automatically cleared when a packet of USBHS_OUTMAXP bytes is
unloaded from the FIFO.
Automatic Packet Combining
For some USB transfers, it might be necessary to receive larger amounts of data from an endpoint
than can be received in a single USB operation. For these transfers, the USBHS supports
automatically combining packets received by split transactions, where large data packets received by
Bulk endpoints had been split into multiple smaller packets. The necessary packet size information is
set in the USBHS_OUTMAXP register.