
AT32F413
Series Reference Manual
2022.06.27
Page 350
Rev 2.00
Table 23-22
Command path status flags
Flag
Description
CMDRSPCMPL
A response is already received (CRC OK)
CMDFAIL
A command response is already received (CRC fails)
CMDCMPL
A command is sent (does not require a response)
CMDTIMEOUT
Command response timeout (64 SDIO_CK cycles)
DOCMD
Command transfer is in progress
Command channel state machine (CCSM)
When the CCSMEN bit is set in the SDIO_CMDCTR register, command transfer starts. When the
command has been sent, the command channel state machine (CCSM) will set the status flags and
enters the idle state if a response is not required. When a response is received, the received CRC code
and the internally generated CRC code are compared, and the appropriate status flags are set.
The CCSM remains in the idle state for at least 8 SDIO_CK cycles to meet the Ncc (the
minimum delay beteen two host commands) and NRC (the minimum delay between the host
command and the card response).
When the wait state is entered, the command timer is enabled. if the NCR timeout (resonse
time to a command), that is, 64 SDIO_CK periods, is reached before the CCSM moves to the
receive state, the timeout flag is set (CMDTIMEOUT) and the idle state is entered.
If the interrupt bit is set in the command register, the timer is disabled and the CCSM waits for an interrupt
request from one card. If the pending bit is set in the command register, the CCSM will enter pend state
and wait for a CmdPend signal from the data path subunit. When detecting the CmdPend, the CCSM
goes to the send state, which triggers the data counter to send the stop command.
Figure 23-7
Command channel state machine (CCSM)
Idle
Pend
Send
Wait
Receive
after
reset
Response received
or
State machine
disabled or
CRC error
CCSM disabled
or
command
timeout
Response
starts
Wait for
response
CPSM disable or
no response
Enabled and
command
start
Last Data
CCSM
disabled
CCSM enabled and
wait for command