Is is possible to use SDMMC on the SparkFun Thing Plus - ESP32 WROOM?

Example show SDMMC.setPins(int clk, int cmd, int d0, int d1, int d2, int d3); but is this compatible with the ESP 32 used for the thing plus?

Thanks

Bruce

on a Thing Plus the onboard MicroSD is used in single line (SPI) mode. If you want to make use of the SD-mode you will need to connect an external SDMMC device to the correct GPIO’s. (https://docs.espressif.com/projects/esp … _host.html) Looks like the ESP32 WROOM is exposing the GPIO for slot1 external.

I need to revise my question maybe?

How do I determine what family of ESP32-xx do I have?

There are different chips 32-D/U/S , modules (ESP32-PICO) , surface mount boards (ESP32-WROOM-32D is on listed) and families(ESP32-xx).

If you look at the “sdk” folder you will see esp32, esp32c3, esp32s2, esp32s3.

Each one of them lead to difference in IO capability.

If you look at the SD_MMC.cpp, you will see that if

#ifdef SOC_SDMMC_USE_GPIO_MATRIX
    // SoC supports SDMMC pin configuration via GPIO matrix.

you will have access to

bool SDMMCFS::setPins(int clk, int cmd, int d0, int d1, int d2, int d3)
{
    if (_card != nullptr) {
        log_e("SD_MMC.setPins must be called before SD_MMC.begin");
        return false;
    }
#ifdef SOC_SDMMC_USE_GPIO_MATRIX
    // SoC supports SDMMC pin configuration via GPIO matrix. Save the pins for later use in SDMMCFS::begin.

So how can one be sure if this capability exists?

Thanks

Bruce

Much better question Bruce :slight_smile:

The different versions of ESP32 can be very confusing. (actually are very confusing !)

Which board do you have or do you plan to use from Sparkfun ( WRL-???)

Does your solution really have to use the SD-mode or will the (slower, single channel) SPI-mode work as well for you?

PID 15663 SparkFun (PID 15663 Thing Plus - ESP32 WROOM with ESP32-D0WDQ6 chip

Bought on Jeff’s place.

Thanks

Bruce

It took some time to fiddle it out.

The short answer is: I do not expect that the ESP32 SDMMC library can be used as GPIO2 is NOT connected on this board. (15663)

The SLOT1 GPIO’s that can be used are defined for each processor: For an ESP32 that is

#define SDMMC_SLOT1_IOMUX_PIN_NUM_CLK 14

#define SDMMC_SLOT1_IOMUX_PIN_NUM_CMD 15

#define SDMMC_SLOT1_IOMUX_PIN_NUM_D0 2

#define SDMMC_SLOT1_IOMUX_PIN_NUM_D1 4

#define SDMMC_SLOT1_IOMUX_PIN_NUM_D2 12

#define SDMMC_SLOT1_IOMUX_PIN_NUM_D3 13

#define SDMMC_SLOT1_FUNC 4

As you do setpins() and SOC_SDMMC_USE_GPIO_MATRIX is NOT set AND CONFIG_IDF_TARGET_ESP32 is set, it will check that these pins are used as can be seen in the remark.

 // ESP32 doesn't support SDMMC pin configuration via GPIO matrix.
 // Since SDMMCFS::begin hardcodes the usage of slot 1, only check if
 // the pins match slot 1 pins.

The SOC_SDMMC_USE_GPIO_MATRIX only seems to be set for the ESP32-S3-USB-OTG board.

The ESP32 target is defined in the boards.txt file.

Maybe you can alter the library and configuration files in different places you might get it to work.