Skip to content

Commit 420adce

Browse files
authored
fix(sdmmc): Fix iomux pin initialization (#11998)
1 parent 167fb6c commit 420adce

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

libraries/SD_MMC/src/SD_MMC.cpp

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -228,17 +228,19 @@ bool SDMMCFS::begin(const char *mountpoint, bool mode1bit, bool format_if_mount_
228228
#if defined(CONFIG_IDF_TARGET_ESP32P4) && defined(BOARD_SDMMC_SLOT) && (BOARD_SDMMC_SLOT == 0)
229229
host.slot = SDMMC_HOST_SLOT_0;
230230
// reconfigure slot_config to remove all pins in order to use IO_MUX
231+
// Use 0 instead of GPIO_NUM_NC (-1) because ESP-IDF's s_check_pin_not_set()
232+
// function uses !pin which doesn't work correctly with -1 (GPIO_NUM_NC)
231233
slot_config = sdmmc_slot_config_t{
232-
.clk = GPIO_NUM_NC,
233-
.cmd = GPIO_NUM_NC,
234-
.d0 = GPIO_NUM_NC,
235-
.d1 = GPIO_NUM_NC,
236-
.d2 = GPIO_NUM_NC,
237-
.d3 = GPIO_NUM_NC,
238-
.d4 = GPIO_NUM_NC,
239-
.d5 = GPIO_NUM_NC,
240-
.d6 = GPIO_NUM_NC,
241-
.d7 = GPIO_NUM_NC,
234+
.clk = GPIO_NUM_0,
235+
.cmd = GPIO_NUM_0,
236+
.d0 = GPIO_NUM_0,
237+
.d1 = GPIO_NUM_0,
238+
.d2 = GPIO_NUM_0,
239+
.d3 = GPIO_NUM_0,
240+
.d4 = GPIO_NUM_0,
241+
.d5 = GPIO_NUM_0,
242+
.d6 = GPIO_NUM_0,
243+
.d7 = GPIO_NUM_0,
242244
.cd = SDMMC_SLOT_NO_CD,
243245
.wp = SDMMC_SLOT_NO_WP,
244246
.width = 4,

0 commit comments

Comments
 (0)