MMCSD error recovery sequence isn't implemented correctly

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: High
    • SITSW-6688
    • 10.01.00
    • Hide
      11.01.01
      11.02.00
      Show
      11.01.01 11.02.00
    • Hide
      am62xx-sk
      am62xx-sk-lp
      am62x-sip-sk
      am62a-sk
      am62p-sk
      am62d-evm
      am62l-evm
      am275x-evm
      Show
      am62xx-sk am62xx-sk-lp am62x-sip-sk am62a-sk am62p-sk am62d-evm am62l-evm am275x-evm

      The current error recovery sequence involves retuning the card and sending the command again in case of CRC error.

      https://github.com/TexasInstruments/mcupsdk-core-k3/blob/k3_main/source/drivers/mmcsd/v0/mmcsd_v0.c#L2211-L2211

      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;
       

       

            Assignee:
            TI User
            Reporter:
            TI User
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Connection: Intermediate to External PROD System
                EXTSYNC-5299 - MMCSD error recovery sequence isn't...
                SYNCHRONIZED
                • Last Sync Date: