You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When setting the sdmmc_host_t::max_freq_khz to a value that is higher than allowed, the firmware automatically limits the frequency to 20 MHz as expected. This is reported in the idf.py monitor output.
However, as a side-effect, SD card compatibility is broken for most SD cards. I tried various SDHC cards from various brands and sizes (all SDHC) and only could get 1 card working.
When setting max_freq_khz to 20000 then all devices work fine and all SD cards are detected as normal.
sdmmc_host_thost=SDSPI_HOST_DEFAULT();
host.max_freq_khz=config->spiFrequencyKhz; // uint32_t with the value 800000host.slot=config->spiHost;
What is the actual behavior?
There should not be a side-effect that breaks compatibility, as all the cards work fine when setting 20 MHz manually.
With host.max_freq_khz = 800000; and rare compatible SD card:
E (1336) sdmmc_sd: sdmmc_enable_hs_mode_and_check: send_csd returned 0x108
E (1336) vfs_fat_sdmmc: sdmmc_card_init failed (0x108).
HINT: Please verify if there is an SD card inserted into the SD slot. Then, try rebooting the board.
I (1338) gpio: GPIO[39]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
E (1348) spi_sdcard: Mounting failed (ESP_ERR_INVALID_RESPONSE)
E (1354) spi_sdcard: Mount failed for /sdcard
W (1359) hal: SD card mount failed (init can continue)
The monitor.txt attached is also with host.max_freq_khz = 800000 and with one of the many problematic SD cards.
Answers checklist.
IDF version.
5.3.2 and earlier
Espressif SoC revision.
ESP32, ESP32-S3
Operating System used.
Linux
How did you build your project?
Command line with CMake
If you are using Windows, please specify command line type.
None
Development Kit.
LilyGo T-Deck, M5Stack Core2, CYD 2432S024C, unPhone
Power Supply used.
USB
What is the expected behavior?
When setting the
sdmmc_host_t::max_freq_khz
to a value that is higher than allowed, the firmware automatically limits the frequency to20 MHz
as expected. This is reported in theidf.py monitor
output.However, as a side-effect, SD card compatibility is broken for most SD cards. I tried various SDHC cards from various brands and sizes (all SDHC) and only could get 1 card working.
When setting
max_freq_khz
to20000
then all devices work fine and all SD cards are detected as normal.What is the actual behavior?
There should not be a side-effect that breaks compatibility, as all the cards work fine when setting
20 MHz
manually.Steps to reproduce.
sdmmc_host_t host = SDSPI_HOST_DEFAULT();
host.max_freq_khz = 800000; // 800 MHz!
20 MHz
host.max_freq_khz = 20000; // 20 MHz
Debug Logs.
More Information.
I have not updated to ESP-IDF 5.4 yet, but I expect to do that in the coming month.
The text was updated successfully, but these errors were encountered: