Skip to content

SD_MMC: Incorrect pin settings for ESP32 #10709

Closed
@broddo

Description

@broddo

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

#include <Arduino.h>
#include <SD_MMC.h>


void setup() {
  Serial.begin(115200);
  if (!SD_MMC.begin("/sdmmc")) {
    Serial.println("Failed to mount SDMMC module");
  }
}

void loop() { }

Debug Message

[   177][E][esp32-hal-periman.c:122] perimanSetPinBus(): Invalid pin: 255

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions