The Sparkfun esp32 datalogger iot board is has exactly the hardware I want for my next project, including the 4-bit SDCard interface. I am developing the software in Platformio in an Arduino framework. Unfortunately, there is no board definition for the “sparkfun_esp32_datalogger_iot” so I am using the “sparkfun_esp32_iot_redboard” which is similar except for the spi sdcard interface. All the previously developed datalogging code from the redboard came over and is working as expected. However, when I include the SD_MMC driver the code hangs in the SD_MMC.begin() function and never returns. The code to that point is:
void setup() {
int clk = 14;
int cmd = 15;
int d0 = 2;
int d1 = 4;
int d2 = 12;
int d3 = 13;
Serial.begin(115200);
SD_MMC.setPins(clk, cmd, d0, d1, d2, d3);
if (!SD_MMC.begin()) {
Serial.println("Card Mount Failed");
return;
}
I have looked through the SD_MMC code but cannot see what the problem could be. I have tried the sd_card_example_main.c code from platforms\espressif\examples\espidf-storage-sdcard\src and while it assumes an espidf environment, I compiled it anyway and it fails with the messages:
Initializing SD card
Using SDMMC peripheral
Mounting filesystem
E (53) sdmmc_common: sdmmc_init_ocr: send_op_cond (1) returned 0x107
E (54) vfs_fat_sdmmc: sdmmc_card_init failed (0x107).
I am at a loss for what to try next. Sparkfun normally provide excellent get-you-going doco for their boards but for this one it is sadly missing.
Any help would be greatly appreciated.
Ron