How fast it goes
Three modes, two boards, one card, five verified rounds each. SPI sustained 1.4 MB/s writing; 4-bit mode sustained 2.7. The interesting number is not the biggest one — it is the gap between the sustained figure and the sprint.
What the bench measured
One ESP32-S3, one card, jumper wires on a breadboard. Each row is five rounds of a large file — around 100 MB in SPI and 1-bit, 64 MB in 4-bit — with every round's read-back checksummed against what was written. Every round passed on both boards in all three modes.
| Mode | Clock | Write | Read | Sprint read |
|---|---|---|---|---|
| SPI | 24 MHz | 1.39 | 1.56 | 1.64 |
| SD_MMC 1-bit | 40 MHz | 2.16 | 2.67 | 2.91 |
| SD_MMC 4-bit | 40 MHz | 2.63 | 3.80 | 5.04 |
MB/s, on the microSD board. The full-size board matched it to within a hundredth in SPI and 1-bit mode; its 4-bit row is lower, and four wires, one clock is why.
Read the two read columns
The sprint figure is nearly a third higher than the sustained one in 4-bit mode, and that gap is the honest part of this table. It is the same card and the same wires; the difference is that the sprint does nothing but move bytes, while the sustained figure includes verifying every one of them.
A real sketch is closer to the sustained column, and usually below it, because a real sketch is also doing whatever made it want to write a file.
Writing barely moves
Going from SPI to 4-bit bought 2.4× the read speed and 1.9× the write speed. The reason is inside the card: flash has to be erased before it can be written, and the card's controller does that between the blocks you send it. Widening the bus does not make that step any shorter.
This is also why the advice about buffering matters more than the advice about modes. Writing 30 bytes at a time makes every one of these numbers irrelevant.
So which mode
If you are logging a line a second, use SPI. Four wires, any pins, any microcontroller — and a thirty-byte row once a second is 30 B/s, which 1.4 MB/s covers tens of thousands of times over.
If you are recording audio, writing camera frames or reading a file back to serve it over Wi-Fi, the two extra wires are worth having. Everything after this page is about getting them right.
When it does not work
Check three things in order: the SPI clock your sketch asked for, whether you are opening and closing the file per write, and whether the card is nearly full. The bench ran SPI at 24 MHz with a 32 kB buffer on a card with room on it, and each of those three can cost you more than the choice of mode does.
No. A class-10 card is rated for 10 MB/s and the fastest thing measured here was 5.04 MB/s, so the bus and the microcontroller are the limit, not the card. Buying a UHS-II card for an ESP32 buys nothing.
Because a flash cell has to be erased before it is written, and the card's own controller does that work between the blocks you send. Reading has no equivalent step. That gap is the card's, not the bus's, which is why widening the bus to four lines helped reading more than writing.
The sustained figure is five rounds of a large file with every round's read-back checksummed against what went in. The sprint is the best block size a scan could find, 32 MB at a time, with no verification and nothing else happening. Sustained is what a logger sees; sprint is what a specification would print.
Why four data lines carry a byte in a quarter of the clock ticks and do not go four times as fast.
Four wires, one clock →Edit this page — content/books/sd/how-fast-it-goes.mdx
Questions about this product
See what other owners have asked, and read their solutions.
This page covers several products. Choose yours to see the right discussions.
Discuss this article
Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.