esp-idf/components/sdmmc
Ivan Grokhotkov 516a4ba28d
fix(sdmmc): use correct argument for ACMD41 in SPI mode
ACMD41 argument is different between SD mode and SPI mode.
In SPI mode, the only non-zero bit may be the HCS bit. Unlike the SD
mode, the bits reflecting the host's OCR should be zero.
Previously, we used to set these bits the same way as for the SD mode.
This has caused certain cards to fail initializing, apparently their
controllers have checked the ACMD41 argument more strictly and refused
to finish initialization, resulting in an error such as

    sdmmc_common: sdmmc_init_ocr: send_op_cond (1) returned 0x107

(Note that this error may have other causes than the one fixed in
this commit. For example, if the card doesn't have a sufficient and
stable power supply, it may also fail to complete the internal
initialization process, and will never clear the busy flag in R1
response.)

Closes https://github.com/espressif/esp-idf/issues/6686
Closes https://github.com/espressif/esp-idf/issues/10542
2024-03-01 10:49:43 +01:00
..
include sdmmc: read/write/erase return early on sector count == 0 2023-03-06 15:45:04 +01:00
test refactor: Remove -Wno-format from storage related components 2023-10-22 17:56:41 +00:00
test_apps fix(ci): change build-test-rules files folder 2023-09-20 19:17:06 +08:00
CMakeLists.txt refactor: Remove -Wno-format from storage related components 2023-10-22 17:56:41 +00:00
sdmmc_cmd.c refactor: Remove -Wno-format from storage related components 2023-10-22 17:56:41 +00:00
sdmmc_common.c fix(sdmmc): use correct argument for ACMD41 in SPI mode 2024-03-01 10:49:43 +01:00
sdmmc_common.h feat(sdmmc): supported sd2.0 on esp32p4 2023-10-18 11:57:55 +00:00
sdmmc_init.c Add high speed mode switch validation check for MMC. 2022-04-28 15:23:21 +02:00
sdmmc_io.c refactor: Remove -Wno-format from storage related components 2023-10-22 17:56:41 +00:00
sdmmc_mmc.c refactor: Remove -Wno-format from storage related components 2023-10-22 17:56:41 +00:00
sdmmc_sd.c refactor: Remove -Wno-format from storage related components 2023-10-22 17:56:41 +00:00