SanDisk SDSDH-1024 Product Manual - Page 54

Block Write, Block write, Table 4-2, Write Command Block Length

Page 54 highlights

Revision 2.2 Chapter 4 - SD Card Protocol Description SanDisk SD Card Product Manual Block Write Block write (CMD24-27, 42, 56(w)) means that one or more blocks of data are transferred from the host to the card with a 1-bit or 4-bit CRC appended to the end of each block by the host. SanDisk SD cards that support block-write are require the block length, set by CMD16, 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-2 Write Command Block Length CSD Value Max block size Misalign WRITE_BL_LEN 512-Bytes 0 (disable) 1-kBytes 0 (disable) 2-kBytes 0 (disable) Partial 0 (disable) 0 (disable) 0 (disable) Current Blocklen6 512 bytes 512 bytes 512 bytes Write CMD Start Address7 n * 512 bytes (n : Integer) n * 512 bytes (n : Integer) n * 512 bytes (n : Integer) In Table 4-2, the size in the "Current Blocklen" field is set or changed by CMD16. If the value is less than 512 bytes (there are no relations with misalign and partial option), it is set with no error. Then the size of the current block length is tested when the write command is 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 (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 command to make faster write operation. If the host uses partial blocks whose accumulated length is not block aligned and block misalignment is not allowed (CSD parameter WRITE_BLK_MISALIGN is not set), the card shall detect the block misalignment error and abort programming before the beginning of the first misaligned block. The card shall set the ADDRESS_ERROR error bit in the status register, and while ignoring 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-protected area. In this case, however, the card will set the WP_VIOLATION bit. Programming of the CSD register does not require a previous block length setting. The transferred data is also CRC protected. If a part of the CSD 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. Some cards may require long and unpredictable times to write a block of data. After receiving a block of data and completing the CRC check, the card will begin writing and hold the DAT0 line low if its write buffer is full and unable to accept new data from a new WRITE_BLOCK command. The host may poll the status of the card with a SEND_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 or 6 If the current block length is other than the values in the column, the SD Card indicates BLOCK_LEN_ERROR" on the write-command response. 7If the start address is different than the values in the column, the card will send "ADDRESS_ERROR" on the Write command response. © 2004 SanDisk Corporation 4-10 12/08/04

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123

Chapter 4 – SD Card Protocol Description
Revision 2.2
SanDisk SD Card Product Manual
© 2004 SanDisk Corporation
4-10
12/08/04
Block Write
Block write
(CMD24-27, 42, 56(w)) means that one or more blocks of data are transferred
from the host to the card with a 1-bit or 4-bit CRC appended to the end of each block by
the host.
SanDisk SD cards that support block-write are require the block length, set by
CMD16, 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-2
Write Command Block Length
CSD Value
Max block size
WRITE_BL_LEN
Misalign
Partial
Current
Blocklen
6
Write CMD Start Address
7
512-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 the
value is less than 512 bytes (there are no relations with misalign and partial option), it is set
with no error.
Then the size of the current block length is tested when the write command
is 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 (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 command
to make faster write operation.
If the host uses partial blocks whose accumulated length is not block aligned and block
misalignment is not allowed (CSD parameter WRITE_BLK_MISALIGN is not set), the
card shall detect the block misalignment error and abort programming before the beginning
of the first misaligned block.
The card shall set the ADDRESS_ERROR error bit in the status register, and while
ignoring 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-protected
area. In this case, however, the card will set the WP_VIOLATION bit.
Programming of the
CSD register does not require a previous block length setting. The transferred data is also
CRC protected. If a part of the CSD 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.
Some cards may require long and unpredictable times to write a block of data. After
receiving a block of data and completing the CRC check, the card will begin writing and
hold the DAT0 line low if its write buffer is full and unable to accept new data from a new
WRITE_BLOCK command. The host may poll the status of the card with a
SEND_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 or
6
If the current block length is other than the values in the column, the SD Card 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 the
Write command response.