For Pi Day, I tried benchmarking the SD card interface on a new SparkFun RP2040 mikroBUS Development Board that I had just gotten - RP2040 SD Card SPI Benchmark.
I was somewhat disappointed in the results - around 140KB/Sec Write and Read.
LeScherd commented that he had been able to achieve around 2MB/Sec using a Pi Pico with a hand wired interface to an SD card socket. I had used the benchmark example that was included with the SDFat library and he had used a somewhat customized program that tweaked the SPI clock frequency and the processor voltage. He gave me a copy to try and while my results improved, they were still far short of his. With this program I got around 250KB/Sec.
Of course there are quite a few variables in play. I am using a SanDisk Ultra 16GB SD card and he is using a SanDisk Extreme Plus 32GB. I would not have expected my card to be the limiting factor and he also got over 1.5MB/Sec using a ONN (Walmart brand) 32GB card.
The boards are certainly different - The SparkFun board uses SPI1 for the SD card and Bill used SPI0 in his setup. Maybe I need some extra configuration?
I realized that I have another SD card setup, a Xiao expansion board, and I also happen to have a Xiao RP2040 that I haven't tried. I checked the schematic and the expansion board uses SPI0 for the SD card.
So, time for some experiments...
Here's the expansion board setup.
And the results. I included a standard Xiao (SamD21 - M0) on the same expansion board for reference.
Board | Processor | Bench Test | SPI interface | Write KB/s | Read KB/s | SD Card |
Pi Pico | RP2040 | Modified | 0 | 2010 | 2100 | Sandisk Extreme Plus 32GB |
Sparkfun MikroBus | RP2040 | Stock | 1 | 143 | 143 | SanDisk Ultra 16GB |
Sparkfun MikroBus | RP2040 | Modified | 1 | 255 | 255 | SanDisk Ultra 16GB |
Xiao + Expansion | SamD21 | Stock | 0 | 369 | 355 | SanDisk Ultra 16GB |
Xiao RP2040 + Expansion | RP2040 | Stock | 0 | 476 | 479 | SanDisk Ultra 16GB |
Xiao RP2040 + Expansion | RP2040 | Modified | 0 | 769 | 768 | SanDisk Ultra 16GB |
I guess it just shows me that if it really mattered, I should test the SD card speeds in a specific configuration. I should probably try some other SD cards in my RP2040 configurations (I don't have an Extreme Plus). Maybe I should try to wire an SD socket to a Pico and see if I can reproduce Bill's results .