Chapter 4 – SD Card Protocol Description
Revision 2.2
SanDisk SD Card Product Manual
© 2004 SanDisk Corporation
4-16
12/08/04
Table 4-5
Lock/Unlock Function (basic sequence for CMD42)
CMD42 Parameter
9
Card
Status
10
Bit3 Bit2 Bit1 Bit0
Current
Card State
PWD_LEN
and PWD
Result of the
Function
Bit25 Bit24
Exist
Card is locked
1
0
After power on
Cleared
Card is unlocked
0
0
1 0 0 0
Locked Exist
Force
Erase
11
Table
4-2
Table
4-2
1 0 0 0
Unlocked Exist
Error
0 1
1 0 0 0
Unlocked Cleared Error
0 1
0 1 0 0
Locked Exist
Error
1 1
0
1
0
0
Unlocked
Exist
Lock card
0 to 1
0 to 1
0 1 0 0
Unlocked Cleared Error
0 1
0 1 0 1
Locked Exist
Replace
password
&
card remains locked
1 0
0 1 0 1
Unlocked Exist
Replace
password
&
card is locked
0 to 1
0
0 1 0 1
Unlocked Cleared Set
password
&
lock
card
0 to 1
0
0 0 1 0
Locked Exist
Clear
PWD_LEN
&
PWD to unlock card
1 to 0
0
0 0 1 0
Unlocked Exist
Clear
PWD_LEN
&
PWD
0 0
0 0 1 0
Unlocked
Cleared Error
12
0
1
0 0 0 1
Locked Exist
Replace
password
&
card is unlocked
1 to 0
0
0 0 0 1
Unlocked Exist
Replace
password
&
card is unlocked
0 0
0 0 0 1
Unlocked Cleared Set
password
&
card
remains unlocked
0 0
0 0 0 0
Locked Exist
Unlock
card
1
to
0 0
0 0 0 0
Unlocked Exist
Error
0 1
0 0 0 0
Unlocked Cleared Error
0 1
Other combinations
Don’t care
Don’t care
Error
13
0 or 1
1
Note:
To replace password, the host should consider following cases. When PWD LEN
and password data exist, the card assumes old and new passwords are set in the data
structure. When PWD LEN and PWD are cleared, the card assumes only new password is
set in the data structure. In this case, the host shall not set old password in the data
structure; otherwise, unexpected password is set.
9
CMD42 parameter in the data: Bit3—ERASE, Bit2—LOCK_UNLOCK, Bit1—CLR_PWD, Bit0—SET_PWD.
10
Related bits in the card status: Bit25—CARD_IS_LOCKED, Bit24—LOCK_UNLOCK_FAILED.
11
Refer to Table 4-6.
12
Refer to Note 1 in Table 4-6.
13
Ibid.