-
Type:
Bug
-
Resolution: Fixed
-
Priority:
High
-
SITSW-6688
-
10.01.00
-
-
The current error recovery sequence involves retuning the card and sending the command again in case of CRC error.
The sequence fails to consider the fact that certain commands require sending commands before or after the transfer like the CMD18 would require sending CMD23 before or STOP CMD after the CMD18.
Due to this, the error recovery sequence fails to recover from the error for such commands.
For reproducibility, the following patch can be applied to emulate CRC error
diff --git a/source/drivers/mmcsd/v0/mmcsd_v0.c b/source/drivers/mmcsd/v0/mmcsd_v0.c index 78fc7c8..3dc3503 100644 --- a/source/drivers/mmcsd/v0/mmcsd_v0.c +++ b/source/drivers/mmcsd/v0/mmcsd_v0.c @@ -2214,6 +2214,11 @@ static int32_t MMCSD_errorRecovery(MMCSD_Handle handle, MMCSD_Transaction *trans MMCSD_Object *obj = ((MMCSD_Config *)handle)->object; const MMCSD_Attrs *attrs = ((MMCSD_Config *)handle)->attrs; + if((((trans->cmd) >> 8) == 18) && (trans->retries == 3)) + { + obj->dataCRCError = TRUE; + } + if(obj->dataCRCError || obj->cmdCRCError) { MMCSD_halLinesResetCmd(attrs->ctrlBaseAddr);
then the SBL Stage1 fails with the following logs:
SYSFW Firmware Version 10.1.8--v10.01.08 (Fiery Fox) SYSFW Firmware revision 0xa SYSFW ABI revision 4.0 ERROR: Bootloader_verifyMulticoreImage:680: Failed to authenticate Image SBL stage 1 failed!!
If the following patch is applied to follow proper sequence for CMD18, the issue resolves:
diff --git a/source/drivers/mmcsd/v0/mmcsd_v0.c b/source/drivers/mmcsd/v0/mmcsd_v0.c index 78fc7c8..be555b5 100644 --- a/source/drivers/mmcsd/v0/mmcsd_v0.c +++ b/source/drivers/mmcsd/v0/mmcsd_v0.c @@ -2222,6 +2222,12 @@ static int32_t MMCSD_errorRecovery(MMCSD_Handle handle, MMCSD_Transaction *trans while(status == SystemP_SUCCESS && trans->retries > 0U && (obj->dataCRCError || obj->cmdCRCError)) { status = MMCSD_retune(handle); + + if(trans->cmd == MMCSD_MMC_CMD(18)) + { + MMCSD_sendCmd23(handle, trans->blockCount); + } + if(status == SystemP_SUCCESS) { trans->retries = trans->retries - 1U;