USB Device Controller
1625
SPNU503C – March 2018
Copyright © 2018, Texas Instruments Incorporated
Universal Serial Bus (USB)
29.3.16 Device States Changed Handler
This section describes how USB device states and transitions states are decoded by the USB device
controller and how they can be handled.
The state machine (see
) shows how the USB device controller device moves from one state
to another state with respect to the USB1.1 specification. Attach/unattach transition is not shown in the
transition flow.
Because SET_CONFIGURATION is not decoded by the core, the CPU has the responsibility to
distinguish a SET_CONFIGURATION with a nonvalid configuration value from other
SET_CONFIGURATION requests and to set SYSCON2.DEV_CFG only if the configuration value is valid
(value 0 is nonvalid), when the device is in addressed state. When the device is in configured state, the
CPU has the responsibility to set SYSCON2.CLR_CFG if the configuration number is 0 so that the device
moves to addressed state.
Device states are visible in the DEVSTAT register and are decoded as follows.
•
Attached: The device is attached to the USB and powered.
•
Default: The device is attached to the USB, is powered, and has been reset.
•
Addressed: The device is attached to the USB, is powered, has been reset, and an address has been
assigned. The device moves into the addressed state after a SET_ADDRESS request with an address
number other than 0.
•
Configured: The device is attached to the USB, is powered, has been reset, has an address other than
0, and is configured. The device moves into the configured state after a valid SET_CONFIGURATION
request, only if the CPU has set the SYSCON2.DEV_CFG bit (meaning the configuration is valid).
•
Suspended: The device is at minimum default and has not seen bus activity for 5 ms.
•
Reset: When set, the device is receiving a valid USB host reset.
•
R_WK_OK: This bit is set (cleared) automatically after a valid SET_DEVICE_FEATURE
(CLEAR_DEVICE_FEATURE) request from the USB host.
Any change in the DEVSTAT register bits triggers a device change interrupt (IRQ_SRC.DS_CHG), if
enabled.
The device moves to addressed state after the status stage of a valid SET_ADDRESS, even if the status
stage ACK handshake is received corrupted or not sent by the USB host. A SET_DEVICE_FEATURE or a
CLEAR_DEVICE_FEATURE is effective after setup transaction, even if no status stage occurs. A
SET_CONFIGURATION request is effective before status stage, when the CPU sets the
SYSCON2.CLR_CFG or SYSCON2.DEV_CFG bit (see