Purpose
sdcard sd mode initialization and identification sequence
Description
- Host write bit 3 of function 0, register 6 to reset SDIO card (if there is, using Cmd52).
- Host sends Cmd0 to do card reset, card is in "idle state".
- Host sends Cmd8 and checks the response of the card, only sdcard supports physical layer version 2.00 will response correctly to Cmd8, and this command is mandatory to be sent before ACmd41 for sdcard which support physical layer version 2.00, to enable new functions or to validate a dual-voltage card.
- The response result is saved for future branch after "Host sends Cmd5..".
- refer to "If Cmd8 response ok" branch for the initialize of sdcard 2.0.
- refer to "If Cmd8 response fail" branch for the initialize of sdcard 1.x, mmc card, sdcard2.0 with invalid voltage.
- Host sends Cmd5 with argument 0 and checks the response of the card, only SDIO card supports this command. It starts SDIO initialize. The card returns number of functions in response.
- refer to "If Cmd5 response ok" branch for the initialize of SDIO card.
- If Cmd5 response ok
- Host sends Cmd5 with argument "voltage range" to power up the SDIO card.
- If the response failed, it means the card does not match the voltage desired by the host, SDIO type saved as false.
- If the response ok, SDIO type saved as true, continue to next step.
- If Cmd8 response ok
- Host sends ACmd41* with argument "HCS" equal to "1".
- If the response to ACmd41 failed, it means the card does not match the voltage desired by the host, SD card type saved as true.
- If the response with "CCS" equal to "1", the card is a version 2.0 high capacity sdcard, refer to "Card Initialize" for the succeeding initialize sequence.
- If the response with "CCS" equal to "0", the card is a version 2.0 standard capacity sdcard. refer to "Card Initialize" for the succeeding initialize sequence.
- If Cmd8 response fail
- Host sends ACmd41* argument "HCS" equal to "0".
- If the response to ACmd41 ok, the card is a version 1.x sdcard, refer to "Card Initialize" for the succeeding initialize sequence.
- If the response to ACmd41 fails
- If SDIO type is true, refer to "Card Initialize".
- Host sends Cmd0 to reset card.
- Host sends Cmd1 with argument "hdSupport" equal to "1" to card.
- If card has response to Cmd1, the card is a MMC card, refer to "Card Initialize" for the succeeding initialize sequence. Furthermore, if the response with bit[30:29] equal to "00" or "11", the card is a High Density MMC, else the card is a standard MMC.
- If card has no response to Cmd1, the card is either an unknown card or a card does not match host's voltage, the initialize ends.
- Card Initialize
- If SD or MMC type is true, Host sends Cmd2 to get the its unique card identification number (CID).
- Host sends Cmd3 to ask the card to publish a new relative card address (RCA), once the RCA is received the card state changes to the "stand-by state".
- If SD or MMC type is true, Host sends Cmd9 to get the Card Specific Data (CSD).
- At this stage, the initialization and identification process is over, the following steps are done for the sdcard's succeeding operation.
- SD(HC) or MMC(HD) memory cards
- Host sends Cmd13 to obtain the card status, make sure the card is "ready-for-data".
- Host sends Cmd7 to transit card in "transfer state".
- If card is a sdcard*, hosts send ACmd6 to set bus to 4-wire mode.
- If card is a mmc card, the bus is set as 1-wire mode.
- SDIO card
- the bus is set as 1-wire mode.
- Note:
- Send Cmd55 before send ACmd41.
-
sdcard include ver 1.x sdcard, ver2.0 standard capacity sdcard, ver2.0 high capacity sdcard