Implement sdioio for raspberrypi port#11090
Conversation
|
|
|
Nice work, Foamy. This is the fastest setup I've seen. You cracked the 10 MB/s write speed. This is now competitive with Arduino code. SDIO on RP2350 ~4x faster for bulk read / write than SPI mode. Benchmarking using SD Card Performance Guide example code / configuration. Note: I did need to do one single hard power cycle - unplug - the board after updating to the new build to transition from SPI -> SDIO mode. |
|
Feather RP2040 Adalogger 5x improvement with SDIO over SPI for bulk rd/wr. Small bump up in log lines. |
Turn on the PIO SDIO driver for the Feather RP2040 Adalogger's built-in microSD slot, which is already wired for 4-bit SDIO on consecutive GPIOs (CLK=GPIO18, CMD=GPIO19, DAT0..3=GPIO20..23). Set CIRCUITPY_SDIOIO = 1 and add the standard SDIO_CLOCK / SDIO_COMMAND / SDIO_DATA0..3 pin aliases plus the SDIO_DATA four-pin tuple, matching the Metro RP2350 board's pattern so board.SDIO_DATA works out of the box. Tested on hardware: mounts at 25 MHz 4-bit and benchmarks ~9.6 MB/s write, ~8.1 MB/s read (bulk 4096x16) vs ~1.9 / 1.8 MB/s over the SPI auto-mount on the same board and card -- roughly a 5x throughput improvement. The vendored SdFat PIO driver builds cleanly for RP2040 (the RP2350-only gpio_base block compiles out); firmware fits at 92% of the FLASH region. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
sdioio on Feather RP2040 Adalogger
|
Feather RP2350 ADA#6000 + SDIO Breakout ADA#4682 Good results nearly identical to the Metro RP2350
Compiled with :
in:
It costs 10 KB of flash / 2 KB of SRAM to enable SDIO by default for the Feather RP2350. It's not a lot, but also a little hard to justify as most people would not be using SDIO on the Feather RP2350. |
The core functionality of the implementation comes from https://github.com/adafruit/SdFat/. A few files needed altering to work embedded within CircuitPython and hooked up to the bindings.
Basic testing has been completed successfully on a Metro RP2350. Also enabled for Fruit Jam, but not tested yet, should work the same.
board.SDIO_DATAis added to those two devices as a tuple of the 4 sdio data pins to match the existing sdioio documented example.Currently the sdcard automount still uses SPI, and the SPI sdcard interface has some conflicting pins with the sdioio interface. When automount is enabled it holds a lock on those pins preventing them from being used for sdioio. The settings.toml config
CIRCUITPY_SDCARD_USBalready disabled the automount, but was still holding the pins even when set to false. This PR changes the behavior to not hold the pins when the config isFalse. I did not look into changing the automount over to use sdio, maybe that would be a good option in the long term? For right now you must haveCIRCUITPY_SDCARD_USB = falsein settings.toml to use this.@mikeysklar You recently did a bunch of sd card testing. If you're interested in trying this out it would be appreciated.