根据ST的例程写的,我用的是STM32F103VET6,执行如下操作
Status = SD_Init();
Status = SD_GetCardInfo(&SDCardInfo);
Status = SD_SelectDeselect((u32) (SDCardInfo.RCA << 16));
Status = SD_EnableWideBusOperation(SDIO_BusWide_4b);
Status = SD_SetDeviceMode(SD_POLLING_MODE);
Status = SD_ReadBlock(0x00, Buffer_Block_Rx, BlockSize);
Status = SD_ReadMultiBlocks(0x00, Buffer_MultiBlock_Rx, BlockSize, NumberOfBlocks);
是过了好多张SD卡,一直到SD_SetDeviceMode这里返回的状态都是SD_OK,到这步就停了。 |