I did a test of SdFat on GIGA R1.
The default SdFat config has very poor performance.
I used the bench example.
I used SPI1 with pins 10-13.
This definition is required in the bench example:
#define SD_CONFIG SdSpiConfig(SD_CS_PIN, DEDICATED_SPI, SPI_CLOCK, &SPI1)
SPI_CLOCK is 50 MHz.
Here is the result:
Type is exFAT
Card size: 64.09 GB (GB = 1E9 bytes)Manufacturer ID: 0X1B
OEM ID: SM
Product: EC1S5
Revision: 3.0
Serial number: 0X158D576A
Manufacturing date: 11/2020FILE_SIZE_MB = 5
BUF_SIZE = 512 bytes
Starting write test, please wait.write speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
387.99,16777,1310,1317
387.75,1632,1312,1318Starting read test, please wait.
read speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
392.53,1330,1289,1303
392.66,1328,1289,1302
I did a test at 60 MHz. Yes SPI1 seems to support 60 MHz. This slightly improved the performance.
I got about 420 KB/sec.
I then edited SdFatConfig.h and selected array SPI transfer. Here are the changes.
#define SPI_DRIVER_SELECT 1 // was zero
#define USE_SPI_ARRAY_TRANSFER 1 // was zero
Here are the results:
Type is exFAT
Card size: 64.09 GB (GB = 1E9 bytes)Manufacturer ID: 0X1B
OEM ID: SM
Product: EC1S5
Revision: 3.0
Serial number: 0X158D576A
Manufacturing date: 11/2020FILE_SIZE_MB = 5
BUF_SIZE = 512 bytes
Starting write test, please wait.write speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
1763.56,7335,285,289
1769.17,2506,285,288Starting read test, please wait.
read speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
1855.17,281,272,275
1855.17,281,272,275
Better but here are results at 62.5 MHz on a Pi Pico RP2040 with a PIO SPI driver I wrote:
FILE_SIZE_MB = 5
BUF_SIZE = 512 bytes
Starting write test, please wait.write speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
7173.60,91,70,71
7173.60,91,70,71Starting read test, please wait.
read speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
7142.86,108,70,71
7173.60,94,70,71
SPI, the port on the ISP like connector seems to support a max rate of 30 MHz.
Since there are huge gaps of dead time between bytes it doesn't matter much.
At 30 MHz you get about 1350 KB/sec.