本帖最后由 inurl 于 2013-2-18 19:13 编辑
时间跑久了出这个问题
错误代码是errorstatus = SD_CMD_RSP_TIMEOUT = (3), /* Command response timeout */
错误位置是:
/* Set the block size, both on controller and card */
if ((BlockSize > 0) && (BlockSize <= 2048) && ((BlockSize & (BlockSize - 1)) == 0))
{
power = convert_from_bytes_to_power_of_two(BlockSize);
SDIO_CmdInitStructure.SDIO_Argument = (uint32_t) BlockSize;
SDIO_CmdInitStructure.SDIO_CmdIndex = SDIO_SET_BLOCKLEN;
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(SDIO_SET_BLOCKLEN); // 这里返回SD_CMD_RSP_TIMEOUT
if (errorstatus != SD_OK)
{
return(errorstatus);
}
} |