我在用DMA1_Stream4做UART4输出通信时,为什么DMA1_Stream4始终使能不了? DMA配置代码如下: void wuHostUartTxDmaInit(void) { FunctionalState DmaEnableStatus; DMA_InitTypeDef DMA_InitStructure; RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_DMA1, ENABLE); DMA_StructInit(&DMA_InitStructure); DMA_InitStructure.DMA_Channel = DMA_Channel_4; DMA_InitStructure.DMA_PeripheralBaseAddr = (int32u)UART4_DATA_ADDRESS; DMA_InitStructure.DMA_Memory0BaseAddr = (int32u)&nvUart4TxBufr; DMA_InitStructure.DMA_DIR = DMA_DIR_MemoryToPeripheral; DMA_InitStructure.DMA_BufferSize = 80; DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable; DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable; DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte; DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_Byte; DMA_InitStructure.DMA_Mode = DMA_Mode_Normal; DMA_InitStructure.DMA_Priority = DMA_Priority_Medium; DMA_InitStructure.DMA_FIFOMode = DMA_FIFOMode_Disable; DMA_InitStructure.DMA_FIFOThreshold = DMA_FIFOThreshold_1QuarterFull; DMA_InitStructure.DMA_MemoryBurst = DMA_MemoryBurst_Single; DMA_InitStructure.DMA_PeripheralBurst = DMA_PeripheralBurst_Single; DMA_Init(DMA1_Stream4, &DMA_InitStructure); USART_DMACmd(UART4, USART_DMAReq_Tx, ENABLE); DMA_Cmd(DMA1_Stream4, ENABLE); DmaEnableStatus = DMA_GetCmdStatus(DMA1_Stream4); while(!DmaEnableStatus) { DMA_Cmd(DMA1_Stream4, ENABLE); DmaEnableStatus = DMA_GetCmdStatus(DMA1_Stream4); } } |
回复:stm32f207 UART4 DMA方式输出
RE:stm32f207 UART4 DMA方式输出
RE:stm32f207 UART4 DMA方式输出
RE:stm32f207 UART4 DMA方式输出
RE:stm32f207 UART4 DMA方式输出
你这个说的是f1系列的,人家要的是f2系列的