Basic Infos
Platform
- Hardware: Wemos D1 mini (ESP-12)
- Core Version: 2.7.4 - 2843a5a
- Development Env: Arduino IDE
- Operating System: Windows
Settings in IDE
- Module: Generic ESP8266 Module
- Flash Mode: dio
- Flash Size: 4MB
- lwip Variant: v2 Lower Memory
- Reset Method: nodemcu
- Flash Frequency: 40Mhz
- CPU Frequency: 160MHz
- Upload Using: SERIAL
- Upload Speed: 921600
Problem Description
SPI SD card usage utilizing SD or SDFS is much slower than expected. Testing utilizing the ESP8266SdFat->bench example sketch is showing write speeds of ~130 KB/s and read speeds of ~650 KB/s. Attempts to utilize ENABLE_EXTENDED_TRANSFER_CLASS and SdFatEx in the bench example fail to compile. Analysis with a logic analyzer show many pauses in SPI transactions while writing data. While troubleshooting, I decided to replace ESP8266SdFat with the upstream version which now supports ESP8266 and ESP32. Testing with the upstream SdFat->bench example showed write speeds of ~1.6MB/s and read speeds of 3.2MB/s, much faster than the current version included in ESP8266SdFat. This does seem to break the SD/SDFS wrappers due to changes in SdFat. Usage of ENABLE_DEDICATED_SPI in SdFat didn't cause any noticeable increase of performance which may warrant further analysis.
2.7.4 ESP8266SdFat bench.ino
Upstream SdFat bench.ino
Basic Infos
Platform
Settings in IDE
Problem Description
SPI SD card usage utilizing SD or SDFS is much slower than expected. Testing utilizing the ESP8266SdFat->bench example sketch is showing write speeds of ~130 KB/s and read speeds of ~650 KB/s. Attempts to utilize
ENABLE_EXTENDED_TRANSFER_CLASSandSdFatExin the bench example fail to compile. Analysis with a logic analyzer show many pauses in SPI transactions while writing data. While troubleshooting, I decided to replace ESP8266SdFat with the upstream version which now supports ESP8266 and ESP32. Testing with the upstream SdFat->bench example showed write speeds of ~1.6MB/s and read speeds of 3.2MB/s, much faster than the current version included in ESP8266SdFat. This does seem to break the SD/SDFS wrappers due to changes in SdFat. Usage ofENABLE_DEDICATED_SPIin SdFat didn't cause any noticeable increase of performance which may warrant further analysis.MCVE Sketch
2.7.4 ESP8266SdFat bench.ino
Upstream SdFat bench.ino