Hi,
I'm dealing with a spurious issue where a call to MMC_read() periodically hangs.
It has happened at least 2 times now, but that is over the past couple weeks of testing and development, so it's not a very frequently happening event.
It is being used on a TMS320C5515 with csl v3.04.
I was able to locate the area of code where it hangs, lines 3811 - 3820 of csl_mmcsd.c.
Below is the code:
do
{
status = hMmcsd->mmcRegs->MMCST0;
if((status & CSL_MMCSD_DATA_TOUT_CRC_ERROR) != 0)
{
reIssueReadFlag = 1;
break;
}
} while((status & CSL_MMCSD_READ_READY) != CSL_MMCSD_READ_READY);
Execution never leaves the above do/while loop when the issue occurs.
I was fortunate to see it happen while debugging, but the code was compiled with some level of optimization, so I wasn't able to follow it that well with the debugger.
Two questions I have about this are follows:
1. Could compiling csl_mmcsd.c. with any level of optimizations cause issues with the execution of the code?
2. In regards to the if statement on line 3814:
if((status & CSL_MMCSD_DATA_TOUT_CRC_ERROR) != 0)
It is looking for the TOUTRD bit of MMCST0 to be set in order to assert the timeout.
Should it be looking for the TOUTRS to be set in order to assert the command timeout, since the last item it sent the SD Card was a command?
I'll be looking more into this and will post any results as I get them.
Thanks!
Ben