-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Cannot run SD / SDMMC example on Olimex Esp32 EVB #495
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 have Maple ESP32 R1 and I had your problem but II could use SD Card after initializing customized SPI Pins |
Thanks but I have tried your suggested SPi configuration but it doesn't work....I think that Maple and Olimex EVB have different SD connections. |
Did you get this to work? |
Finally with the help of Olimex this has been sorted out! | host.max_freq_khz = SDMMC_FREQ_HIGHSPEED; To host.max_freq_khz = SDMMC_FREQ_PROBING; Can this be done without changing library code? |
I also have the Olimex board and as far as I was able to test, only decommenting the "host.flags" line was enough to make the example run. |
You have to change both lines |
I got it to work only with host.flags = SDMMC_HOST_FLAG_1BIT: The code is as follows:
|
i try to get this to work for over a month now. Still no success. I think my wiring is incorrect (especially the pull ups). Can someone please post a "real" picture of his wiring? @melvinpmathew ?
When i uncouple vcc from pull ups, i'll get the "normal"
message. So something has to be wrong with my circuit. But like i said, a "real" picture would help me a lot. Which I think of my construction is strange, is the fact, that i cable this way: 3.3VCC -> 10k pull up -> wiring to esp32 gpio's -> sd card adapter on a breadboard. So the datas can be transmitted between esp32 and sd card, but also the gpio's of the esp32 get voltage of the 3.3V + 10k resistors. Hope its clear what i mean. You can see it here. |
Yeah, i also found this example. But thats no really help me. Is this only for 1 bit? Only IO15, IO2 and IO14 are connected. DAT1, DAT2 and DAT3 are only with 10k pull ups at 3.3V? Actual i'm a little deperate after weeks of a not well working sd card. So here you can see my setup. Not very beauty, but it shows perfectly my circuit. May you see at first attempt the issue. Edit: Just tried again this setup. Internal blue LED is glowing timeout waiting for paket handler. I almost think it has something to do with IO12 |
You own this board, right? https://github.com/SmartArduino/SZDOITWiKi/wiki/ESP8266---ESP32 |
Done ;) void mountSdMmcCard(){
if(!SD_MMC.begin()){
Serial.println("Card Mount Failed");
return;
}
uint8_t cardType = SD_MMC.cardType();
if(cardType == CARD_NONE){
Serial.println("No SD_MMC card attached");
return;
}
Serial.print("SD_MMC Card Type: ");
if(cardType == CARD_MMC){
Serial.println("MMC");
} else if(cardType == CARD_SD){
Serial.println("SDSC");
} else if(cardType == CARD_SDHC){
Serial.println("SDHC");
} else {
Serial.println("UNKNOWN");
}
uint64_t cardSize = SD_MMC.cardSize() / (1024 * 1024);
Serial.printf("SD_MMC Card Size: %lluMB\n", cardSize);
} |
well make sure you select the proper board from the menu |
oh... and no SPI while using MMC... unfortunately Olimex did not attach SS pin for the card (looking at schematic), so we can not use it with SPI |
Well, it worked. I also have to add |
@Staubgeborener Just saw this now. Were you able to make this work? The connection were exactly the same as you have shown, Just that I had a 1k pullup on my IO2 line(10k pullup should also not matter in this case), rest all were 10k pullups. Also only the 1 line mode works, the 4 line mode has some issues coming from the driver level and hence I don't think it worth investigating that now. Incase you find that its working share here too.Let me know if you still need help. |
Still only 1 line is working here. I have the issue, that i'll get a brownout error when using sdmmc example together with esp_start_wifi. In my case: 10k pull ups for: D3, CMD, CLK, D0, D1 + Jumper between IO0 and IO2. |
Guys I did no modification to my board! EVB board + sdcard + ethernet (did not test WiFi). Selected the appropriate board in the menu and gave it a go. All worked fine (with the latest commits to this repo). No modification or pin jumping was necessary. |
@me-no-dev |
@pbecchi a few comments above: #495 (comment) |
I know that there is a problem of bad contact between the holder and the SD card in the EVB board |
I did not experience those (yet), but anyway :) issues like that are out of the scope of Arduino ;) should be handled by the manufacturer :) |
My EVB, after moving the SD , worked! |
@pbecchi when you say worked, do you mean on the 4-line MMC mode? or just 1? |
@Staubgeborener thats correct. I have IO2 pulled HIGH on normal operation with a 1k\10k pullup. And when we need to flash the firmware, IO2 is pulled LOW. Just to be clear, you still have it working on 1-line mode correct. Its only the 4-line mode which is not working. |
Yes 1 linea MMC mode, no other way! |
@pbecchi Ok thanks. |
@melvinpmathew It's weird on my setup. I have the whole time IO0 connected to IO2 to flash AND to run SDMMC (1 line). When i try to pull IO2 low when flashing and after that high its not working. So to be clear: I have to connect IO0 to IO2 and IO2 to SD (with 10k pull up). Sure, with this setup my blue led is always glowing, but no other setup worked here. |
It's a never ending "love"story. It's not working here anymore.Without doing anything (nothing at code nor circuit), i'll get brownout detection errors while IO0 is connected to IO2. I use alls of the guides i found (connect IO2 to GND while flashing and after flashing disconnect this jumper, etc) but i'll get only |
@Staubgeborener The connection from IO2 goes to 3.3v with a jumber in between. I remove the jumper when flashing only. I have seen this error when connection is bad. Forgot what the exact issue was. I know its apain to get it working. I had to rewire and make sure the connections were proper multiple times to finally have it working. |
@melvinpmathew Wait. With a jumper cable between IO2 and 3.3V you mean the pull up resistor between or truly just a jumper? is esp_start_wifi() working in the Main of the sdmmc example on your side? I'll get a brownout error. Everytime i try to use wifi + sdmmc there is brownout. Edit: Ok, brownout disappeared (don't know why) but only SPI is working here. And instead of brownout i've got an Guru Meditation Error (in my own code, sdmmc example with spi works. But in my own code i use FreeRTOS to run some code on second core). No more 1-line anymore. But when flashing SPI mode on my ESP32 i don't have to pull down IO2. I left the circuit as it is and just flash. |
Can someone please try SDMMC + wifi + create a task on second core (for example with a while true loop and some calculations like increment an integer or so). |
@Staubgeborener I mean a true jumper between IO2 and 3.3v. A pullup is just to achieve logic level!: In electronic logic circuits, a pull-up resistor is a resistor connected between a signal conductor and a positive power supply voltage to ensure that the signal will be a valid logic level if external devices are disconnected or high-impedance is introduced.(Pull-up resistor - Wikipedia) |
@melvinpmathew So your circuit looks like this When flashing you disconnect the jumper from IO2 -> 3.3V and after flashing (befor If your setup looks different, please edit this and show. Thanks. |
@Staubgeborener I've written a program that lists every 10 seconds the root of the SD card add publishes a message to my MQTT broker over WiFi. Using xTaskCreate, a second task is running, which increments and prints every second a counter. Add this runs fine! My SDMMC config in the library is this one, so only 1-bit mode:
|
Nevermind, it's also working here now! Found out, that the writing intervals on my sd card where to short (some hundred times in a second, don't ask). This cause a |
much easier with latest update |
I have just downloaded last commit and I am trying to run SD example and / or SDMMC example on Olimex EVB board (I am unsure witch one is applicable).
Build is OK but I get "Card Mount Failed" message at run time.
Do I need to change any #define for Olimex EVB board?
The text was updated successfully, but these errors were encountered: