mimxrt/sdcard: Fix an error when writing large blocks.

Which happened when a read followed a large write.
This commit is contained in:
robert-hh 2022-11-29 13:05:44 +01:00 committed by Damien George
parent 913f9ad5ad
commit aea4174937
1 changed files with 2 additions and 1 deletions

View File

@ -360,7 +360,8 @@ static status_t sdcard_transfer_blocking(USDHC_Type *base, usdhc_handle_t *handl
status = kStatus_Timeout;
for (int i = 0; i < timeout_ms * 100; i++) {
// Wait until Data0 is low any more. Low indicates "Busy".
if ((transfer->data->txData == NULL) || (USDHC_GetPresentStatusFlags(base) & (uint32_t)kUSDHC_Data0LineLevelFlag) != 0) {
if (((transfer->data->txData == NULL) && (transfer->data->rxData == NULL)) ||
(USDHC_GetPresentStatusFlags(base) & (uint32_t)kUSDHC_Data0LineLevelFlag) != 0) {
// Not busy anymore or no TX-Data
status = USDHC_TransferBlocking(base, &dma_config, transfer);
if (status != kStatus_Success) {