Stratix® 10 Hard Processor System Technical Reference Manual

ID 683222
Date 8/15/2024
Public
Document Table of Contents

16.4.3.2.3. Auto-Stop

The controller internally generates an SD/SDIO STOP command and is loaded in the command path when the send_auto_stop bit in the cmd register is set to 1. The AUTO_STOP command helps to send an exact number of data bytes using a stream read or write for the MMC, and a multiple‑block read or write for SD memory transfer for SD cards. The software must set the send_auto_stop bit according to the following details:

The following list describes conditions for the AUTO_STOP command:

  • Stream-read for MMC with byte count greater than zero—The controller generates an internal STOP command and loads it into the command path so that the end bit of the STOP command is sent when the last byte of data is read from the card and no extra data byte is received. If the byte count is less than six (48 bits), a few extra data bytes are received from the card before the end bit of the STOP command is sent.
  • Stream-write for MMC with byte count greater than zero—The controller generates an internal STOP command and loads it into the command path so that the end bit of the STOP command is sent when the last byte of data is transmitted on the card bus and no extra data byte is transmitted. If the byte count is less than six (48 bits), the data path transmits the data last to meet these condition.
  • Multiple‑block read memory for SD card with byte count greater than zero—If the block size is less than four (single‑bit data bus), 16 (4‑bit data bus), or 32 (8‑bit data bus), the AUTO_STOP command is loaded in the command path after all the bytes are read. Otherwise, the STOP command is loaded in the command path so that the end bit of the STOP command is sent after the last data block is received.
  • Multiple‑block write memory for SD card with byte count greater than zero—If the block size is less than three (single‑bit data bus), 12 (4‑bit data bus), or 24 (8‑bit data bus), the AUTO_STOP command is loaded in the command path after all data blocks are transmitted. Otherwise, the STOP command is loaded in the command path so that the end bit of the STOP command is sent after the end bit of the CRC status is received.
  • Precaution for host software during auto‑stop—When an AUTO_STOP command is issued, the host software must not issue a new command to the controller until the AUTO_STOP command is sent by the controller and the data transfer is complete. If the host issues a new command during a data transfer with the AUTO_STOP command in progress, an AUTO_STOP command might be sent after the new command is sent and its response is received. This can delay sending the STOP command, which transfers extra data bytes. For a stream write, extra data bytes are erroneous data that can corrupt the card data. If the host wants to terminate the data transfer before the data transfer is complete, it can issue an SD/SDIO STOP or STOP_TRANSMISSION (CMD12) command, in which case the controller does not generate an AUTO_STOP command.

Auto-Stop Generation for MMC Cards

Table 138.  Auto-Stop Generation for MMC Cards
Transfer Type Byte Count send_auto_stop bit set Comments
Stream read 0 No Open-ended stream
Stream read >0 Yes Auto-stop after all bytes transfer
Stream write 0 No Open-ended stream
Stream write >0 Yes Auto-stop after all bytes transfer
Single-block read >0 No Byte count = 0 is illegal
Single-block write >0 No Byte count = 0 is illegal
Multiple-block read 0 No Open-ended multiple block
Multiple-block read >0 Yes 39 Pre-defined multiple block
Multiple-block write 0 No Open-ended multiple block
Multiple-block write >0 Yes 39 Pre-defined multiple block

Auto-Stop Generation for SD Cards

Table 139.  Auto-Stop Generation for SD Cards
Transfer Type Byte Count send_auto_stop bit set Comments
Single-block read >0 No Byte count = 0 is illegal
Single-block write >0 No Byte count = 0 illegal
Multiple-block read 0 No Open-ended multiple block
Multiple-block read >0 Yes Auto-stop after all bytes transfer
Multiple-block write 0 No Open-ended multiple block
Multiple-block write >0 Yes Auto-stop after all bytes transfer

Auto-Stop Generation for SDIO Cards

Table 140.  Auto-Stop Generation for SDIO Cards
Transfer Type Byte Count send_auto_stop bit set Comments
Single-block read >0 No Byte count = 0 is illegal
Single-block write >0 No Byte count = 0 illegal
Multiple-block read 0 No Open-ended multiple block
Multiple-block read >0 No Pre-defined multiple block
Multiple-block write 0 No Open-ended multiple block
Multiple-block write >0 No Pre-defined multiple block
39 The condition under which the transfer mode is set to block transfer and byte_count is equal to block size is treated as a single-block data transfer command for both MMC and SD cards. If byte_count = n*block_size (n = 2, 3, …), the condition is treated as a predefined multiple-block data transfer command. In the case of an MMC card, the host software can perform a predefined data transfer in two ways: 1) Issue the CMD23 command before issuing CMD18/CMD25 commands to the card – in this case, issue CMD18/CMD25 commands without setting the send_auto_stop bit. 2) Issue CMD18/CMD25 commands without issuing CMD23 command to the card, with the send_auto_stop bit set. In this case, the multiple-block data transfer is terminated by an internally-generated auto-stop command after the programmed byte count.