SD.begin()
calls functions that don't acquire SPI and thus is not thread-safe
#9438
Closed
1 task done
Labels
Board
ESP32-S3
Device Description
ESP32-S3-WROOM-1-N16R8
Hardware Configuration
TFT & SD card sharing SPI bus (SPI modes 3 and 0)
Version
v2.0.14
IDE Name
PlatformIO
Operating System
n/a
Flash frequency
40MHz
PSRAM enabled
yes
Upload speed
115200
Description
When calling
SD.begin()
from one task while drawing to TFT display from another task, visual glitches occur on display due to sdcard_init not instancing AcquireSPI.sdcard_mount
, on the other hand, does acquire SPI.Temporary workaround to still use SD card, albeit without high-level interface:
Same behavior is observed with
sdcard_uninit
. Suggested fix is to addAcquireSPI lock(card
) intosdcard_mount
andsdcard_uninit
.Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: