我的程序每次在写扇区函数(SD_WriteBlock())中卡死!
else if (DeviceMode == SD_DMA_MODE)
{
SDIO_ITConfig(SDIO_IT_DCRCFAIL | SDIO_IT_DTIMEOUT | SDIO_IT_DATAEND | SDIO_IT_TXUNDERR | SDIO_IT_STBITERR, ENABLE);
DMA_TxConfiguration(writebuff, BlockSize);
SDIO_DMACmd(ENABLE);
while (DMA_GetFlagStatus(DMA2_FLAG_TC4) == RESET)
{}
// while ((TransferEnd == 0) && (TransferError == SD_OK))
// {}
if (TransferError != SD_OK)
{
return(TransferError);
后来测试发现是一直没进去中断函数;
但是我在stm32f10x_it.c文件中已经加入了
void SDIO_IRQHandler(void)
{
/* Process All SDIO Interrupt Sources */
SD_ProcessIRQSrc();
}
但还是不行,请高手指教
} |