Data Write Format - SanDisk SDSDB-32-201-80 - Industrial Grade Flash Memory Card Product Manual

Secure digital card
Table of Contents

Advertisement

Secure Digital (SD) Card Protocol Description
The code is a shortened BCH code with d=4 and is used for payload length of up to 2048 Bytes. Note that the CRC
check sum is calculated and attached to each DAT line at the end of the block. In the case of a wide bus operation
(DAT0-DAT3), the 16-bit CRC is calculated separately for each DAT line.
Block Read
A block read is a block-oriented data transfer. The basic unit of data transfer is a block whose maximum size is
defined in the CSD (READ_BL_LEN). Smaller blocks whose starting and ending address are wholly contained
within one physical block (as defined by READ_BL_LEN) may also be transmitted. A CRC is appended to the end
of each block ensuring data transfer integrity. CMD17 (READ_SINGLE_BLOCK) starts a block read, and after a
complete transfer the card goes back to Transfer State. CMD18 (READ_MULTIPLE_BLOCK) starts a transfer of
several consecutive blocks. Blocks will be continuously transferred until a stop command is issued. The stop
command has an execution delay due to the serial command transmission. The data transfer stops after the end bit of
the stop command.
If the host uses partial blocks whose accumulated length is not block aligned, the card will, at the beginning of the
first misaligned block, detect a block misalignment error, set the ADDRESS_ERROR error bit in the status register,
abort transmission and wait (in the Data State) for a stop command.

4.4.3. Data Write Format

The data transfer format is similar to the data read format. For block-oriented write data transfer, the CRC check bits
are added to each data block. The card performs a CRC check for each data line at the end of each received data
block prior to a write operation. (The polynomial is the same one used for a read operation.) With this mechanism,
writing of erroneously transferred data can be prevented.
Block Write
During block write (CMD24—27,42,56
), one or more blocks of data are transferred from the host to the card,
(w)
with CRC appended to the end of each block by the host. The SanDisk SD Card is able to accept a block of data
defined by WRITE_BL_LEN of 512 bytes. If the CRC fails, the card shall indicate the failure on the DAT line (see
below); the transferred data will be discarded and not written, and all further transmitted blocks (in multiple block
write mode) will be ignored.
Multiple block write command shall be used rather than continuous single write commands to make faster write
operation. Partial block writes (blocks smaller than 512 bytes) are not allowed in the SanDisk SD Card.
The write operation will be aborted if the host tries to write over a write-protected area. In this case, the card sets the
WP_VIOLATION bit in the status register, and while ignoring all further data transfer, waits in the Receive-data-
State for a stop command.
Programming of the CID and CSD registers does not require a previous block length setting. The transferred data is
also CRC protected. If a part of the CSD or CID register is stored in ROM, then this unchangeable part must match
the corresponding part of the receive buffer. If this match fails, then the card will report an error and not change any
register contents.
SanDisk Secure Digital (SD) Card Product Manual, Rev. 1.9 © 2003 SANDISK CORPORATION
4-11

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents