SanDisk SDSDH-1024 Product Manual - Page 73

Error Conditions

Page 73 highlights

Revision 2.2 Chapter 4 - SD Card Protocol Description SanDisk SD Card Product Manual 4.6.2 CRC16 The CRC16 is used for payload protection in block transfer mode when on DAT line is used. The CRC checksum is a 16-bit value and is computed as follows: generator polynomial: G(x) = x16 + x12 + x5 +1 M(x) = (first bit) * xn + (second bit) * xn-1 +...+ (last bit) * x0 CRC[15...0] = Remainder [(M(x) * x16) / G(x)] All CRC registers are initialized to zero. The first bit is the first data-bit of the corresponding block. The degree n of the polynomial denotes the number of bits of the data block decreased by one. For example, n = 4,095 for a block length of 512 bytes. The generator polynomial G(x) is a standard CCITT polynomial. The code has a minimal distance d=4 and is used for a payload length of up to 2,048 bytes (n < 16,383). The same CRC16 method is used in single DAT line mode and in wide-bus mode. In wide-bus mode, the CRC16 is done on each line separately. Figure 4-14 CRC16 Generator/Checker 4.7 Error Conditions The following sections provide valuable information on error conditions. 4.7.1 CRC and Illegal Commands CRC-bits protect all commands. If the addressed SD Card CRC check fails, the card does not respond and the command is not executed. The card does not change its state, and the COM_CRC_ERROR bit is set in the Status Register. Similarly, if an illegal command has been received, an SD Card will not change its state or respond, and will set the ILLEGAL_COMMAND error bit in the Status Register. Only the non-erroneous state branches are shown in the state diagrams (Figure 4-7 and Figure 4-8). Table 4-18 contains a complete state transition description. Different types of illegal commands include: • Commands belonging to classes not supported by the SD Card (e.g., I/O command CMD39). • Commands not allowed in the current state (e.g., CMD2 in Transfer State). • Commands not defined (e.g., CMD6). © 2004 SanDisk Corporation 4-29 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-29
12/08/04
4.6.2
CRC16
The CRC16 is used for payload protection in block transfer mode when on DAT line is
used. The CRC checksum is a 16-bit value and is computed as follows:
generator polynomial: G(x) = x
16
+ x
12
+ x
5 +1
M(x) = (first bit) * x
n
+ (second bit) * x
n-1
+...+ (last bit) * x
0
CRC[15...0] = Remainder [(M(x) * x
16
) / G(x)]
All CRC registers are initialized to zero. The first bit is the first data-bit of the
corresponding block. The degree
n
of the polynomial denotes the number of bits of the data
block decreased by one. For example, n = 4,095 for a block length of 512 bytes. The
generator polynomial G(x) is a standard CCITT polynomial. The code has a minimal
distance d=4 and is used for a payload length of up to 2,048 bytes (n < 16,383).
The same
CRC16 method is used in single DAT line mode and in wide-bus mode.
In wide-bus mode,
the CRC16 is done on each line separately.
Figure 4-14
CRC16 Generator/Checker
4.7
Error Conditions
The following sections provide valuable information on error conditions.
4.7.1
CRC and Illegal Commands
CRC-bits protect all commands. If the addressed SD Card CRC check fails, the card does
not respond and the command is not executed. The card does not change its state, and the
COM_CRC_ERROR bit is set in the Status Register.
Similarly, if an illegal command has been received, an SD Card will not change its state or
respond, and will set the ILLEGAL_COMMAND error bit in the Status Register. Only the
non-erroneous state branches are shown in the state diagrams (Figure 4-7 and Figure 4-8).
Table 4-18 contains a complete state transition description.
Different types of illegal commands include:
Commands belonging to classes not supported by the SD Card (e.g., I/O command
CMD39).
Commands not allowed in the current state (e.g., CMD2 in Transfer State).
Commands not defined (e.g., CMD6).