From 57cf18d7d455a78eb0692a16b6487f967333cb33 Mon Sep 17 00:00:00 2001 From: Josep Comas Date: Mon, 16 Oct 2023 18:23:56 +0200 Subject: [PATCH 1/3] ports/esp32/machine_sdcard.c: CLK, CMD and D0 custom pins in SD/MMC. Signed-off-by: Josep Comas --- ports/esp32/machine_sdcard.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/esp32/machine_sdcard.c b/ports/esp32/machine_sdcard.c index bc4aaf30c6..282ce8b78c 100644 --- a/ports/esp32/machine_sdcard.c +++ b/ports/esp32/machine_sdcard.c @@ -298,6 +298,10 @@ STATIC mp_obj_t machine_sdcard_make_new(const mp_obj_type_t *type, size_t n_args // it is a good idea to set the internal pull-ups anyway. // slot_config.flags = SDMMC_SLOT_FLAG_INTERNAL_PULLUP; + SET_CONFIG_PIN(slot_config, clk, ARG_sck); + SET_CONFIG_PIN(slot_config, cmd, ARG_mosi); + SET_CONFIG_PIN(slot_config, d0, ARG_miso); + SET_CONFIG_PIN(slot_config, gpio_cd, ARG_cd); SET_CONFIG_PIN(slot_config, gpio_wp, ARG_wp); From 75cb7218e1971d2ed288c0c59689acda28c8d9b7 Mon Sep 17 00:00:00 2001 From: Josep Comas Date: Tue, 17 Oct 2023 12:41:59 +0200 Subject: [PATCH 2/3] ports/esp32/machine_sdcard.c: CLK, CMD and D0 custom pins in SD/MMC. Signed-off-by: Josep Comas --- ports/esp32/machine_sdcard.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/esp32/machine_sdcard.c b/ports/esp32/machine_sdcard.c index 282ce8b78c..79c91f6cbf 100644 --- a/ports/esp32/machine_sdcard.c +++ b/ports/esp32/machine_sdcard.c @@ -298,9 +298,11 @@ STATIC mp_obj_t machine_sdcard_make_new(const mp_obj_type_t *type, size_t n_args // it is a good idea to set the internal pull-ups anyway. // slot_config.flags = SDMMC_SLOT_FLAG_INTERNAL_PULLUP; + #if CONFIG_IDF_TARGET_ESP32 SET_CONFIG_PIN(slot_config, clk, ARG_sck); SET_CONFIG_PIN(slot_config, cmd, ARG_mosi); SET_CONFIG_PIN(slot_config, d0, ARG_miso); + #endif SET_CONFIG_PIN(slot_config, gpio_cd, ARG_cd); SET_CONFIG_PIN(slot_config, gpio_wp, ARG_wp); From d17135d5d248e8c427c9ba9a197637da4aeaa3cc Mon Sep 17 00:00:00 2001 From: Josep Comas Date: Tue, 17 Oct 2023 13:19:29 +0200 Subject: [PATCH 3/3] ports/esp32/machine_sdcard.c: CLK, CMD and D0 custom pins in SD/MMC. Signed-off-by: Josep Comas --- ports/esp32/machine_sdcard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/esp32/machine_sdcard.c b/ports/esp32/machine_sdcard.c index 79c91f6cbf..8d93d007ca 100644 --- a/ports/esp32/machine_sdcard.c +++ b/ports/esp32/machine_sdcard.c @@ -298,7 +298,7 @@ STATIC mp_obj_t machine_sdcard_make_new(const mp_obj_type_t *type, size_t n_args // it is a good idea to set the internal pull-ups anyway. // slot_config.flags = SDMMC_SLOT_FLAG_INTERNAL_PULLUP; - #if CONFIG_IDF_TARGET_ESP32 + #if CONFIG_IDF_TARGET_ESP32S3 SET_CONFIG_PIN(slot_config, clk, ARG_sck); SET_CONFIG_PIN(slot_config, cmd, ARG_mosi); SET_CONFIG_PIN(slot_config, d0, ARG_miso);