29.01.2015 Views

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

RM0008<br />

Secure digital input/output interface (SDIO)<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 <strong>and</strong> 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 <strong>and</strong> all<br />

password data.<br />

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

2. Set the block length (SET_BLOCKLEN, CMD16) to 1 byte. Only the 8-bit card<br />

lock/unlock byte (byte 0 in Table 141) is sent.<br />

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

the 16-bit CRC. The data block indicates the mode (ERASE = 1). All other bits must be<br />

zero.<br />

4. When the ERASE bit is the only bit set in the data field, all card contents are erased,<br />

including the PWD <strong>and</strong> PWD_LEN fields, <strong>and</strong> the card is no longer locked. When any<br />

other bits are set, the LOCK_UNLOCK_FAILED error bit is set in the card status<br />

register <strong>and</strong> the card retains all of its data, <strong>and</strong> remains locked.<br />

An attempt to use a force erase on an unlocked card fails <strong>and</strong> the LOCK_UNLOCK_FAILED<br />

error bit is set in the card status register.<br />

20.4.11 Card status register<br />

The response format R1 contains a 32-bit field named card status. This field is intended to<br />

transmit the card status information (which may be stored in a local status register) to the<br />

host. If not specified otherwise, the status entries are always related to the previously issued<br />

comm<strong>and</strong>.<br />

Table 128 defines the different entries of the status. The type <strong>and</strong> clear condition fields in the<br />

table are abbreviated as follows:<br />

Type:<br />

● E: error bit<br />

● S: status bit<br />

● R: detected <strong>and</strong> set for the actual comm<strong>and</strong> response<br />

● X: detected <strong>and</strong> set during comm<strong>and</strong> execution. The SDIO card host must poll the card<br />

by issuing the status comm<strong>and</strong> to read these bits.<br />

Clear condition:<br />

● A: according to the card current state<br />

● B: always related to the previous comm<strong>and</strong>. Reception of a valid comm<strong>and</strong> clears it<br />

(with a delay of one comm<strong>and</strong>)<br />

● C: clear by read<br />

Doc ID 13902 Rev 9 479/995

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

Saved successfully!

Ooh no, something went wrong!