This chapter describes how SDIO
recovers from CRC errors in host write flow. In general, when a CRC error occurs in
an SDIO transmission, the Host recognize it through the transmission result sent by
the card after each block \ byte basis transfers. When such event occurs, the entire
packet (Not only the specific block) is discarded and re-transmitted by the
corresponding side:
- At the end of each data block (in block-basis operations) or data transaction
(in byte-basis operations), the host also sends CRC. SDIO PHY then calculate the
CRC result and compare it to CRC field sent by the host. This comparison result
is then sent to the host in a CRC response packet, including CRC_OK field. If
the CRC is NOT OKAY and the configuration allows, the SDIO FIFO sets the busy
interface line.
- The motivation behind that, is to
let the SW enough time to prepare for packet re-transmission and to terminate
the current packet reception.
The flow is described by the following steps:
- Host initiate a data transfer using CMD53.
- Once the SDIO PHY finds out there
is a CRC error, it sends to the host response with CRC error indication. It also
updated the CRC_OK status of the SDIO PHY interface and issues at interrupt to
the SW.
- SDIO receives the CRC error indication and if its configuration allows, it sets
the busy line.
- SW receives the SDIO PHY's
interrupt and prepares itself to the retransmission.
- When the SW is ready (DMA has
been aborted, packet memory was freed, HOST RX FIFO were flushed), it gives the
HW command to clear the busy indication.
At this point in time, the
host should start re-transmitting the entire packet again:
According to specification,
when the host receives the PHY response that includes CRC error indication,
it sends CMD52 to the PHY, in order to indicate packet, write retry (PCWRT→
1). Note that according to Spec some hosts can send in addition CMD52 (I/O
aborts) between data blocks. This doesn't change the flow, since as far as
SW is concerned, writing to PCWRT serves the same purpose.
- The command’s parameters are:
- function number 1 (SDIO function #1), write flag, write packet control
register address (0x11), data = 1. (Step 6)
Table 21-4 CMD52
| CMD52 |
Function = #1 |
Write Flag = 0x1 |
Address = write packet control register address
(0x11) |
DATA = 0x1 |
- SDIO PHY parses the
command and sends SDIO command response to the host. Note that SW
already knows a retransmission needs to take place.
- The packet re-transmission is performed like any other typical host write
(CMD53) such that SDIO PHY nor SDIO HW are aware of this re-transmission.