This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM5746: SD card insert/remove doesn't work

Part Number: AM5746
Other Parts Discussed in Thread: DRA829

Hi,
My customers are using AM5746 custom board. (not EVM)

Environment
CCS Version: 8.1.0.00011
SYS/BIOS 6.76.0.08
am57xx PDK 1.0.11
Customer's board

While testing the SD card, the following problem occurred.

Issue:

The SD card was removed and inserted during reading. SD card doesn't work.

It is the same as the Fixed Issues of PRSDK in the past.
(For example, PRSDK-4448 SD card insert/remove doesn't work in MMCSD)

Cutomers debug information
1. Start MMCSD_v1_read()
2. Vork mmcsd_check_transfer_ready(), CMD13:MMCSD_v1_transfer() ended for CTO.
3. When work CMD18 MMCSD_v1_transfer() , MMCSD_v1_cmdStatusFxn() run into infinite loop.

The latest SDK (6.3), MMCSD_v2, fixes it, but MMCSD_v1 does not.
Comparing TRM Figure 26-36 with MMCSD source code, they think that thereis no CMD reset when CTO occur.

Customers have following questions from this information:
Question 1:
How can they solve this issue? What should we do to "CMD line reset" ?

Question 2:
TRM Figure 26-40 "Perform DATA lines reset". What should we do?

Question 3:
Should we refer to MMCSD_v2 for the above abnormal cases?

Customers executed the following code after CTO, DEB, DCRC, DTO. They think it has improved.


Refer to MMCSD_v1_initSd() in MMCSD_v1.c
if (MMCSD_OK == ret)
{
/* Lines Reset */
HSMMCSDLinesReset(hwAttrs->baseAddr, HS_MMCSD_RESET_LINE_MASK_ALL);

/* Set supported voltage list */
HSMMCSDSetSupportedVoltage(hwAttrs->baseAddr,
(HS_MMCSD_SUPP_VOLT_1P8 | HS_MMCSD_SUPP_VOLT_3P0));

HSMMCSDSystemConfig(hwAttrs->baseAddr, &sysCfg);

/* Set the bus width */
HSMMCSDSetBusWidth(hwAttrs->baseAddr, HS_MMCSD_BUS_WIDTH_1BIT);

/* Set the bus voltage */
if(hwAttrs->supportedBusVoltages & MMCSD_BUS_VOLTAGE_3_0V) {
HSMMCSDSetBusVolt(hwAttrs->baseAddr, HS_MMCSD_BUS_VOLT_3P0); /* Default */
} else if(hwAttrs->supportedBusVoltages & MMCSD_BUS_VOLTAGE_1_8V) {
HSMMCSDSetBusVolt(hwAttrs->baseAddr, HS_MMCSD_BUS_VOLT_1P8);
}
/* Bus power on */
status = ((int32_t)(HSMMCSDBusPowerOnCtrl(hwAttrs->baseAddr, HS_MMCSD_PWR_CTRL_ON)));
object->switched_to_v18=FALSE;
if (CSL_SOK != status)
{
#ifdef LOG_EN
MMCSD_drv_log(Diags_USER1,
"MMCSD:(%p) HS MMC/SD Power on failed", hwAttrs->baseAddr);
#endif
ret = MMCSD_ERR;
}
}

if (MMCSD_OK == ret)
{
/* Set the initialization frequency */
status = HSMMCSDSetBusFreq(hwAttrs->baseAddr, hwAttrs->inputClk,
hwAttrs->outputClk, FALSE);
if(NULL != hwAttrs->iodelayFxn)
{
iodelayParams.transferSpeed = MMCSD_TRANSPEED_25MBPS;
hwAttrs->iodelayFxn(hwAttrs->instNum, &iodelayParams);
}

if (CSL_SOK != status)
{
#ifdef LOG_EN
MMCSD_drv_log(Diags_USER1,
"MMCSD:(%p) HS MMC/SD Bus Frequency set failed", hwAttrs->baseAddr);
#endif
ret = MMCSD_ERR;
}

if (MMCSD_OK == ret)
{
HSMMCSDInitStreamSend(hwAttrs->baseAddr);
}
}

Regards, Rei