Uploaded image for project: 'Sitara MPU & SPMCU SDKs'
  1. Sitara MPU & SPMCU SDKs
  2. EXT_SITMPUSW-36

MMCSD_initSD does not check the retry variable for failure for OCR command

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • SITSW-4871
    • 09.02.01
    • 10.01.00
    • Hide
      am62xx-sk
      am62xx-sk-lp
      am62x-sip-sk
      am62a-sk
      am62p-sk
      am62d-evm
      Show
      am62xx-sk am62xx-sk-lp am62x-sip-sk am62a-sk am62p-sk am62d-evm

      The following snippet in the MMCSD_initSD does not check the retry variable at the end for determining the status.

          /* Send OCR - ACMD*/
          if(SystemP_SUCCESS == status)
          {
              uint32_t ocrb31 = 0U;
              uint32_t retry = 0xFFFFU;
      
              while((ocrb31 == 0U) && (retry != 0U))
              {
                  MMCSD_initTransaction(&trans);
                  trans.cmd = MMCSD_SD_CMD(55);
                  status = MMCSD_transfer(handle, &trans);
      
                  if(SystemP_SUCCESS == status)
                  {
                      /* Send ACMD41 */
                      MMCSD_initTransaction(&trans);
                      trans.cmd = MMCSD_SD_ACMD(41);
                      trans.arg = (1 << 30) | (0x01FFU << 15); /* 30th bit - High Cap, 24:15 bits - VDD wild card */
                      status = MMCSD_transfer(handle, &trans);
                  }
      
                  ocrb31 = (trans.response[0] & (1 << 31));
                  retry--;
              }
                      
              if(retry == 0U)
              {
                  status = SystemP_FAILURE;
                  return status;
              }
          } 

      In case the retry is exhausted meaning the while loop ended because of retry = 0, the status still remain SystemP_SUCCESS. Instead, it should assign the status the FAILURE at the end if retry is 0.

            syncuser TI User
            syncuser TI User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: