Question
configuration of DMA for DCMI
Posted on June 22, 2012 at 13:14
Hello,
I am trying to transfer image data from the DCMI data register via DMA to RAM memory. For this purpose I configure DMA2 as follows:
RCC_AHB2PeriphClockCmd(RCC_AHB1Periph_DMA2, ENABLE);
DMA_InitTypeDef DMA_InitStruct;
DMA_DeInit(DMA2_Stream1); DMA_StructInit(&DMA_InitStruct); DMA_InitStruct.DMA_Channel = DMA_Channel_1; DMA_InitStruct.DMA_PeripheralBaseAddr = (uint32_t)(DCMI_BASE + 0x28); DMA_InitStruct.DMA_Memory0BaseAddr = (uint32_t)(&(Raw_Image_Data.Data[0])); DMA_InitStruct.DMA_DIR = DMA_DIR_PeripheralToMemory; DMA_InitStruct.DMA_BufferSize = 0xFFFF; DMA_InitStruct.DMA_PeripheralInc = DMA_PeripheralInc_Disable; DMA_InitStruct.DMA_MemoryInc = DMA_MemoryInc_Enable; DMA_InitStruct.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Word; // word = 32 bit DMA_InitStruct.DMA_MemoryDataSize = DMA_MemoryDataSize_Word; // word = 32 bit DMA_InitStruct.DMA_Mode = DMA_Mode_Normal; // not circular DMA_InitStruct.DMA_Priority = DMA_Priority_Medium; DMA_InitStruct.DMA_FIFOMode = DMA_FIFOMode_Disable; // direct mode DMA_InitStruct.DMA_FIFOThreshold = DMA_FIFOThreshold_Full; DMA_InitStruct.DMA_MemoryBurst = DMA_MemoryBurst_INC4; DMA_InitStruct.DMA_PeripheralBurst = DMA_PeripheralBurst_INC4; DMA_Init(DMA2_Stream1, &DMA_InitStruct); DMA_Cmd(DMA2_Stream1, ENABLE);When I execute that code, the values in the register DMA2_S1CR do not change. Why?
Do I have to tell the DCMI somehow that it should connect with the DMA, e.g. using a similar command to SPI_I2S_DMACmd() ?Please can anybody tell me what I am missing here?
#dma #dcmi