Hi,
I am studing/understanding the SD example supplied by Spectrum Digital, but when I run the example the console shows infinitely the bellow messages.
EXBUSSEL = 100
01 Testing SD card...
I debugged using Step Into and Step Over and observe that the problem starts when the MMCSD_initCard function calls MMCSD_cardIdentification function which a part of code is bellow.
349 /* Send the operating Voltage Range */
350 RESEND_CMD41:
351
352 /* Introduce a delay for slow cards */
353 USBSTK5515_waitusec( 100000 );
354
355 status = MMCSD_appCmd( 0 ); /* Send CMD55 with RCA = 0 */
356
357 if ( status )
358 status = MMC_sendOpCond( MMCSD_VDD_32_34, opTimeout );
359 else
360 {
361 // Experimenting with the whole supported voltage range
362 if ( SD_sendOpCond( 0x00ff8000, opTimeout ) )
363 goto RESEND_CMD41;
364 mmc = 0;
365 }
366 mmc = 0;
In line 355 status is zero, so program go to line 362. In the SD_sendOpCond function (code bellow) during the decrement of opTimeOut the first "if" is not satisfied because MMCSD_sendCmd function does not receive the correct response of SD card. The second "if" is not satisfied too and in the third "if" the MMCSD_appCmd function calls MMCSD_sendCmd but it return is zero, so the SD_sendOpCond function return E_DEVICE and the program goto RESEND_CMD41 according line 363 above, and it happens infinitely.
for ( ; opTimeOut > 0 ; opTimeOut-- )
{
/* Format and send cmd: Volt. window is usually 0x00300000( 3.4-3.2v )*/
if ( status = MMCSD_sendCmd( SD_APP_OP_COND, voltageWindow,1, MMCSD_STAT0_RSPDNE ) )
return status;
if ( MMCSD_MMCRSP7 & 0x8000 )
return 0;
/* Send CMD55 with RCA = 0 for the next iteration */
if ( status = MMCSD_appCmd( 0 ) )
return status;
}
return E_DEVICE;
I am using c5515 eZdsp and CCS4 version 4.1.2.
Please, could anybody help me understand what is happening?
Regards,
Andrea