UM10503
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2012. All rights reserved.
User manual
Rev. 1.3 — 6 July 2012
578 of 1269
NXP Semiconductors
UM10503
Chapter 23: LPC43xx USB0 Host/Device/OTG controller
3. Prime endpoint by writing ‘1’ to correct bit position in ENDPTPRIME.
Linked list is not empty
1. Add dTD to end of the linked list.
2. Read correct prime bit in ENDPTPRIME – if ‘1’ DONE.
3. Set ATDTW bit in USBCMD register to ‘1’.
4. Read correct status bit in ENDPTSTAT. (Store in temp variable for later).
5. Read ATDTW bit in USBCMD register.
–
If ‘0’ go to step 3.
–
If ‘1’ continue to step 6.
6. Write ATDTW bit in USBCMD register to ‘0’.
7. If status bit read in step 4 (ENDPSTAT reg) indicates endpoint priming is DONE
(corresponding ERBRx or ETBRx is one): DONE.
8. If status bit read in step 4 is 0 then go to Linked list is empty: Step 1.
23.10.11.4 Transfer completion
After a dTD has been initialized and the associated endpoint primed the device controller
will execute the transfer upon the host-initiated request. The DCD will be notified with a
USB interrupt if the Interrupt On Complete bit was set or alternately, the DCD can poll the
endpoint complete register to find when the dTD had been executed. After a dTD has
been executed, DCD can check the status bits to determine success or failure.
Remark:
Multiple dTD can be completed in a single endpoint complete notification. After
clearing the notification, DCD must search the dTD linked list and retire all dTDs that have
finished (Active bit cleared).
By reading the status fields of the completed dTDs, the DCD can determine if the
transfers completed successfully. Success is determined with the following combination of
status bits:
Active = 0
Halted = 0
Transaction Error = 0
Data Buffer Error = 0
Should any combination other than the one shown above exist, the DCD must take proper
action. Transfer failure mechanisms are indicated in the Device Error Matrix (see
In addition to checking the status bit, the DCD must read the Transfer Bytes field to
determine the actual bytes transferred. When a transfer is complete, the Total_bytes field
is decremented by the actual bytes transferred. For Transmit packets, a packet is only
complete after the Total_bytes field reaches zero, but for receive packets, the host may
send fewer bytes in the transfer according the USB variable length packet protocol.