SanDisk SDSDH-1024 Product Manual - Page 59

Force Erase, Parameter and Results of CMD42

Page 59 highlights

Revision 2.2 Chapter 4 - SD Card Protocol Description SanDisk SD Card Product Manual • Force Erase In case the user forgets the password (the PWD content) it is possible to erase all card data content along with the PWD content. This operation is called Forced Erase. 1. Select a card (CMD7), if not previously selected. 2. Define the block length (CMD16) to 1 byte (8-bit card lock/unlock command). Send the Card Lock/Unlock command with the appropriate data block of one byte on the data line including 16-bit CRC. The data block will indicate the mode ERASE (the ERASE bit will be the only bit set). If the erase bit is not the only bit in the data field, the LOCK_UNLOCK_FAILED error bit will be set in the Status Register and the erase request is rejected. If the command was accepted, all card content is erased including the PWD and PWD_LEN Register content and the locked card will get unlocked. An attempt to force erase on an unlocked card will fail and the LOCK_UNLOCK_FAILED error bit will be set in the Status Register. • Parameter and Results of CMD42 The block length will be greater than or equal required data structure of CMD42; otherwise, the result of CMD42 is undefined and the card may be in the unexpected locked state. Table 4-5 clarifies the behavior of CMD42. The reserved bits in the parameter (bit74) of CMD42 are "don't care." In case CMD42 requires the password, it is assumed that the old password and the new password are set correctly; otherwise the card indicates error regardless of information contained in Table 4-5. If the password length is 0 or greater than 128 bits, the card indicates error. If errors occur during execution of CMD42, the LOCK_UNLOCK_FAILED (Bit24 of Card Status) will be set to 1 regardless of the information in Table 4-5. The CARD_IS_LOCKED (Bit25 of Card Status) in the response of CMD42 will be the same as Current Card State. In the field of Card Status, "0" to 1" means the card change to Locked and "1 to 0" means the card change to Unlocked after execution of CMD42. It can be seen in the response of CMD13 after the CMD42. The LOCK_UNLOCK_FAILED (Bit24 of Card Status) as the result of CMD42 can be seen in the response of either CMD42 or following CMD13. © 2004 SanDisk Corporation 4-15 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-15
12/08/04
Force Erase
In case the user forgets the password (the PWD content) it is possible to erase all card data
content along with the PWD content. This operation is called
Forced Erase
.
1. Select a card (CMD7), if not previously selected.
2. Define the block length (CMD16) to 1 byte (8-bit card lock/unlock command).
Send the Card Lock/Unlock command with the appropriate data block of one byte
on the data line including 16-bit CRC. The data block will indicate the mode
ERASE (the ERASE bit will be the only bit set).
If the erase bit is not the only bit in the data field, the LOCK_UNLOCK_FAILED error bit
will be set in the Status Register and the erase request is rejected. If the command was
accepted,
all card content is erased
including the PWD and PWD_LEN Register content
and the locked card will get unlocked.
An attempt to force erase on an unlocked card will fail and the LOCK_UNLOCK_FAILED
error bit will be set in the Status Register.
Parameter and Results of CMD42
The block length will be greater than or equal required data structure of CMD42;
otherwise, the result of CMD42 is undefined and the card may be in the unexpected locked
state. Table 4-5 clarifies the behavior of CMD42.
The reserved bits in the parameter (bit7-
4) of CMD42 are “don't care.”
In case CMD42 requires the password, it is assumed that the old password and the new
password are set correctly; otherwise the card indicates error regardless of information
contained in Table 4-5.
If the password length is 0 or greater than 128 bits, the card
indicates
error.
If
errors
occur
during
execution
of
CMD42,
the
LOCK_UNLOCK_FAILED (Bit24 of Card Status) will be set to 1 regardless of the
information in Table 4-5.
The CARD_IS_LOCKED (Bit25 of Card Status) in the response of CMD42 will be the
same as Current Card State. In the field of Card Status, "0” to 1" means the card change to
Locked and "1 to 0" means the card change to Unlocked after execution of CMD42. It can
be seen in the response of CMD13 after the CMD42.
The LOCK_UNLOCK_FAILED (Bit24 of Card Status) as the result of CMD42 can be
seen in the response of either CMD42 or following CMD13.