bdk: sdmmc: check that cmd timed out if SDSC

Instead of assuming that, check it.
This fix will make SDUC not to be assumed as SDSC.
This commit is contained in:
CTCaer
2025-01-24 15:40:38 +02:00
parent 018ed3f38a
commit dcd4e4c4ec

View File

@@ -930,10 +930,16 @@ static int _sd_storage_send_if_cond(sdmmc_storage_t *storage, bool *is_sdsc)
sdmmc_init_cmd(&cmdbuf, SD_SEND_IF_COND, vhd_pattern, SDMMC_RSP_TYPE_5, 0); sdmmc_init_cmd(&cmdbuf, SD_SEND_IF_COND, vhd_pattern, SDMMC_RSP_TYPE_5, 0);
if (!sdmmc_execute_cmd(storage->sdmmc, &cmdbuf, NULL, NULL)) if (!sdmmc_execute_cmd(storage->sdmmc, &cmdbuf, NULL, NULL))
{ {
*is_sdsc = 1; // The SD Card is version 1.X // The SD Card is version 1.X (SDSC) if there is no response.
if (storage->sdmmc->error_sts == SDHCI_ERR_INT_CMD_TIMEOUT)
{
*is_sdsc = 1;
return 1; return 1;
} }
return 0;
}
// For Card version >= 2.0, parse results. // For Card version >= 2.0, parse results.
u32 resp = 0; u32 resp = 0;
sdmmc_get_cached_rsp(storage->sdmmc, &resp, SDMMC_RSP_TYPE_5); sdmmc_get_cached_rsp(storage->sdmmc, &resp, SDMMC_RSP_TYPE_5);