AnsweredAssumed Answered

Could anyone explain me how to set DMA param for DCMI camera capture in STM32f4

Question asked by moodaeng on Jul 25, 2012
Latest reply on Jul 25, 2012 by moodaeng
Hi, 
        I am cery confuse about how to set DMA parameters. I would like to capture images from camera using DCMI module. I don't understand Burst and BufferSize params of DMA.  I would like to capture QCIF (176x144) YUV 4:2:2 from a camera to an array buffer.  Here is the parameters that I use but it doesn't work..

     DMA_InitStructure.DMA_Channel = DMA_Channel_1;
     DMA_InitStructure.DMA_PeripheralBaseAddr =  (uint32_t)DCMI_DR_ADDRESS;
     DMA_InitStructure.DMA_Memory0BaseAddr =  (uint32_t)frame_buffer;
     DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralToMemory;
     DMA_InitStructure.DMA_BufferSize = (176*144)/4;
     DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable; //single register
     DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable; //frame_buffer++;
     DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Word;
     DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_Byte;
     DMA_InitStructure.DMA_Mode = DMA_Mode_Normal;
     DMA_InitStructure.DMA_Priority = DMA_Priority_High;
     DMA_InitStructure.DMA_FIFOMode = DMA_FIFOMode_Enable;
     DMA_InitStructure.DMA_FIFOThreshold = DMA_FIFOThreshold_Full;
     DMA_InitStructure.DMA_MemoryBurst = DMA_MemoryBurst_Single;
     DMA_InitStructure.DMA_PeripheralBurst = DMA_PeripheralBurst_Single;


     /* DMA2 IRQ channel Configuration */
     DMA_Init(DMA2_Stream1, &DMA_InitStructure);

 Thanks

Outcomes