You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently updated one of my old projects that was using IDF v4 to IDF v5 and upgrade to the latest version of the Arduino library too. The hardware for this project includes an eMMC card that was functioning fine on the old libraries.
The eMMC card no longer works when using the latest libraries. The reason is due to several calls to the perimanSetPinBus which result in this error:
These calls fail because _pin_clk, _pin_cmd are indeed set to -1 if you are configuring for an ESP32. The solution is was to just add a #ifndef CONFIG_IDF_TARGET_ESP32 to exclude these calls on ESP32 hardware.
Sketch
#include<Arduino.h>
#include<SD_MMC.h>voidsetup() {
Serial.begin(115200);
if (!SD_MMC.begin("/sdmmc")) {
Serial.println("Failed to mount SDMMC module");
}
}
voidloop() { }
In the constructor, _pin_clk = SDMMC_SLOT1_IOMUX_PIN_NUM_CLK, so it should use the pins as defined in soc/sdmmc_pins.h. What do you get if you print out SDMMC_SLOT1_IOMUX_PIN_NUM_CLK?
Also, please be more precise about what version and IDE you are using. platformio is generally not using the latest release candidate unless you specifically point it there.
D'oh - I missed the define BOARD_HAS_SDMMC. Sorry - I can't believe I missed that. It guess it wasn't in my project originally as I was using an older version of this library that didn't require it and I'm also running custom hardware. I see that it is defined in some board variants but can you suggest a good place for me to define this? I just added a add_compile_definitions(BOARD_HAS_SDMMC) to the top level CMakeLists.txt rather than try wrestling with making a custom board variant.
(I'm not using platformio - I'm using IDF v5.3.1 with Arduino ESP32 (v 3.1.0-RC2 804ee12) added as a component.)
Board
ESP32-DEVKITC-32E
Device Description
SDCARD breakout board wired via breadboard
Hardware Configuration
N/A
Version
v3.1.0-RC2 804ee12
IDF v5.3.1
IDE Name
VSCode
Operating System
macOS 14.5
Flash frequency
40 Mhz
PSRAM enabled
yes
Upload speed
460800
Description
I recently updated one of my old projects that was using IDF v4 to IDF v5 and upgrade to the latest version of the Arduino library too. The hardware for this project includes an eMMC card that was functioning fine on the old libraries.
The eMMC card no longer works when using the latest libraries. The reason is due to several calls to the
perimanSetPinBus
which result in this error:[ 177][E][esp32-hal-periman.c:122] perimanSetPinBus(): Invalid pin: 255
These calls fail because _pin_clk, _pin_cmd are indeed set to -1 if you are configuring for an ESP32. The solution is was to just add a
#ifndef CONFIG_IDF_TARGET_ESP32
to exclude these calls on ESP32 hardware.Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: