GD32F403xx User Manual
538
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
steps sequence. First the host defines the start address of the range using the
ERASE_GROUP_START (CMD35)/ERASE_WR_BLK_START(CMD32) command, next it
defines the last address of the range using the ERASE_GROUP_END
(CMD36)/ERASE_WR_BLK_END(CMD33) 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 will ignore all LSB’s below the Erase Group size,
effectively rounding the address down to the Erase Group boundary.
If an erase command (CMD35, CMD36, and CMD38) is received out of the defined erase
sequence, the card shall set the ERASE_SEQ_ERROR bit in the status register and reset
the whole sequence.
If the host provides an out of range address as an argument to CMD35 or CMD36, the card
will reject the command, respond with the ADDRESS_OUT_OF_RANGE bit set and reset the
whole erase sequence.
If an ‘non erase’ command (neither of CMD35, CMD36, CMD38 or CMD13) is received, the
card shall respond with the ERASE_RESET bit set, reset the erase sequence and execute
the last command.
If the erase range includes write protected blocks, they shall be left intact and only the non-
protected blocks shall be erased. The WP_ERASE_SKIP status bit in the status register shall
be set.
As described above for block write, the card will indicate that an erase is in progress by
holding DAT0 low. The actual erase time may be quite long, and the host may issue CMD7 to
deselect the card.
20.6.7.
Bus width selection
After the host has verified the functional pins on the bus it should change the bus width
configuration.
For MMC, using the SWITCH command (CMD6).The bus width configuration is changed by
writing to the BUS_WIDTH byte in the Modes Segment of the EXT_CSD register (using the
SWITCH command to do so). After power-on or software reset, the contents of the
BUS_WIDTH byte is 0x00. If the host tries to write an invalid value, the BUS_WIDTH byte is
not changed and the SWITCH_ERROR bit is set. This register is write only.
For SD memory, using SET_BUS_WIDTH command (ACMD6) to change the bus width. The
default bus width after power up or GO_IDLE_STATE command (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).