![STMicroelectronics STM32F405 Скачать руководство пользователя страница 1031](http://html1.mh-extra.com/html/stmicroelectronics/stm32f405/stm32f405_reference-manual_13810621031.webp)
DocID018909 Rev 11
RM0090
Secure digital input/output interface (SDIO)
1067
31.4.8
Erase: group erase and sector erase
The erasable unit of the MultiMediaCard is the erase group. The erase group is measured in
write blocks, which are the basic writable units of the card. The size of the erase group is a
card-specific parameter and defined in the CSD.
The host can erase a contiguous range of Erase Groups. Starting the erase process is a
three-step sequence.
First the host defines the start address of the range using the
ERASE_GROUP_START
(CMD35) command, next it defines the last address of the range using the
ERASE_GROUP_END
(CMD36) command and, finally, it starts the erase process by issuing
the
ERASE
(CMD38) command. The address field in the erase commands is an Erase
Group address in byte units. The card ignores all LSBs below the Erase Group size,
effectively rounding the address down to the Erase Group boundary.
If an erase command is received out of sequence, the card sets the ERASE_SEQ_ERROR
bit in the status register and resets the whole sequence.
If an out-of-sequence (neither of the erase commands, except SEND_STATUS) command
received, the card sets the ERASE_RESET status bit in the status register, resets the erase
sequence and executes the last command.
If the erase range includes write protected blocks, they are left intact and only unprotected
blocks are erased. The WP_ERASE_SKIP status bit in the status register is set.
The card indicates that an erase is in progress by holding SDIO_D low. The actual erase
time may be quite long, and the host may issue CMD7 to deselect the card.
31.4.9
Wide bus selection or deselection
Wide bus (4-bit bus width) operation mode is selected or deselected using
SET_BUS_WIDTH
(ACMD6). The default bus width after power-up or
GO_IDLE_STATE
(CMD0) is 1 bit.
SET_BUS_WIDTH
(ACMD6) is only valid in a transfer state, which means
that the bus width can be changed only after a card is selected by
SELECT/DESELECT_CARD
(CMD7).
31.4.10 Protection
management
Three write protection methods for the cards are supported in the SDIO card host module:
1.
internal card write protection (card responsibility)
2. mechanical write protection switch (SDIO card host module responsibility only)
3. password-protected
card lock operation
Internal card write protection
Card data can be protected against write and erase. By setting the permanent or temporary
write-protect bits in the CSD, the entire card can be permanently write-protected by the
manufacturer or content provider. For cards that support write protection of groups of
sectors by setting the
WP_GRP_ENABLE
bit in the CSD, portions of the data can be
protected, and the write protection can be changed by the application. The write protection
is in units of
WP_GRP_SIZE
sectors as specified in the CSD. The
SET_WRITE_PROT
and
CLR_WRITE_PROT
commands control the protection of the addressed group. The
SEND_WRITE_PROT
command is similar to a single block read command. The card sends
a data block containing 32 write protection bits (representing 32 write protect groups starting