HydraFW binary MMC mode guide - hydrabus/hydrafw GitHub Wiki

HydraFW binary MMC mode guide

This guide is updated towards firmware release HydraFW v0.11 and later

This mode is specific to MMC/eMMC (and it does not support SDCard).

  • For SDCard support, see SDIO

This mode allows to control MMC

  • MMC pins: CLK=PC12, CMD=PD2, D0=PC8

For more details see https://github.com/hydrabus/hydrafw/wiki/HydraFW-MMC-guide

Commands

Once the MMC mode has been selected, the following commands are available :

  • 0b00000000 Return to main mode. Returns BBIO1
  • 0b00000001 Mode identification. Returns MMC1
  • 0b00000010 Read CID
  • 0b00000011 Read CSD
  • 0b00000100 Read block
  • 0b00000101 Write block
  • 0b00000110 Read EXT_CSD
  • 0b1000000x Configure MMC interface

Command details

Read CID (0b00000010)

This command will reply with 16 bytes containing the card CID.

Read CSD (0b00000011)

This command will reply with 16 bytes containing the card CSD.

Read block (0b00000100)

This command will read the next 4 bytes as the block number (little-endian). The command will reply 0x01 followed by the resulting block data (512 bytes). It will reply 0x00 in case of error.

Write block (0b00000101)

This command will read the next 4 bytes as the block number (little-endian), then 512 bytes of data. The command will reply 0x01 if successful, 0x00 otherwise.

Read EXT_CSD (0b00000110)

The command will reply 0x01 followed by 512 bytes of EXT_CSD register value if successful, 0x00 otherwise.

Configure MMC interface (0b1000000x)

The x value is used to set the MMC bus width :

  • 0 is 1-bit mode
  • 1 is 4-bit mode