大家帮忙看看我的DMA配置有没有问题,使能后TCIF位始终不置位 static void DMA_RxConfiguration(u32 *BufferDST, u32 BufferSize) { DMA_InitTypeDef DMA_InitStructure; DMA_ClearFlag(DMA2_Stream6,DMA_FLAG_TCIF6 ); DMA_ClearFlag(DMA2_Stream6,DMA_FLAG_TEIF6 ); DMA_ClearFlag(DMA2_Stream6,DMA_FLAG_HTIF6 ); RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_DMA2, ENABLE); DMA_Cmd(DMA2_Stream6, DISABLE); DMA_InitStructure.DMA_Channel = DMA_Channel_4; DMA_InitStructure.DMA_PeripheralBaseAddr = (u32)SDIO_FIFO_Address; DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Word; DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_Word; DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable; DMA_InitStructure.DMA_BufferSize = BufferSize / 4; DMA_InitStructure.DMA_Mode = DMA_Mode_Normal; DMA_InitStructure.DMA_Priority = DMA_Priority_High; DMA_InitStructure.DMA_MemoryBurst = DMA_MemoryBurst_Single; DMA_InitStructure.DMA_Memory0BaseAddr = (u32)BufferDST; DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable; /* Initialize the DMA_FIFOMode member */ DMA_InitStructure.DMA_FIFOMode = DMA_FIFOMode_Enable; /* Initialize the DMA_FIFOThreshold member */ DMA_InitStructure.DMA_FIFOThreshold = DMA_FIFOThreshold_1QuarterFull; DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralToMemory; DMA_InitStructure.DMA_BufferSize = BufferSize / 4; DMA_DeInit(DMA2_Stream6); DMA_Init(DMA2_Stream6, &DMA_InitStructure); DMA_Cmd(DMA2_Stream6, ENABLE); } |
RE:207 DMA
这个开启了吗?
回复:207 DMA
CC_AHBPeriphClockCmd(RCC_AHBPeriph_DMA2, ENABLE);
这个开启了吗?
开了