From 735ad1e7cf6eb5cb8bac5d7b3a1010232a0ba6d4 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 59a0a1aea7e..bf46a5f4a47 100644 --- a/components/sdmmc/sdmmc_sd.c +++ b/components/sdmmc/sdmmc_sd.c @@ -275,7 +275,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) { @@ -287,7 +287,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) {