Skip to content

ESP8266SdFat Performance vs Upstream SdFat #7772

Closed
@forkineye

Description

@forkineye

Basic Infos

  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have tested that the issue is present in current master branch (aka latest git).
  • I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • I have filled out all fields below.

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.

MCVE Sketch

2.7.4 ESP8266SdFat bench.ino
Upstream SdFat bench.ino

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions