AnsweredAssumed Answered

STM32F4Discovery - DMA not work.

Question asked by mal.alex on Jul 31, 2013
Latest reply on Jul 31, 2013 by mal.alex
I did try send 100 words 16bits from memory to memory by DMA, and it not work.

uint16_t bufor_od[100];
 uint16_t bufor_do[100];

 RCC->AHB1ENR |= RCC_AHB1ENR_DMA1EN;

 DMA_InitTypeDef DMA_InitStructure;

 DMA_DeInit(DMA1_Stream0);

 DMA_InitStructure.DMA_Channel = DMA_Channel_0;
 DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)bufor_od;
 DMA_InitStructure.DMA_Memory0BaseAddr = (uint32_t)bufor_do;
 DMA_InitStructure.DMA_DIR = DMA_DIR_MemoryToMemory;
 DMA_InitStructure.DMA_BufferSize = (uint32_t)sizeof(bufor_od)/2;
 DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Enable;
 DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;
 DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord;
 DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord;
 DMA_InitStructure.DMA_Mode = DMA_Mode_Normal;
 DMA_InitStructure.DMA_Priority = DMA_Priority_High;
 DMA_InitStructure.DMA_FIFOMode = DMA_FIFOMode_Disable;
 DMA_InitStructure.DMA_FIFOThreshold = DMA_FIFOThreshold_Full;
 DMA_InitStructure.DMA_MemoryBurst = DMA_MemoryBurst_Single;
 DMA_InitStructure.DMA_PeripheralBurst = DMA_PeripheralBurst_Single;
 DMA_Init(DMA1_Stream0, &DMA_InitStructure);

 DMA1_Stream0->CR |= (uint32_t)DMA_SxCR_EN;


Outcomes