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
571 of 1269
NXP Semiconductors
UM10503
Chapter 23: LPC43xx USB0 Host/Device/OTG controller
Remark:
Leaving the Setup Lockout Mode As ‘0’ will result in pre-2.3 hardware
behavior.
•
After receiving an interrupt and inspecting ENDPTSETUPSTAT to determine that a
setup packet was received on a particular pipe:
a. Write '1' to clear corresponding bit ENDPTSETUPSTAT.
b. Write ‘1’ to Setup Tripwire (SUTW) in USBCMD register.
c. Duplicate contents of dQH.SetupBuffer into local software byte array.
d. Read Setup TripWire (SUTW) in USBCMD register. (if set - continue; if cleared - go
to b).
e. Write '0' to clear Setup Tripwire (SUTW) in USBCMD register.
f. Process setup packet using local software byte array copy and execute
status/handshake phases.
g. Before priming for status/handshake phases ensure that ENDPTSETUPSTAT is
‘0’.
•
A poll loop should be used to wait until ENDPTSETUPSTAT transitions to ‘0’ after step
a) above and before priming for the status/handshake phases.
•
The time from writing a ‘1’ to ENDPTSETUPSTAT and reading back a ‘0’ is very short
(~1-2 us) so a poll loop in the DCD will not be harmful.
Remark:
After receiving a new setup packet the status and/or handshake phases may still
be pending from a previous control sequence. These should be flushed & deallocated
before linking a new status and/or handshake dTD for the most recent setup packet.
23.10.8.2 Data phase
Following the setup phase, the DCD must create a device transfer descriptor for the data
phase (if present) and prime the transfer.
After priming the packet, the DCD must verify that a new setup packet has not been
received by reading the ENDPTSETUPSTAT register immediately.This step verifies that
the prime has completed. A prime completes when the associated bit in the
ENDPTPRIME register is zero and the associated bit in the ENDPTSTATUS register is
one. If a prime fails, i.e. the ENDPTPRIME bit goes to zero and the ENDPTSTATUS bit is
not set, then the prime has failed. This can only be due to improper setup of the dQH, dTD
or a setup arriving during the prime operation. If a new setup packet is indicated after the
ENDPTPRIME bit is cleared, then the transfer descriptor can be freed and the DCD must
reinterpret the setup packet.
Should a setup arrive after the data stage is primed, the device controller will
automatically clear the prime status (ENDPTSTATUS) to enforce data coherency with the
setup packet.
Remark:
The MULT field in the dQH must be set to “00” for bulk, interrupt, and control
endpoints.
Remark:
Error handling of data phase packets is the same as bulk packets described
previously.