2
New
Intermediate
Project guide
Benchmark Setup
These are the parameters and the code used in measuring the data for this guide. Jeff Epler's Benchmarking SD card access code was used with an identical code.py and mount_sd.py varied based on board type.
Other considerations:
- All benchmarks were run on CircuitPython 10.3.0-alpha.2
- Freshly formatted exFAT SD card was used.
- Disabled host OS pass-through
-
settings.toml :
CIRCUITPY_SDCARD_USB = false
-
settings.toml :
- Best-of-3 runs
- The file is not closed or flushed after each line
- SD card used - 64 GB A2/U3 SD card (minimum guarantee on card ability)
- U3 - 30 MB/s
- A2 - Random read performance: 4000 IOPS
- A2 - Random write performance: 2000 IOPS
- Clock is fixed on boards with build in SD card slots
- Memento shares the SPI bus with its TFT. Released the display and deselect the TFT_CS pin
Metro RP2350 mount_sd.py
Nothing needs to be done on the RP2040 and RP2350 boards with a built-in SD card slot. The card is automatically mounted.
pass # /sd is already mounted by firmware at 25 MHz SPI
import board, sdioio, storage
sd = sdioio.SDCard(
clock=board.SCK,
command=board.MOSI,
data=[board.MISO, board.D9, board.D10, board.D11], # DAT0..DAT3 (4-bit bus)
frequency=40_000_000, # 40 MHz — API max, verifies clean
)
storage.mount(storage.VfsFat(sd), "/sd")
import board, sdcardio, storage spi = board.SPI() sd = sdcardio.SDCard(spi, board.SD_CS, baudrate=24_000_000) storage.mount(storage.VfsFat(sd), "/sd")
import board, sdcardio, storage spi = board.SPI() sd = sdcardio.SDCard(spi, board.D5, baudrate=24_000_000) # TFT Wing V2 SD CS = D5 storage.mount(storage.VfsFat(sd), "/sd")
import board, sdcardio, storage spi = board.SPI() sd = sdcardio.SDCard(spi, board.D10, baudrate=24_000_000) # Adalogger Wing SD CS = D10 storage.mount(storage.VfsFat(sd), "/sd")
import board, sdcardio, storage, digitalio, displayio displayio.release_displays() # stop the camera UI driving the bus tft = digitalio.DigitalInOut(board.TFT_CS) # park TFT CS high so it releases the bus tft.direction = digitalio.Direction.OUTPUT tft.value = True spi = board.SPI() sd = sdcardio.SDCard(spi, board.CARD_CS, baudrate=20_000_000) # 20 MHz to stay in spec storage.mount(storage.VfsFat(sd), "/sd")
Page last edited June 03, 2026
Text editor powered by tinymce.