From f2a583a26002dbdfbfd7dc5f42350af326cc3a6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20M=C3=BAdry?= Date: Wed, 10 Jun 2026 11:48:33 +0200 Subject: [PATCH] fix(sdmmc): Handle nonsensical max freq correctly Closes https://github.com/espressif/esp-idf/issues/15250 --- components/sdmmc/sdmmc_sd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/sdmmc/sdmmc_sd.c b/components/sdmmc/sdmmc_sd.c index 50062d6d1d0..a66b535bb74 100644 --- a/components/sdmmc/sdmmc_sd.c +++ b/components/sdmmc/sdmmc_sd.c @@ -282,7 +282,7 @@ esp_err_t sdmmc_enter_higher_speed_mode(sdmmc_card_t* card) ESP_LOGE(TAG, "%s: failed to switch bus to DDR mode (0x%x)", __func__, err); return err; } - } else if (card->host.max_freq_khz == SDMMC_FREQ_SDR104) { + } else if (card->host.max_freq_khz >= SDMMC_FREQ_SDR104) { //UHS-I SDR104 ESP_LOGV(TAG, "%s: to switch to SDR104", __func__); if ((supported_mask & BIT(SD_ACCESS_MODE_SDR104)) == 0) { @@ -294,7 +294,7 @@ esp_err_t sdmmc_enter_higher_speed_mode(sdmmc_card_t* card) ESP_LOGD(TAG, "%s: sdmmc_send_cmd_switch_func (2) returned 0x%x", __func__, err); goto out; } - } else if (card->host.max_freq_khz == SDMMC_FREQ_SDR50) { + } else if (card->host.max_freq_khz >= SDMMC_FREQ_SDR50) { //UHS-I SDR50 ESP_LOGV(TAG, "%s: to switch to SDR50", __func__); if ((supported_mask & BIT(SD_ACCESS_MODE_SDR50)) == 0) {