Test program for SDHCFileSystem performance test.

Dependencies:   FatFileSystem mbed

Fork of SDHCFileSystem by Klaus Bu

SDHCFileSystem performance test.

Using SDHCFileSystem/FatFileSystem via fopen()/fwrite()/fclose() . With simple code of reading/writing (fgets()/fputs()) text file.

in performance test of fwrite()

  • File size is changeable
  • Block size is changeable
  • SPI Frequency of SDHCFileSytesm is changeable

You can change SPI Frequency by changing the SDHC_SPI_FREQUENCY in SDHCFileSystem.h

// spi frequency (Hz) 100000->100kHz
#define SDHC_SPI_FREQUENCY 2000000

performance test funcion

in main.cpp

void speedtest(char *path, int totallen, int blocklen, bool unlinkfile);
path
full path of the file
totallen
total length (byte) of test data
blocklen
length (byte) of the data writing once by fwrite()
unlinkfile
true->remove the file as ending this function
Committer:
xxll
Date:
Sat Jul 24 19:45:29 2010 +0000
Revision:
0:90601632692f
Child:
1:f69b56cac865

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
xxll 0:90601632692f 1 #include "mbed.h"
xxll 0:90601632692f 2 #include "string"
xxll 0:90601632692f 3 #include "SDHCFileSystem.h"
xxll 0:90601632692f 4
xxll 0:90601632692f 5 SDFileSystem sd(p5, p6, p7, p8, "sd"); // mosi, miso, sclk, cs
xxll 0:90601632692f 6
xxll 0:90601632692f 7 int main() {
xxll 0:90601632692f 8
xxll 0:90601632692f 9 FILE *fp = fopen("/sd/myfile.txt", "w");
xxll 0:90601632692f 10 fprintf(fp, "\n\rHello World!\n\r");
xxll 0:90601632692f 11 fclose(fp);
xxll 0:90601632692f 12 }