mirror of
https://github.com/0xFEEDC0DE64/arduino-esp32.git
synced 2025-06-26 02:11:34 +02:00
Better allocate the buffer for f_mkfs from the heap otherwise the stack requirement of this library is huge due to a work buffer allocated for f_mkfs in sdcard_mount. The work buffer is only needed if argument format_if_empty is set true (which is by default false). This change is quite important if you plan to use this library in a task. as now it increased the tasks stacks size by 4k, even this memory is never used if users are not aware of the large stack requirement during init this library may have other variables on stack that would have written memory outsides its range which can cause various side effects. Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com>
SD library
This library provides the integration of ESP32 and SD (Secure Digital) cards without additional modules.
Sample wiring diagram:
For others SD formats:
Image source: Wikipedia
- Warning: Some ESP32 modules have different pinouts!
FAQ:
Do I need any additional modules, like Arduino SD module?
No, just wire your SD card directly to ESP32.
What is the difference between SD and SD_MMC libraries?
SD runs on SPI, and SD_MMC uses the SDMMC hardware bus on the ESP32.
Can I change the CS pin?
Yes, just use: SD.begin(CSpin)