![ARTERY AT32F435 Series Reference Manual Download Page 554](http://html1.mh-extra.com/html/artery/at32f435-series/at32f435-series_reference-manual_2977592554.webp)
AT32F435/437
Series Reference Manual
2022.11.11
Page 554
Rev 2.03
Forcing erase
If the user forgot the password (PWD content), it is possible to access the card after clearing all the data
on the card. This forced erase operation will erase all card data and all password data.
1.
Select a card using CMD7 (SELECT/DESELECT_CARD), if none is selected previously
2.
Define the block length with CMD16(SET_BLOCKLEN) to send in the 8-bit card lock/unlock
mode, 8-bit PWD_LEN, and the number of bytes of the new password.
3.
Send CMD42(LOCK/UNLOCK) with the appropriate data block size on the data line including
the 16-bit CRC. The data block indicates the operation mode (ERASE =1). All other bits must
be zero.
4.
When the ERASE bit is the only bit in the data field, all card content will be erased, including
the PWD and the PWD_LEN field, and the card is no longer locked. When any other bits are
not zero, the LOCK_UNLOCK_FAILED error bit is set in the SDIO_STS register, and the
card data are retained, and the card remains locked.
An attempt to force erase an unlocked card fails and the LOCK_UNLOCK_FAILED error bit is set in the
SDIO_STS register.
25.3.2 Commands and responses
25.3.2.1 Commands
Command types
Four commands are available to control the SD memory card:
1.
Broadcast command: sent to all cards, no responses returned
2.
Broadcast command with response: sent to all cards, responses received from all cards
simultaneously
3.
Addressed command: sent to the selected card, and no data transfer on the SDIO_D line
4.
Addressed data transfer command: sent to the selected card, and data transfer is present on the
SDIO_D line
Command description
The SDIO host module system is designed to provide a standard interface for a variety of application
types. In the meantime, specific customer/application features must also be taken into account. Because
of this, two types of general commands are defined in the standard: general commands (GEN_CMD)
and application-specific commands (ACMD).
To use the application-specific commands, the SDIO host must send CMD55(APP_CMD) first, and waits
the response from the card, which indicates that the APP_CMD bit is set and an ACMD is expected,
before sending ACMD.
Table 25-2
Comm ands
CMD index Type
Parameter
Response
format
Abbreviation
Description
CMD0
bc
[31: 0]=stuff bits
-
GO_IDLE_
STATE
Reset all cards to idle state
CMD1
bc
[31: 0]=OCR
R3
SEND_OP_
COND
In idle state, request a card to send OCR
register content through the CMD bus
CMD2
bcr
[31: 0]=stuff bits
R2
ALL_Send_CID
Request all cards to send CID data
through the CMD bus
CMD3
bcr
[31: 0]=stuff bits
R6
SEND_RELATIV
E_AD DR
Request a card to issue a new relative
card address
CMD4
bc
[31: 16]=DSR
[15: 0]= stuff bits
-
SET_DSR
Set the DSR register of all cards
CMD5
bcr
[31: 24]Reserved
[23: 0] I/O OCR
R4
IO_SEND_OP_C
OND
Used only for the SDI/O card to query the
voltage range of the required I/O card