Skip to main content

SD Interface (4-Wire and SD-over-SPI)

The C0-microSD+ presents itself to the host as a standard SD block-storage device and carries the memory-mapped transactions of the MMIO Interfacing Model over the SD bus. The module uses the microSD UHS-II form factor, so it drops into any standard microSD slot and stays hot-swappable.

danger

Do not insert the C0-microSD+ into a host that drives UHS-II signaling on the second pad row. The module does not support such a host, because the UHS-II differential lines interfere with the configuration flash. Use a standard microSD slot, which contacts the eight SD pads of the first row only, or a full-size SD slot reached through a passive microSD-to-SD adapter, which wires only that same first row.

Block read and write, not SDIO

All communication is achieved through host-initiated block read and write operations, the same operations a host uses for any SD card. The module does not use the SDIO extension of the SD standard. Because the module looks like an ordinary SD block device, no additional host drivers are required, and any operating system that supports the standard SD protocol can talk to it.

Every transfer starts at the host. The module never initiates a transaction of its own, so a host application that needs to observe device state polls the relevant address rather than waiting for the module to signal it.

Unformatted block device

When you insert the module, it enumerates as an unformatted block device. Do not format it, and do not accept a host prompt that offers to format it for you. A file system would write its own structures over addresses that the module decodes as registers, flash, and buffers, which corrupts the on-device layout and can overwrite the FPGA bitstream. See Host OS support for per-platform guidance on suppressing automatic mount and format prompts.

The module reports a capacity of 268.4 MB on macOS and 256 MiB on Linux and Windows. Both figures describe the same quantity, one written in decimal units and the other in binary units.

Electrical modes

The C0-microSD+ supports two electrical modes, so the same module works with both high-end hosts and low-cost microcontrollers.

  • SD 4-wire, the standard 4-bit SD data bus, used by SD hosts, card readers, and single-board computers.
  • SD-over-SPI, the SPI-mode fallback of the SD standard, for straightforward integration with low-cost microcontrollers that expose an SPI peripheral.

Both modes carry the same block transactions and reach the same addresses, so a host application written against one mode works unchanged against the other. For the hosts that Signaloid has tested, see Compatibility.

Carrying MMIO over SD

The address map of the C0-microSD+ is unified. The host communicating over the SD bus and the RISC-V core inside the Signaloid SoC use the same addresses, so the host reads and writes module addresses directly rather than translating them through a separate host-side offset map. To read the STATUS register at 0x08208000, a host application seeks to 0x08208000 on the block device and reads four bytes. To pass operands to a device application, the host writes them into the input half of the MMIO buffer, and the device application reads them back at the same address the host used.

The complete address map, the register definitions, and a worked example of driving a transaction from a host program are in Host Interface and Protocol.

Block-write CRC handling

The SD standard protects each written block with a CRC. The C0-microSD+ exposes an SD_CONFIG register that controls how the module handles the CRC of an incoming block write, and the C0_SD_toolkit.py script in the Signaloid-Compute-Module-Utilities repository reaches that register through its config subcommand. Leave the defaults in place unless you are bringing up an SD host whose CRC generation you are still debugging.

Next steps