SanDisk SDSDH-1024 Product Manual - Page 57

Table 4-4, Lock Card Data Structure Bit Descriptions, Set Password, Reset Password

Page 57 highlights

Revision 2.2 Chapter 4 - SD Card Protocol Description SanDisk SD Card Product Manual Table 4-4 Lock Card Data Structure Bit Descriptions Bit Name ERASE LOCK/UNLOCK CLR_PWD SET_PWD PWDS_LEN Password data Description 1' Defines Forced Erase Operation. In byte 0 bit 3 will be set to "1" (all other bits shall be '0'). All other bytes of this command will be ignored by the card. 1 = Lock the card. 0 = Unlock the card (it is valid to set this bit together with SET_PWD but it is not allowed to set together with CLR_PWD). 1 = Clear PWD. 1 = Set new password to PWD. Defines the following password/s length (in bytes). In case of Password change, this field include the total password lengths of old and new passwords. The password length is up to 16 bytes. In case of password change the total length of the old password and the new password can be up to 32 bytes. In case of set new password, it contains the new password. In case of password change, it contains the old password followed by new password. The host will define the data block size before it sends the card lock/unlock command. The block length shall be set to greater than or equal required data structure of lock/unlock command. In the following explanation, changing block size by CMD16 is not mandatory requirement for the lock/unlock command. • Set Password The sequence for setting the password is as follows: 1. Select a card (CMD7), if not previously selected. 2. Define the block length (CMD16), given by the 8-bit card lock/unlock mode, the 8 bits password size (in bytes), and the number of bytes of the new password. In case there is a password replacement, the block size will consider both passwords, the old and the new one, are sent with the command. 3. Send Card Lock/Unlock command with the appropriate data block size on the data line including 16-bit CRC. The data block will indicate the mode (SET_PWD), the length (PWDS_LEN) and the password itself. If a password replacement is done, the length value (PWDS_LEN) will include both passwords, the old and the new one, and the password data field will include the old password (currently used) followed by the new password.8 4. In case the sent "old" password is incorrect-not equal in size and content-the LOCK_UNLOCK_FAILED error bit will be set in the Status Register and the old password will not change. If the PWD matches the sent "old" password, the given new password and its size will be saved in the PWD and PWD_LEN fields, respectively. The Password Length Register (PWD_LEN) indicates if a password is currently set. When it equals zero, no password is set. If the value of PWD_LEN is not equal to zero, the card will lock itself after power-up. It is possible to lock the card immediately in the current power session by setting the LOCK/UNLOCK bit (while setting the password) or sending additional command for card lock. • Reset Password The sequence for resetting the password is as follows: 1. Select a card (CMD7), if not previously selected. 8 Card will internally handle the calculation of the new password length by subtracting the old password length from the PWDS_LEN field. © 2004 SanDisk Corporation 4-13 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-13
12/08/04
Table 4-4
Lock Card Data Structure Bit Descriptions
Bit Name
Description
ERASE
1’ Defines Forced Erase Operation. In byte 0 bit 3 will be set to “1” (all other bits
shall be ‘0’). All other bytes of this command will be ignored by the card.
LOCK/UNLOCK
1 = Lock the card.
0 = Unlock the card (it is valid to set this bit together with SET_PWD but it is not
allowed to set together with CLR_PWD).
CLR_PWD
1 = Clear PWD.
SET_PWD
1 = Set new password to PWD.
PWDS_LEN
Defines the following password/s length (in bytes). In case of Password change,
this field include the total password lengths of old and new passwords. The
password length is up to 16 bytes. In case of password change the total length of
the old password and the new password can be up to 32 bytes.
Password data
In case of set new password, it contains the new password. In case of password
change, it contains the old password followed by new password.
The host will define the data block size before it sends the card lock/unlock command. The
block length shall be set to greater than or equal required data structure of lock/unlock
command. In the following explanation, changing block size by CMD16 is not mandatory
requirement for the lock/unlock command.
Set Password
The sequence for setting the password is as follows:
1. Select a card (CMD7), if not previously selected.
2. Define the block length (CMD16), given by the 8-bit card lock/unlock mode, the 8
bits password size (in bytes), and the number of bytes of the new password. In case
there is a password replacement, the block size will consider both passwords, the
old and the new one, are sent with the command.
3. Send Card Lock/Unlock command with the appropriate data block size on the data
line including 16-bit CRC. The data block will indicate the mode (SET_PWD), the
length (PWDS_LEN) and the password itself. If a password replacement is done,
the length value (PWDS_LEN) will include both passwords, the old and the new
one, and the password data field will include the old password (currently used)
followed by the new password.
8
4. In case the sent “old” password is incorrect—not equal in size and content—the
LOCK_UNLOCK_FAILED error bit will be set in the Status Register and the old
password will not change. If the PWD matches the sent “old” password, the given
new password and its size will be saved in the PWD and PWD_LEN fields,
respectively.
The Password Length Register (PWD_LEN) indicates if a password is currently set. When
it equals zero, no password is set. If the value of PWD_LEN is not equal to zero, the card
will lock itself after power-up. It is possible to lock the card immediately in the current
power session by setting the LOCK/UNLOCK bit (while setting the password) or sending
additional command for card lock.
Reset Password
The sequence for resetting the password is as follows:
1. Select a card (CMD7), if not previously selected.
8
Card will internally handle the calculation of the new password length by subtracting the old password length
from the PWDS_LEN field.