HydraFW binary SDIO mode guide - hydrabus/hydrafw GitHub Wiki
HydraFW binary SDIO mode guide
This guide is updated towards firmware release HydraFW v0.11 and later
This mode allows to control SDIO interface, used for raw access to SD Cards or eMMC chips.
- SDIO pins: CLK=PC12, CMD=PD2, D0=PC8, D1=PC9, D2=PC10, D3=PC11
Commands
Once the SDIO mode has been selected, the following commands are available :
0b00000000
Return to main mode. Returns BBIO10b00000001
Mode identification. ReturnsSDI1
0b000001xx
Send SDIO command0b000010xx
Send SDIO command and write data block0b000011xx
Send SDIO command and read data block0b1000000x
Configure SDIO interface
Command details
0b000001xx
)
Send command (This command reads one byte as the command ID, and 4 bytes as the command argument.
Format :
Byte 1 2 3 4 5 6
|----------|----------|----------|----------|----------|----------|
[command] [ID] [ Argument ]
Depending on the two last bits, the SDIO driver will wait for different response :
0b00
: No response from card0b01
: Short response0b10
: Long response
This command returns 0x01
if successful, 0x00
in case of error.
0b000010xx
)
Send command and write data block (This command is used to send a SDIO command followed by a data block. The block size is 512 bytes.
This command first reads one byte as the command ID, and 4 bytes as the command argument. 512 data bytes need to be sent afterwards
Format :
Byte 1 2 3 4 5 6 ...
|----------|----------|----------|----------|----------|----------|------...
[command] [ID] [ Argument ] [ Data
Depending on the two last bits, the SDIO driver will wait for a different command response :
0b00
: No response from card0b01
: Short response0b10
: Long response
This command returns 0x01
if successful, 0x00
in case of error.
0b000011xx
)
Send command and read data block (This command is used to send a SDIO command, then read a data block. The block size is 512 bytes.
This command first reads one byte as the command ID, and 4 bytes as the command argument.
Format :
Byte 1 2 3 4 5 6
|----------|----------|----------|----------|----------|----------|
[command] [ID] [ Argument ]
Depending on the two last bits, the SDIO driver will wait for a different command response :
0b00
: No response from card0b01
: Short response0b10
: Long response
This command returns 0x01
if successful followed by 512 bytes, 0x00
in case of error.
0b1000000x
)
Configure SDIO interface (The x
value is used to set the SDIO bus width :
0
is 1-bit mode1
is 4-bit mode