2012-02-19 05:31 PM
A bit stumped on what to try next. I'm working with an SD card (2GB). I'm using the SDIO interface. The initialization sequence is failing during the change to widebus operation. Specifically it's failing inFindSCR() at:
/*!< Send ACMD51 SD_APP_SEND_SCR with argument as 0 */
SDIO_CmdInitStructure.SDIO_Argument = 0x0;
SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_SD_APP_SEND_SCR;
SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short;
SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;
SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;
SDIO_SendCommand(&SDIO_CmdInitStructure);
errorstatus = CmdResp1Error(SD_CMD_SD_APP_SEND_SCR);
if
(errorstatus != SD_OK)
{
return
(errorstatus);
}
while
(!(SDIO->STA & (SDIO_FLAG_RXOVERR | SDIO_FLAG_DCRCFAIL | SDIO_FLAG_DTIMEOUT | SDIO_FLAG_DBCKEND | SDIO_FLAG_STBITERR)))
{
if
(SDIO_GetFlagStatus(SDIO_FLAG_RXDAVL) != RESET)
{
*(tempscr + index) = SDIO_ReadData();
index++;
}
}
The call to SDIO_GetFlagStatus(
SDIO_FLAG_RXDAVL) comes back as SET and the while loop repeats forever.
Any ideas on what to try? Shannon