Need help with ESP32-EVM SD_MMC - does not start/init

Started by joopheuvel, April 12, 2023, 04:30:09 PM

Previous topic - Next topic

joopheuvel

Hi Forum / Olimex specialists/helpdesk:

Have now been trying for a few days to get the SD card working on the EVB's that I just got shipped (last version, K). I am programming in Arduino/IDE.Finding sample arduino code is difficult, much is on Python if at all. See posts on pin numbers, data pins (D), frequencies etc. but am stuck. Tried the stock example SDMMC_Test (I do see that in the comment they talk about pins 2-D0,14-CLK,15-CMD so that makes me believe this is the correct code, but they also list D1 to D3 in the comment section) and gives me this:

15:26:37.708 -> E (63) sdmmc_sd: sdmmc_check_scr: send_scr returned 0xffffffff
15:26:37.708 -> E (63) vfs_fat_sdmmc: sdmmc_card_init failed (0xffffffff).
15:26:37.708 -> Card Mount Failed

So this call fails in the sketch, early on at init: SD_MMC.begin().

Uses libs: #include "FS.h"; #include "SD_MMC.h"
Can you please help guiding me to the right solution to get this working?
Thanks
Joop
 

LubOlimex

The SD card of ESP32-EVB is in 1-bit SD mode to save pins (as opposed to 4-bit one). It uses less pins but you need to use library compatible with 1-bit SD mode.

Did you:

- Install official Arduino for ESP32 package?

- Select ESP32-EVB from the board selector?

- Try the default Arduino demo that comes for SD card, named exactly "SD_Test"? This one:

https://github.com/espressif/arduino-esp32/blob/master/libraries/SD/examples/SD_Test/SD_Test.ino
Technical support and documentation manager at Olimex

joopheuvel

#2
Thanks.
Good tips!

After some tries and also gettin rid of errors related to duplicate SD libaries (one in the project/sketch libaries and one deep in appdata, and also a '(esp32)' reference in a library file). I think in the end the boardswitch did the trick. It works with your suggested sketch but also the one in the example libaries (only difference is SPI.h).

Thanks again.
Joop

joopheuvel

Hi
I need to add one more thing. The link you provided to a sketch included SD.h and that does not work. I had to use the original SD_MMC sketch that includes SD_MMC.h and that worked.
using SD.h resulted in a çard not mounted' error. Am I correct and is this what is should be?
Thanks again.
Joop

LubOlimex

Yeah it is usually one of these two examples that work. I didn't test which of the two was just spoke from memory, glad the issue is solved. Use that as basis.
Technical support and documentation manager at Olimex