• Using the attached test script, I've been investigating the maximum write speed I can get out of my 2GB SD micro card.

    Out of the four SD micro cards I have to hand, I can only get one to work. Also note that the write speed of every card is likely to be different.
    I find that writes are most efficient when I write a block of 2048 bytes. The data I am writing is just 'A'-'Z' repeated to fill the buffer. What I write doesn't appear to make any difference.

    The script allows you to choose software SPI or hardware SPI. If you you'd like to run the test on your Espruino and post the average speed you get here, that would be interesting for all to see.

    With my working SD micro card the best speed I can get is with hardware SPI, where I can an average write speed of ~380 kbps (with an SPI baudrate of 2,000,000 being the highest setting that makes a difference). If I switch to software SPI it drops to ~230 kbps

    The 'problem' I am having, that is affecting my application, is a series of unexpected delays in the File.write() where is takes 4-5 times the average write time at random intervals during a 200K file write in 2K blocks. I've attached an example log output from running the script. The 'long' writes are highlighted by a >>>>>>>>>>>>>>>>>>>>>>>>>>. These happen using either hardware or software SPI, so I wonder if it is the SD card itself taking longer to respond or if it is an problem with the SPI module?

    Any insights here would be good, and solutions would be better.

    P.S. all my testing is on an Espruino Pico

    2 Attachments


Avatar for Snerkle @Snerkle started