SD.begin() fails after a couple of minutes (only hard reset button let it wroks again) #8789
Unanswered
matthieuweber
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I have a strange issue with SD access :
Each time I want to read / write on SD card (I use SD library) I run this code :
(Since there are concurrent SD access in the web server and main()
I use WebServer class)
HARDWARE:
TFT_MISO 19 // Hardware MISO same as SD
TFT_MOSI 23 // Hardware MOSI same as SD
TFT_SCLK 18 // Hardware CLK same as SD
TFT_CS 32 // TFT CS
TFT_DC 21 // TFT DC
TFT_RST -1 // TFT reset not used
TOUCH_CS 27 // touchpad CS
SD CS is on PIN 5
SOFTWARE :
When access is finished I call
Things works great but sometimes SD.begin() in my function init_carte_sd() always fails (every call, everywhere).
The only options to get the card working again is :
Note that if I remove and reinsert the SD card after, lets say, 10 seconds ...or 1 hour, the card is being detected and working great ONLY if init_carte_sd() never failed since boot. (Doing this remove/insert operation after the first fail occurred wont work).
For me It's not an hardware issue (bug can be reproduced on 3 systems).
But since removing / inserting card works, and a simple reset (keeping power) solve the issue, I believe that there is a initialization issue in SD.begin() when called in multiple threads
SD.end() doesn't "reinitialize totally" the SD card in this case
Any ideas ? Is it a library bug ?
Thanks !
Best,
Matthieu
Beta Was this translation helpful? Give feedback.
All reactions