SDIO

Sample List

This chapter introduces the details of the SDIO sample. The SDK provides the following samples for the SDIO peripheral.

Functional Overview

SDIO card is an IO device that uses the SD bus and SD commands. SD card is a type of memory card that is used in newly emerging audio and video electronic devices. The shape and interface of the SDIO card are compatible with the SD card, but it not only realizes the storage function, but also realizes other functions, such as Bluetooth, Wireless Fidelity, etc. SD card has a total of 9 pins, including 2 ground pins, 1 power pin, 1 clock pin, 1 command pin, and 4 data pins. The host controls the internal operation of the SD card by reading or writing SD host controller.

Feature List

  • Support SD host standard specification V2.0.

  • Support 2 SD bus speed mode: default speed mode (frequency up to 25 MHz) and high speed mode (frequency up to 50 MHz).

  • Support 2 group pins on EVB to communicate with SD card. For specific pins, please refer to SDIO Group Pins in RTL87x3D or SDIO Group Pins in RTL87x3E and RTL87x3EP.

  • Support SD transmission mode of 1-bit mode (single-wire), 4-bit SD mode (four-wire).

  • Support optional bus clock, with a maximum of 50MHz for RTL87x3E and RTL87x3EP, and a maximum of 40MHz for RTL87x3D.

  • Support multiple block and single block transfer.

  • High voltage SD card: operation voltage 3.3V.

  • Support GDMA transfer.

  • Support interrupt control.

Note

  1. RTL87x3D, RTL87x3E, and RTL87x3EP support SDIO.

  2. Please confirm whether SDIO pins are supported for the package before using SDIO.

Block Diagram

Here is the overall IPs block diagram for SDIO IP, which including ‘PAD/PINMUX’ for IO function configuration, ‘SDIO IP’ for SDIO protocol and ‘DMAC IP’ for DMA access.

../../../_images/SDIO_System_Block_Diagram.png

System Block Diagram of SDIO

Transfer Protocol

Communication over the SD bus is based on command and data bit streams that are initiated by a start bit and terminated by a stop bit. The control on the SD bus is realized through CMD, the host initiates a request, and then the SD card responds to the request. Data is transferred in the form of data blocks, and data blocks are always succeeded by CRC bits. For a multiple block write operation, the card will hold the DAT0 line low if its write buffer is full. Busy indication will be sent by the card to the host on DAT0 only.

Take the SD Bus multi-block read operation as an example:

  1. The host sends a multi-block read command.

  2. The SD card sends a response.

  3. The card starts sending data.

  4. After each block is sent, return a CRC status.

  5. The card transmits the next block data.

  6. Stop transmission until the host sends a stop command, the card responds.

../../../_images/SD_BUS_Multiple_Block_Read_Operation.png

SD BUS Multiple Block Read Operation

../../../_images/SD_BUS_Multiple_Block_Write_Operation.png

SD BUS Multiple Block Write Operation

Interface Definition

The connection of SD host controller (SDHC) and SD card is shown in SDHC and SD Card Connection Diagram.

  1. Clock Line (CLK): host to card clock signal.

  2. Command Line (CMD): bi-directional command and response signal.

  3. Data Line (DAT0-DAT3): 4 bi-directional data signals.

../../../_images/SDHC_and_SD_Card_Connection_Diagram.png

SDHC and SD Card Connection Diagram

The SDIO group pins of different ICs are shown in the tables below. RTL87x3EP is the same as RTL87x3E.

SDIO Group Pins in RTL87x3D

RTL87x3D

CLK

CMD

DAT0

DAT1

DAT2

DAT3

Group0 Pins

P1_2

P1_3

P1_4

P1_5

P1_6

P1_7

Group1 Pins

P4_2

P4_3

P4_4

P4_5

P4_6

P4_7

SDIO Group Pins in RTL87x3E and RTL87x3EP

RTL87x3E/EP

CLK

CMD

DAT0

DAT1

DAT2

DAT3

Group0 Pins

P5_0

P5_1

P5_2

P5_3

P5_4

P5_5

Group1 Pins

P6_0

P6_1

P6_2

P6_3

P6_4

P6_5

Power Manager

The SDIO peripheral is located in the core domain and will be powered off in low power mode. SDIO peripheral store/restore will be automatically performed based on whether the SDIO clock is active. Users can call the API io_dlps_register() to initialize SDIO peripheral store/restore and do not need to worry about SDIO peripheral requiring specific handling.

Troubleshooting

How to Debug SD Initialization Failure Issue?

If the SD card has a CMD8 response error during the card identification stage, it is usually caused by external environmental factors.

  1. Check whether the power supply voltage of the pin group is 3.3V: verify the power supply of the corresponding IO domain and LDO.

  2. Check whether the SDIO pins of the package used are supported.

  3. Check whether the card connection is stable.

  4. Check whether the card responds after the host sends CMD.