Prepare for control
write stage status
routine
End of prepare for
control write status
stage routine
Application-
specific action
to determine
control write
action and
status result
Set CTRL.CIR_EP to
1, then set
CTRL.SET_FIFO_EN
to 1.
Want to respond
with ACK?
No
Want to respond
with stall?
Set SYSCON2.
STALL.CMD to 1.
Yes
This actions include:
Reset-relevant endpoints if request is clear
endpoint feature, set config, or set interface.
Set halt for relevant endpoints if
request is set endpoint feature, set config, or
set interface.
Set SYSCON2.Dev_Cfg if request is valid
set config and device is addressed.
Set SYSCON2.Clr_Cfg if request is valid
set config with config_nb of 0 and device
is configured.
Set SYSCON1.Self_Pwr if request is set
config and device is self-powered in the
new config.
Enable NAK interrupt by
setting SYSCON1.NAK_EN
to 1 if not already enabled.
No
Command-
specific
actions
Yes
Write EP_NUM register:
- EP_NUM.EP_NUM = 0
- EP_NUM.EP_DIR = 1
- EP_NUM.EP_SEL = 1
- EP_NUM.SETUP_SEL = 0
Write EP_NUM register:
- EP_NUM.EP_NUM = 0
- EP_NUM.EP_DIR = 1
- EP_NUM.EP_SEL = 0
- EP_NUM.SETUP_SEL = 0
USB Device Controller
1622
SPNU503C – March 2018
Copyright © 2018, Texas Instruments Incorporated
Universal Serial Bus (USB)
Figure 29-66. Prepare for Control Write Status Stage Routine
To support the SET_DESCRIPTOR command, when in commspecific actions, you must first reset all
endpoints by selecting the endpoint and then clear it, unlock the configuration, charge the new one, lock
the configuration, go in prepare for transfers, and enable all interrupts (see
29.3.15 Endpoint 0 TX Interrupt Handler
shows the TX portion of the general USB interrupt handler, which must handle general USB
interrupts related to control IN transactions on endpoint 0.
The endpoint 0 TX interrupt handler must be able to move data into the endpoint 0 TX FIFO when the
application buffer for endpoint 0 TX data is not empty and an endpoint 0 TX interrupt occurs signaling an
ACKed non-autodecoded endpoint 0 IN transaction. This data can be control read data stage information
or control write status stage handshaking information (see
).