mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-03 20:54:32 +02:00
Merge branch 'fix/sdspi_cmd52_error_v5.2' into 'release/v5.2'
fix(sdmmc): fix sdmmc initialization issue caused by CMD52 CRC error (v5.2) See merge request espressif/esp-idf!40285
This commit is contained in:
@@ -66,9 +66,12 @@ esp_err_t sdmmc_io_reset(sdmmc_card_t* card)
|
||||
{
|
||||
uint8_t sdio_reset = CCCR_CTL_RES;
|
||||
esp_err_t err = sdmmc_io_rw_direct(card, 0, SD_IO_CCCR_CTL, SD_ARG_CMD52_WRITE, &sdio_reset);
|
||||
if (err == ESP_ERR_TIMEOUT || (host_is_spi(card) && err == ESP_ERR_NOT_SUPPORTED)) {
|
||||
if (err == ESP_ERR_TIMEOUT || (host_is_spi(card) && err == ESP_ERR_NOT_SUPPORTED) || err == ESP_ERR_INVALID_CRC) {
|
||||
/* Non-IO cards are allowed to time out (in SD mode) or
|
||||
* return "invalid command" error (in SPI mode).
|
||||
* CRC errors are also allowed as the card may be in a state where
|
||||
* CRC is enabled from a previous session, especially after ESP32 restart
|
||||
* without power cycling the SD card.
|
||||
*/
|
||||
} else if (err == ESP_ERR_NOT_FOUND) {
|
||||
ESP_LOGD(TAG, "%s: card not present", __func__);
|
||||
|
Reference in New Issue
Block a user