-
Notifications
You must be signed in to change notification settings - Fork 7.6k
SD.begin() crashes the board if called again after failing to mount #613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I can reproduce this issue also with SD card reader attached but no SD Card present |
Soliution is verry simple, open SD.c and in 39 line replace sdcard_uninit(_pdrv); to sdcard_unmount(_pdrv); |
done ✅ |
I have replace sdcard_uninit(_pdrv); to sdcard_unmount(_pdrv); but still sd card mount failed in 2nd time onwards. first time it is working fine.please help me. |
Just did this. From total fail to totally working. Miracle fix! |
Hardware:
Board: ESP32-DevKitC
Core Installation/update date: 9/6/2017
IDE name: Tested with platformio stage and "stable"
Description:
If the first attempt mounting an SD card via SD.begin() fails for some reason (such as the SPI bus is disconnected), subsequent calls crash the board. I suspect something is either not getting cleaned up or is getting cleaned up incorrectly when the mount fails.
If the card mounts successfully, I can run SD.end() and then SD.begin() as many times as I like without issue.
Sketch:
You can reproduce this by running the sketch below while not having an SD card reader attached.
Debug Messages:
Stacktrace:
No extra info seems to show up with debug on, but I've attached a decoded but not particularly helpful stacktrace:
Thanks for all your awesome work and let me know if I can provide any additional information.
The text was updated successfully, but these errors were encountered: