AnsweredAssumed Answered

STM32F4 and DCMI: DMA error

Question asked by lucaV on Jan 7, 2016
Latest reply on Feb 7, 2016 by P. Chung
Hi,

I'm using a STM32F429 connected to a TVP5150 through DCMI interface.
DMA is used to transfer data from DCMI to the external DRAM through the FMC.

DMA is configured as follow:
hdma_dcmi.Instance = DMA2_Stream1;
    hdma_dcmi.Init.Channel = DMA_CHANNEL_1;
    hdma_dcmi.Init.Direction = DMA_PERIPH_TO_MEMORY;
    hdma_dcmi.Init.PeriphInc = DMA_PINC_DISABLE;
    hdma_dcmi.Init.MemInc = DMA_MINC_ENABLE;
    hdma_dcmi.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD;
    hdma_dcmi.Init.MemDataAlignment = DMA_MDATAALIGN_WORD;
    hdma_dcmi.Init.Mode = DMA_CIRCULAR;
    hdma_dcmi.Init.Priority = DMA_PRIORITY_VERY_HIGH;
    hdma_dcmi.Init.FIFOMode = DMA_FIFOMODE_DISABLE;
    hdma_dcmi.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL;
    hdma_dcmi.Init.MemBurst = DMA_MBURST_SINGLE;
    hdma_dcmi.Init.PeriphBurst = DMA_PBURST_SINGLE;
    __HAL_LINKDMA(hdcmi,DMA_Handle,hdma_dcmi);

while DCMI:
     hdcmi.Instance = DCMI;
     //hdcmi.Init.SynchroMode = DCMI_SYNCHRO_EMBEDDED;
     hdcmi.Init.SynchroMode = DCMI_SYNCHRO_HARDWARE;
     hdcmi.Init.PCKPolarity = DCMI_PCKPOLARITY_FALLING;
     hdcmi.Init.VSPolarity = DCMI_VSPOLARITY_HIGH;
     hdcmi.Init.HSPolarity = DCMI_HSPOLARITY_HIGH;
     hdcmi.Init.CaptureRate = DCMI_CR_ALL_FRAME;
     hdcmi.Init.ExtendedDataMode = DCMI_EXTEND_DATA_8B;
     HAL_DCMI_Init(&hdcmi);

     HAL_DCMI_ConfigCROP(&hdcmi,160,20,(CAMERA_RESOLUTION_X*2),CAMERA_RESOLUTION_Y);
     HAL_DCMI_EnableCROP(&hdcmi);

When I start the DCMI
     HAL_DCMI_Start_DMA(&hdcmi, DCMI_MODE_CONTINUOUS, LCD_CAMERA_FRAME_BUFFER,  (((CAMERA_RESOLUTION_X)*(CAMERA_RESOLUTION_Y))/2));
a DMA error occurs (error code 2: FIFO ERROR).S1FCR register is 0xA0: FIFO error interrupt enable + FIFO emptyI cannot understand why.Can somebody help me?Thank you.     

Outcomes