-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Upgrading to 2.0 breaks SD function #5701
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
Sorry, but this may be not enough info. There is many people using SD library in 2.0.0, including myself, and we have no problem with it, but I have to admit that recently i am using mostly esp32S2 and SD card with custom |
Thank you chegewara! rst:0x1 (POWERON_RESET),boot:0x12 (SPI_FAST_FLASH_BOOT) Thank you for any help in advance! |
It looks like hardware problem, but who knows. |
@chegewara, I downgraded back to ver# 1.06 and turned on verbose logging to see why my SD is failing on ver# 2.0. I discovered that it does indeed fail on sdWait() and sdSelectCard(). However, it then mounts correctly and the SD seems to function correctly (read/write, etc.). I forgot to mention above, I'm using an ESP32 WROOM module in a custom board and using a micro SD instead of a mini SD. I checked all the wiring and the SD is indeed connected properly. Here is my code partially taken from the SD example: #define SDM_CLK 18 void setup(){
And here is the serial logs from the above code using ver# 1.06: rst:0x1 (POWERON_RESET),boot:0x12 (SPI_FAST_FLASH_BOOT) Using the same code but upgraded to ver# 2.0 here is the serial logs: rst:0x1 (POWERON_RESET),boot:0x12 (SPI_FAST_FLASH_BOOT) Not sure what the garbage is right after "entry" above, but, as you can see, everything fails using ver# 2.0. I also tried not using the SPI class to initialize the SD card and I get the same results. Any help is greatly appreciated! |
I can confirm. Stock SD card example is giving this result.
|
Bump Any ideas on this issue? |
@P-R-O-C-H-Y please have a look |
@me-no-dev System: Arduino IDE / VS code I dont have more ESP boards home, can try on more boards tomorrow. |
@P-R-O-C-H-Y Any help is greatly appreciated! |
@rayb12 CODE:
OUTPUT:
|
@rayb12 |
@P-R-O-C-H-Y |
@rayb12 Insert this code:
For changing the frequency of SPI, there is function:
|
@rayb12 |
That worked! Here is the output including idf version: ESP-IDF version is: v4.4-dev-2313-gc69f0ec32 Thank you soooooo much!!!! |
@rayb12 No problem :) So I can close this issue right? |
@P-R-O-C-H-Y Yes! Thank you again! |
Hello, this issue is still valid and present. I'm using latest stable 2.0.2 on Arduino, upgraded from 1.0.6 (with which, SD card reader works flawlessly), and I get this with SD.begin(): [ 1088][W][sd_diskio.cpp:104] sdWait(): Wait Failed idf version as reported, is: v4.4-beta1-189-ga79dc75f0a The wiring is correct. The SD card test example sketch fails too, so it's not my code the source of the problem. If I rollback to ESP32 board ver. 1.0.6 the SD card works perfectly again. Could it be the chip select pin of the VSPI definition changed? Or perhaps the internal pullup in VMISO is not enabled? Because otherwise I'm at a loss. @P-R-O-C-H-Y what do you mean with "...update Arduino IDE with latest version of arduino-esp32 master branch" ? Arduino IDE does not allow me to install a board definition outside the File -> Preferences -> paste the .json URL procedure ...or does it? Do you mean I have to download the arduino-esp32 master branch in a zip file and unzip it somewhere in the Arduino IDE data folder? |
This code works on my ESP32 (TTGO v21 old version) without errors;
/cc @paoloinverse |
I just upgraded from 1.06 to 2.0 of the ESP32 Arduino core. Using 1.06 all Sd functions were working properly. After upgrading to 2.0 SD fails to begin. This is a custom board and SD is connected as per the standard SD connections (as in the picture in the Sd library folder).
I copied the Sd example from the Sd library here and it does the same thing, fails to mount SD card.
As a test, I switched back to ver# 1.06 and all SD functions work properly again. Am I missing something?
I searched this forum but could not find anything specifically related to my problem. I'm using the SD library, not the SDMMC library.
System: Arduino IDE
Board Selected in Arduino IDE: ESP32 Dev Module
Code:
if(!SD.begin(){
Serial.println("Card Mount Failed");
return;
}
Code above always returns failed.
I also tried the following code:
if(!SD.begin(5){
Serial.println("Card Mount Failed");
return;
}
I also changed SD cards just in case, but still same problem.
Hope this is enough info. Any help is greatly appreciated!!!
The text was updated successfully, but these errors were encountered: