forked from espressif/esp-idf
Merge branch 'fix/slot0_requires_all_pins_in_1bit_mode_issue_v5.3' into 'release/v5.3'
sd: fixed all pins need to be set when using slot0 on esp32p4 issue (v5.3) See merge request espressif/esp-idf!39307
This commit is contained in:
@@ -608,14 +608,21 @@ esp_err_t sdmmc_host_init_slot(int slot, const sdmmc_slot_config_t *slot_config)
|
|||||||
|
|
||||||
if (slot == 0) {
|
if (slot == 0) {
|
||||||
#if !SDMMC_LL_SLOT_SUPPORT_GPIO_MATRIX(0)
|
#if !SDMMC_LL_SLOT_SUPPORT_GPIO_MATRIX(0)
|
||||||
if (use_gpio_matrix &&
|
if (use_gpio_matrix) {
|
||||||
SDMMC_SLOT0_IOMUX_PIN_NUM_CLK == slot_config->clk &&
|
if (slot_width >= 1) {
|
||||||
SDMMC_SLOT0_IOMUX_PIN_NUM_CMD == slot_config->cmd &&
|
if (SDMMC_SLOT0_IOMUX_PIN_NUM_CLK == slot_config->clk && SDMMC_SLOT0_IOMUX_PIN_NUM_CMD == slot_config->cmd && SDMMC_SLOT0_IOMUX_PIN_NUM_D0 == slot_config->d0) {
|
||||||
SDMMC_SLOT0_IOMUX_PIN_NUM_D0 == slot_config->d0 &&
|
use_gpio_matrix = false;
|
||||||
SDMMC_SLOT0_IOMUX_PIN_NUM_D1 == slot_config->d1 &&
|
} else {
|
||||||
SDMMC_SLOT0_IOMUX_PIN_NUM_D2 == slot_config->d2 &&
|
use_gpio_matrix = true;
|
||||||
SDMMC_SLOT0_IOMUX_PIN_NUM_D3 == slot_config->d3) {
|
}
|
||||||
use_gpio_matrix = false;
|
}
|
||||||
|
if (slot_width >= 4) {
|
||||||
|
if (SDMMC_SLOT0_IOMUX_PIN_NUM_D1 == slot_config->d1 && SDMMC_SLOT0_IOMUX_PIN_NUM_D2 == slot_config->d2 && SDMMC_SLOT0_IOMUX_PIN_NUM_D3 == slot_config->d3) {
|
||||||
|
use_gpio_matrix = false;
|
||||||
|
} else {
|
||||||
|
use_gpio_matrix = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
ESP_RETURN_ON_FALSE(!use_gpio_matrix, ESP_ERR_INVALID_ARG, TAG, "doesn't support routing from GPIO matrix, driver uses dedicated IOs");
|
ESP_RETURN_ON_FALSE(!use_gpio_matrix, ESP_ERR_INVALID_ARG, TAG, "doesn't support routing from GPIO matrix, driver uses dedicated IOs");
|
||||||
}
|
}
|
||||||
|
@@ -28,84 +28,58 @@ menu "SD/MMC Example Configuration"
|
|||||||
bool "1 line (D0)"
|
bool "1 line (D0)"
|
||||||
endchoice
|
endchoice
|
||||||
|
|
||||||
if SOC_SDMMC_USE_GPIO_MATRIX
|
config EXAMPLE_PIN_CMD
|
||||||
|
int
|
||||||
|
prompt "CMD GPIO number" if SOC_SDMMC_USE_GPIO_MATRIX
|
||||||
|
default 35 if IDF_TARGET_ESP32S3
|
||||||
|
default 44 if IDF_TARGET_ESP32P4
|
||||||
|
default 15 if IDF_TARGET_ESP32
|
||||||
|
|
||||||
config EXAMPLE_PIN_CMD
|
config EXAMPLE_PIN_CLK
|
||||||
int "CMD GPIO number"
|
int
|
||||||
default 35 if IDF_TARGET_ESP32S3
|
prompt "CLK GPIO number" if SOC_SDMMC_USE_GPIO_MATRIX
|
||||||
default 44 if IDF_TARGET_ESP32P4
|
default 36 if IDF_TARGET_ESP32S3
|
||||||
|
default 43 if IDF_TARGET_ESP32P4
|
||||||
|
default 14 if IDF_TARGET_ESP32
|
||||||
|
|
||||||
config EXAMPLE_PIN_CLK
|
config EXAMPLE_PIN_D0
|
||||||
int "CLK GPIO number"
|
int
|
||||||
default 36 if IDF_TARGET_ESP32S3
|
prompt "D0 GPIO number" if SOC_SDMMC_USE_GPIO_MATRIX
|
||||||
default 43 if IDF_TARGET_ESP32P4
|
default 37 if IDF_TARGET_ESP32S3
|
||||||
|
default 39 if IDF_TARGET_ESP32P4
|
||||||
|
default 2 if IDF_TARGET_ESP32
|
||||||
|
|
||||||
config EXAMPLE_PIN_D0
|
if EXAMPLE_SDMMC_BUS_WIDTH_4
|
||||||
int "D0 GPIO number"
|
|
||||||
default 37 if IDF_TARGET_ESP32S3
|
|
||||||
default 39 if IDF_TARGET_ESP32P4
|
|
||||||
|
|
||||||
if EXAMPLE_SDMMC_BUS_WIDTH_4
|
config EXAMPLE_PIN_D1
|
||||||
|
int
|
||||||
|
prompt "D1 GPIO number" if SOC_SDMMC_USE_GPIO_MATRIX
|
||||||
|
default 38 if IDF_TARGET_ESP32S3
|
||||||
|
default 40 if IDF_TARGET_ESP32P4
|
||||||
|
default 4 if IDF_TARGET_ESP32
|
||||||
|
|
||||||
config EXAMPLE_PIN_D1
|
|
||||||
int "D1 GPIO number"
|
|
||||||
default 38 if IDF_TARGET_ESP32S3
|
|
||||||
default 40 if IDF_TARGET_ESP32P4
|
|
||||||
|
|
||||||
config EXAMPLE_PIN_D2
|
config EXAMPLE_PIN_D2
|
||||||
int "D2 GPIO number"
|
int
|
||||||
default 33 if IDF_TARGET_ESP32S3
|
prompt "D2 GPIO number" if SOC_SDMMC_USE_GPIO_MATRIX
|
||||||
default 41 if IDF_TARGET_ESP32P4
|
default 33 if IDF_TARGET_ESP32S3
|
||||||
|
default 41 if IDF_TARGET_ESP32P4
|
||||||
|
default 12 if IDF_TARGET_ESP32
|
||||||
|
|
||||||
config EXAMPLE_PIN_D3
|
|
||||||
int "D3 GPIO number"
|
|
||||||
default 34 if IDF_TARGET_ESP32S3
|
|
||||||
default 42 if IDF_TARGET_ESP32P4
|
|
||||||
|
|
||||||
endif # EXAMPLE_SDMMC_BUS_WIDTH_4
|
config EXAMPLE_PIN_D3
|
||||||
|
int
|
||||||
|
prompt "D3 GPIO number" if SOC_SDMMC_USE_GPIO_MATRIX
|
||||||
|
default 34 if IDF_TARGET_ESP32S3
|
||||||
|
default 42 if IDF_TARGET_ESP32P4
|
||||||
|
default 13 if IDF_TARGET_ESP32
|
||||||
|
|
||||||
endif # SOC_SDMMC_USE_GPIO_MATRIX
|
endif # EXAMPLE_SDMMC_BUS_WIDTH_4
|
||||||
|
|
||||||
config EXAMPLE_DEBUG_PIN_CONNECTIONS
|
config EXAMPLE_DEBUG_PIN_CONNECTIONS
|
||||||
bool "Debug sd pin connections and pullup strength"
|
bool "Debug sd pin connections and pullup strength"
|
||||||
default n
|
default n
|
||||||
|
|
||||||
if !SOC_SDMMC_USE_GPIO_MATRIX
|
|
||||||
config EXAMPLE_PIN_CMD
|
|
||||||
int
|
|
||||||
depends on EXAMPLE_DEBUG_PIN_CONNECTIONS
|
|
||||||
default 15 if IDF_TARGET_ESP32
|
|
||||||
|
|
||||||
config EXAMPLE_PIN_CLK
|
|
||||||
int
|
|
||||||
depends on EXAMPLE_DEBUG_PIN_CONNECTIONS
|
|
||||||
default 14 if IDF_TARGET_ESP32
|
|
||||||
|
|
||||||
config EXAMPLE_PIN_D0
|
|
||||||
int
|
|
||||||
depends on EXAMPLE_DEBUG_PIN_CONNECTIONS
|
|
||||||
default 2 if IDF_TARGET_ESP32
|
|
||||||
|
|
||||||
if EXAMPLE_SDMMC_BUS_WIDTH_4
|
|
||||||
|
|
||||||
config EXAMPLE_PIN_D1
|
|
||||||
int
|
|
||||||
depends on EXAMPLE_DEBUG_PIN_CONNECTIONS
|
|
||||||
default 4 if IDF_TARGET_ESP32
|
|
||||||
|
|
||||||
config EXAMPLE_PIN_D2
|
|
||||||
int
|
|
||||||
depends on EXAMPLE_DEBUG_PIN_CONNECTIONS
|
|
||||||
default 12 if IDF_TARGET_ESP32
|
|
||||||
|
|
||||||
config EXAMPLE_PIN_D3
|
|
||||||
int
|
|
||||||
depends on EXAMPLE_DEBUG_PIN_CONNECTIONS
|
|
||||||
default 13 if IDF_TARGET_ESP32
|
|
||||||
|
|
||||||
endif # EXAMPLE_SDMMC_BUS_WIDTH_4
|
|
||||||
endif
|
|
||||||
|
|
||||||
config EXAMPLE_ENABLE_ADC_FEATURE
|
config EXAMPLE_ENABLE_ADC_FEATURE
|
||||||
bool "Enable ADC feature"
|
bool "Enable ADC feature"
|
||||||
depends on EXAMPLE_DEBUG_PIN_CONNECTIONS
|
depends on EXAMPLE_DEBUG_PIN_CONNECTIONS
|
||||||
|
Reference in New Issue
Block a user