USB Transactions
13-69
USB Function Module
When a setup token is identified, the USB decode module must monitor the
setup stage data packet, decode it, and determine if it is an autodecoded or
a non-autodecoded transfer and a control read or a control write. If it is a valid
non-autodecoded request, the setup FIFO is immediately cleared and control
of the FIFO is immediately taken away from the local host (if the local host had
control of the FIFO). New setup data is placed into the setup FIFO, and the
setup interrupt flag is set (Setup bit).
In response to the setup interrupt, the local host must select the setup FIFO
by setting Setup_sel bit. This clears the setup flag. The local host must then
read 8 bytes from the setup FIFO, clear the Setup_Sel bit, and check that the
setup bit has not been reset by a new setup transaction. If the setup flag is
asserted, the local host must discard the previously read data and handle the
new setup packet as explained above. Thus the local host never misses a new
occurring setup transaction (this is per USB 1.1 specification).
13.3.5.1
Autodecoded Control Write Transfers
For set address control write transfers, the USB address provided in the setup
token is captured to the USB module device address register. If the new
address is different from 0, the device moves into addressed state (the ADD
bit set) if it was not already addressed.
For set and clear feature control writes, the appropriate feature information bit
is set or cleared. When a set or clear feature transfer occurs to set or clear the
device’s remote-wakeup feature, the R_WK_OK bit is set or cleared as
appropriate. If a set or clear interface feature occurs, the request is automati-
cally stalled by the core because no feature is defined for interface (see USB
1.1 specification).
Per USB 1.1 specification, a SET_ADDRESS request is effective after the
status stage of the request, even if the status stage does not end with an ACK
handshake. SET/CLEAR_FEATURE requests are effective after the setup
stage, even if no status stage occurs.
Autodecoded Control Write Transfer Handshaking
The USB function module automatically provides ACK handshaking for all
transactions of all stages of autodecoded control write transfers, except if a
corrupted packet is received, which is ignored by the USB module. The
Set_FIFO_En and Stall_Cmd bits have no effect on the handshaking.
Autodecoded Control Write Transfer Error Conditions
If the token packet or the data packet of a setup stage transaction has an error
(bad CRC, PID check, or bit-stuffing error), the USB block ignores the transac-
tion. The USB block does not provide ACK handshaking in this case.