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.

Secure digital input/output interface (SDIO) <strong>RM0090</strong><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 147) 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 and PWD_LEN fields, and 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 and the card retains all of its data, and remains locked.<br />

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

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

28.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 />

command.<br />

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

table are abbreviated as follows:<br />

Type:<br />

● E: error bit<br />

● S: status bit<br />

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

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

by issuing the status command to read these bits.<br />

Clear condition:<br />

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

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

(with a delay of one command)<br />

● C: clear by read<br />

865/1416 Doc ID 018909 Rev 3

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

Saved successfully!

Ooh no, something went wrong!