09.12.2012 Views

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

<strong>RM0090</strong> Secure digital input/output interface (SDIO)<br />

password, the LOCK_UNLOCK_FAILED error bit is set in the card status register, and<br />

the password is not changed.<br />

Locking a card<br />

1. Select a card (SELECT/DESELECT_CARD, CMD7), if none is already selected.<br />

2. Define the block length (SET_BLOCKLEN, CMD16) to send, given by the 8-bit card<br />

lock/unlock mode (byte 0 in Table 147), the 8-bit PWD_LEN, and the number of bytes of<br />

the current password.<br />

3. Send LOCK/UNLOCK (CMD42) with the appropriate data block size on the data line<br />

including the 16-bit CRC. The data block indicates the mode (LOCK_UNLOCK = 1), the<br />

length (PWD_LEN), and the password (PWD) itself.<br />

4. When the password is matched, the card is locked and the CARD_IS_LOCKED status<br />

bit is set in the card status register. When the password sent does not correspond (in<br />

size and/or content) to the expected password, the LOCK_UNLOCK_FAILED error bit<br />

is set in the card status register, and the lock fails.<br />

It is possible to set the password and to lock the card in the same sequence. In this case,<br />

the SDIO card host module performs all the required steps for setting the password (see<br />

Setting the password on page 863), however it is necessary to set the LOCK_UNLOCK bit<br />

in Step 3 when the new password command is sent.<br />

When the password is previously set (PWD_LEN is not 0), the card is locked automatically<br />

after power on reset. An attempt to lock a locked card or to lock a card that does not have a<br />

password fails and the LOCK_UNLOCK_FAILED error bit is set in the card status register.<br />

Unlocking the card<br />

1. Select a card (SELECT/DESELECT_CARD, CMD7), if none is already selected.<br />

2. Define the block length (SET_BLOCKLEN, CMD16) to send, given by the 8-bit<br />

cardlock/unlock mode (byte 0 in Table 147), the 8-bit PWD_LEN, and the number of<br />

bytes of the current password.<br />

3. Send LOCK/UNLOCK (CMD42) with the appropriate data block size on the data line<br />

including the 16-bit CRC. The data block indicates the mode (LOCK_UNLOCK = 0), the<br />

length (PWD_LEN), and the password (PWD) itself.<br />

4. When the password is matched, the card is unlocked and the CARD_IS_LOCKED<br />

status bit is cleared in the card status register. When the password sent is not correct in<br />

size and/or content and does not correspond to the expected password, the<br />

LOCK_UNLOCK_FAILED error bit is set in the card status register, and the card<br />

remains locked.<br />

The unlocking function is only valid for the current power session. When the PWD field is not<br />

clear, the card is locked automatically on the next power-up.<br />

An attempt to unlock an unlocked card fails and the LOCK_UNLOCK_FAILED error bit is set<br />

in the card status register.<br />

Forcing erase<br />

If the user has forgotten the password (PWD content), it is possible to access the card after<br />

clearing all the data on the card. This forced erase operation erases all card data and all<br />

password data.<br />

Doc ID 018909 Rev 3 864/1416

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

Saved successfully!

Ooh no, something went wrong!