UM10360 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2013. All rights reserved.
User manual Rev. 3 — 19 December 2013  266 of 841
NXP Semiconductors
UM10360
Chapter 11: LPC176x/5x USB device controller
In ATLE mode, the last buffer length to be transferred always ends with a short or empty 
packet indicating the end of the USB transfer. If the concatenated transfer lengths are 
such that the USB transfer ends on a MaxPacketSize packet boundary, the (NDIS) host 
will send an empty packet to mark the end of the USB transfer.
IN transfers in ATLE mode
For IN USB transfers from the device to the host, DMA_buffer_length is set by the device 
software as in normal mode.
In ATLE mode, the device concatenates data from multiple DDs to form a single USB 
transfer. If a DD is retired in the middle of a packet (packet size is less than 
MaxPacketSize), the next DD referenced by Next_DD_pointer is fetched, and the 
remaining bytes to form a packet of MaxPacketSize are transferred from the next DD’s 
buffer. 
If the next DD is not programmed (i.e. Next_DD_valid field in DD is 0), and the DMA buffer 
length for the current DD has completed before the MaxPacketSize packet boundary, then 
the available bytes from current DD are sent as a short packet on USB, which marks the 
end of the USB transfer for the host.
If the last buffer length completes on a MaxPacketSize packet boundary, the device 
software must program the next DD with DMA_buffer_length field 0, so that an empty 
packet is sent by the device to mark the end of the USB transfer for the host.
11.15.7.1 Setting up the DMA transfer
For OUT endpoints, the host hardware needs to set the field Message_length_position in 
the DD. This indicates the start location of the message length in the incoming data 
packets. Also the device software has to set the DMA_buffer_length field to 0 for OUT 
endpoints because this field is updated by the device hardware after the extraction of the 
buffer length.
For IN endpoints, descriptors are set in the same way as in normal mode operation. 
Since a single packet can be split between two DDs, software should always keep two 
DDs ready, except for the last DMA transfer which ends with a short or empty packet.
11.15.7.2 Finding the DMA Descriptor
DMA descriptors are found in the same way as the normal mode operation.
11.15.7.3 Transferring the Data
OUT endpoints
If the LS_byte_extracted or MS_byte_extracted bit in the status field is not set, the 
hardware will extract the transfer length from the data stream and program 
DMA_buffer_length. Once the extraction is complete both the LS_byte_extracted and 
MS_byte_extracted bits will be set.
IN endpoints
The DMA transfer proceeds as in normal mode and continues until the number of bytes 
transferred equals the DMA_buffer_length.