10.07.2015 Views

SanDisk SD Card

SanDisk SD Card

SanDisk SD Card

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Revision 2.2Chapter 4 – <strong>SD</strong> <strong>Card</strong> Protocol Description<strong>SanDisk</strong> <strong>SD</strong> <strong>Card</strong> Product ManualTable 4-4Bit NameERASELOCK/UNLOCKCLR_PWDSET_PWDPWDS_LENPassword dataLock <strong>Card</strong> Data Structure Bit DescriptionsDescription1’ Defines Forced Erase Operation. In byte 0 bit 3 will be set to “1” (all other bitsshall 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 notallowed 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. Thepassword length is up to 16 bytes. In case of password change the total length ofthe 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 passwordchange, 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. Theblock length shall be set to greater than or equal required data structure of lock/unlockcommand. In the following explanation, changing block size by CMD16 is not mandatoryrequirement for the lock/unlock command.• Set PasswordThe 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 8bits password size (in bytes), and the number of bytes of the new password. In casethere is a password replacement, the block size will consider both passwords, theold and the new one, are sent with the command.3. Send <strong>Card</strong> Lock/Unlock command with the appropriate data block size on the dataline including 16-bit CRC. The data block will indicate the mode (SET_PWD), thelength (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 newone, and the password data field will include the old password (currently used)followed by the new password. 84. In case the sent “old” password is incorrect—not equal in size and content—theLOCK_UNLOCK_FAILED error bit will be set in the Status Register and the oldpassword will not change. If the PWD matches the sent “old” password, the givennew 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. Whenit equals zero, no password is set. If the value of PWD_LEN is not equal to zero, the cardwill lock itself after power-up. It is possible to lock the card immediately in the currentpower session by setting the LOCK/UNLOCK bit (while setting the password) or sendingadditional command for card lock.• Reset PasswordThe sequence for resetting the password is as follows:1. Select a card (CMD7), if not previously selected.8 <strong>Card</strong> will internally handle the calculation of the new password length by subtracting the old password lengthfrom the PWDS_LEN field.© 2004 <strong>SanDisk</strong> Corporation 4-13 12/08/04

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!