AnsweredAssumed Answered

DMA Issue for STM32F427 and OV5642

Question asked by Chen.Pohua on Nov 16, 2016
Latest reply on Nov 17, 2016 by Chen.Pohua
Hello!Sir:
I have a project which is the MCU(STM32F427) to drive the camera module(OV5642) and referenced the arduino web site (https://github.com/ArduCAM/Arduino/tree/master/ArduCAM) to setup the register value for the VGA_preview_setting, Video_setting...etc.


My firmware has a error which is the "DCMI_DR_ADDRESS" undefined after compiling.


#define QVGA_resolution 320*240


uint32_t frame_buffer[QVGA_resolution];


void OV5642_Config_DCMI_DMA(ImageFormat_TypeDef ImageFormat)
{
  DCMI_InitTypeDef DCMI_InitStructure;
  DMA_InitTypeDef  DMA_InitStructure;
     
     /*** Configures the DCMI to interface with the OV5642 camera module ***/
  /* Enable DCMI clock */
  RCC_AHB2PeriphClockCmd(RCC_AHB2Periph_DCMI, ENABLE);




  /* DCMI configuration */ 
  DCMI_InitStructure.DCMI_CaptureMode = DCMI_CaptureMode_Continuous;
  DCMI_InitStructure.DCMI_SynchroMode = DCMI_SynchroMode_Hardware;
  DCMI_InitStructure.DCMI_PCKPolarity = DCMI_PCKPolarity_Rising;
  DCMI_InitStructure.DCMI_VSPolarity = DCMI_VSPolarity_Low;
  DCMI_InitStructure.DCMI_HSPolarity = DCMI_HSPolarity_Low;
  DCMI_InitStructure.DCMI_CaptureRate = DCMI_CaptureRate_All_Frame;
  DCMI_InitStructure.DCMI_ExtendedDataMode = DCMI_ExtendedDataMode_10b;//data =8b/10b?
     
     /* Configures the DMA2 to transfer Data from DCMI */
  /* Enable DMA2 clock */
  RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_DMA2, ENABLE);
  
  /* DMA2 Stream1 Configuration */  
  DMA_DeInit(DMA2_Stream1);


  DMA_InitStructure.DMA_Channel = DMA_Channel_1;  
  DMA_InitStructure.DMA_PeripheralBaseAddr = DCMI_DR_ADDRESS;     
  DMA_InitStructure.DMA_Memory0BaseAddr = (uint32_t) frame_buffer;
  DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralToMemory;
  DMA_InitStructure.DMA_BufferSize = 1;
     //DMA_InitStructure.DMA_BufferSize = 320;
  DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;
  DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Disable;
  DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Word;
  DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord;
  DMA_InitStructure.DMA_Mode = DMA_Mode_Circular;
  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;
}


1.How to solve the error message?
2.Does the parallel data is 8 bits or 10bits for OV5642?
3.Who can support the OV5642 sample code for me referenced?
4.DMA_BufferSize=pixel /4 ?
5.DMA_Memory0BaseAddr= frame_buffer array address?

Outcomes