使用官方sd卡例程。SD_WriteDisk(buf,i,1) 函数里面的sta = SD_WriteBlock( buf, lsector, 512 );
SDIO_CmdInitStructure.SDIO_Argument = blksize;
SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_SET_BLOCKLEN;
SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short;
//SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Long;
SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;
//SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_Pend;
SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;
SDIO_SendCommand( &SDIO_CmdInitStructure );
//Delay_Us(1);
errorstatus = CmdResp1Error( SD_CMD_SET_BLOCKLEN );
设置块大小,命令返回是SD_CMD_RSP_TIMEOUT错误?不明原因
if( errorstatus != SD_OK )
{
return errorstatus;
}