===== SD Commands =====
{{template>:meta:template:pageinfo#tpl
|desc=Document common commands supported by the SD card.}}
==== Search Table ====
^ Command ^ Data Line ^ Response ^ Description ^ Version ^ Addend ^
| CMD48 | R | R1 | Read single block of extension register. | 4.00 | May be supported on __SDHC__ and __SDXC__. |
| [[#CMD6]] | R | R1 | Switch function. | 1.10 | |
| [[#CMD58]] | R | R1 | Read multiple blocks of extension register. | 4.10 | May be supported on __SDHC__ and __SDXC__. |
| CMD49 | W | R1 | Write single block of extension register. | 4.00 | May be supported on __SDHC__ and __SDXC__. |
| CMD59 | W | R1 | Write multiple blocks of extension register. | 4.10 | May be supported on __SDHC__ and __SDXC__. |
| CMD9 | - | R2 | Obtain Device-specific data (CSD) on the CMD line. | | |
| CMD7 | b | R1b | Command toggles a device between the standby and transfer states or between the programming and disconnect states. | | |
| [[#CMD13]] | - | R1 | Addressed card sends its status register. | | |
| [[#CMD32]] | - | R1 | Specifies the address of the first block to be erase. | | |
| [[#CMD33]] | - | R1 | Specifies the address of the last block to be erase. | | |
| [[#CMD38]] | b | R1b | Erase function. | | |
==== CMD6 ===
=== Response ===
R1
SD card will return __512-bits of status__ on data line.
=== Argument ===
^ 31 ^ 30:24 ^ 23:20 ^ 19:16 ^ 15:12 ^ 11:8 ^ 7:4 ^ 3:0 ^
| Mode | Resv | Resv | Resv | Power Limit | Drive Strength | Cmd System | Access Mode |
\\
^ | | |
^ 31 | Mode | * 0 - check \\ * 1 - switch |
^ 30:24 | Resv | |
^ 23:20 | Resv | |
^ 19:16 | Resv | |
^ 15:12 | PL | |
^ 11:8 | DS | |
^ 7:4 | CS | |
^ 3:0 | AM | * 0x0 - SDR12 \\ * 0x1 - SDR25 \\ * 0x2 - SDR50 \\ * 0x3 - SDR104 \\ * 0x4 - DDR50 |
==== CMD13 ====
=== Description ===
Read card staus register or task status register.
=== Response ===
R1
=== Argument ===
|31:16|15|14:0|
|RCA|Send Task Status Register|Stuff Bits|
\\
| | | |
|31:16|RCA| |
|15|STSR|* 0 - SD card sends its status register \\ * 1 - SD card sends its taks status register|
|14:0|SB| |
==== CMD32 ====
=== Description ===
Specifies the address of the first block to be erase.
=== Response ===
R1
=== Argument Data address. ===
**Note**
* SDSC uses byte unit address and SDHC/SDXC uses block unit address.
* eMMC uses CMD35 instead of CMD32.
==== CMD33 ====
=== Description ===
Specifies the address of the last block to be erase.
=== Response ===
R1
=== Argument Data address. ===
**Note:**
* SDSC uses byte address and SDHC/SDXC uses block address.
* eMMC uses CMD36 instead of CMD33
==== CMD38 ====
=== Description ===
Erase data.
=== Response ===
=== Argument ===
| | |
|31:0|* 1 - Discard \\ * 2 - FULE \\ * Others - Erase|
==== CMD58 ====
=== Description ===
May be supported on SDHC and SDXC.
=== Response ===
R3
=== Argument ===
Stuff bit