10.07.2015 Views

SanDisk SD Card

SanDisk SD Card

SanDisk SD Card

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Revision 2.2Chapter 4 – <strong>SD</strong> <strong>Card</strong> Protocol Description<strong>SanDisk</strong> <strong>SD</strong> <strong>Card</strong> Product ManualBlock WriteBlock write (CMD24-27, 42, 56(w)) means that one or more blocks of data are transferredfrom the host to the card with a 1-bit or 4-bit CRC appended to the end of each block bythe host. <strong>SanDisk</strong> <strong>SD</strong> cards that support block-write are require the block length, set byCMD16, to be 512 bytes regardless of whether WRITE_BL_LEN is set to 1k or 2kBytes.The following table defines the card behavior when partial-block access is disabled(WRITE_BL_PARTIAL = 0).Table 4-2Write Command Block LengthMax block sizeWRITE_BL_LENC<strong>SD</strong> ValueMisalignPartialCurrent Write CMD Start Address 7Blocklen 6512-Bytes 0 (disable) 0 (disable) 512 bytes n * 512 bytes (n : Integer)1-kBytes 0 (disable) 0 (disable) 512 bytes n * 512 bytes (n : Integer)2-kBytes 0 (disable) 0 (disable) 512 bytes n * 512 bytes (n : Integer)In Table 4-2, the size in the “Current Blocklen” field is set or changed by CMD16. If thevalue is less than 512 bytes (there are no relations with misalign and partial option), it is setwith no error. Then the size of the current block length is tested when the write commandis executed.If WRITE_BL_PARTIAL is allowed (=1) then smaller blocks, up to resolution of one byte,can be used as well. If the CRC fails, the card shall indicate the failure on the DAT line (seebelow); the transferred data will be discarded and not written, and all further transmittedblocks (in multiple block write mode) will be ignored.Multiple block-write command shall be used rather than continuous single write commandto make faster write operation.If the host uses partial blocks whose accumulated length is not block aligned and blockmisalignment is not allowed (C<strong>SD</strong> parameter WRITE_BLK_MISALIGN is not set), thecard shall detect the block misalignment error and abort programming before the beginningof the first misaligned block.The card shall set the ADDRESS_ERROR error bit in the status register, and whileignoring all further data transfer, wait in the Receive-data-State for a stop command.The write operation shall also be aborted if the host tries to write over a write-protectedarea. In this case, however, the card will set the WP_VIOLATION bit. Programming of theC<strong>SD</strong> register does not require a previous block length setting. The transferred data is alsoCRC protected. If a part of the C<strong>SD</strong> register is stored in ROM, then this unchangeable partmust match the corresponding part of the receive buffer. If this match fails, then the cardwill report an error and not change any register contents.Some cards may require long and unpredictable times to write a block of data. Afterreceiving a block of data and completing the CRC check, the card will begin writing andhold the DAT0 line low if its write buffer is full and unable to accept new data from a newWRITE_BLOCK command. The host may poll the status of the card with aSEND_STATUS command (CMD13) at any time, and the card will respond with its status.The status bit READY_FOR_DATA indicates whether the card can accept new data or6 If the current block length is other than the values in the column, the <strong>SD</strong> <strong>Card</strong> indicates BLOCK_LEN_ERROR”on the write-command response.7 If the start address is different than the values in the column, the card will send “ADDRESS_ERROR” on theWrite command response.© 2004 <strong>SanDisk</strong> Corporation 4-10 12/08/04

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!