STM32H7 DCMI to SDRAM with DMA - OVERRUN flag
Hi,
I have problem (OVERRUN flag) with data transfer from DCMI to external SDRAM.
I have STM32H753 which in AN5020 has architecture like this:
(Application note, Digital camera interface (DCMI) for STM32 MCUs)

So it has connection between DCMI and FMC via DMA1/2 and D2-D1-bridge.
Great, but ...
when I send frame 320x240@RGB888 from DCMI to SDRAM,
I get in HAL_DCMI_GetError value 0x41 (HAL_DCMI_ERROR_DMA | HAL_DCMI_ERROR_OVR)
and in HAL_DMA_GetError valueo 0x00 (HAL_DMA_ERROR_NONE).
Configuration for DCMI and DMA:
hdcmi.Instance = DCMI;
hdcmi.Init.SynchroMode = DCMI_SYNCHRO_HARDWARE;
hdcmi.Init.PCKPolarity = DCMI_PCKPOLARITY_RISING;
hdcmi.Init.VSPolarity = DCMI_VSPOLARITY_HIGH;
hdcmi.Init.HSPolarity = DCMI_HSPOLARITY_LOW;
hdcmi.Init.CaptureRate = DCMI_CR_ALL_FRAME;
hdcmi.Init.ExtendedDataMode = DCMI_EXTEND_DATA_8B;
hdcmi.Init.JPEGMode = DCMI_JPEG_DISABLE;
hdcmi.Init.ByteSelectMode = DCMI_BSM_ALL;
hdcmi.Init.ByteSelectStart = DCMI_OEBS_ODD;
hdcmi.Init.LineSelectMode = DCMI_LSM_ALL;
hdcmi.Init.LineSelectStart = DCMI_OELS_ODD;
...
hdma_dcmi.Instance = DMA1_Stream0;
hdma_dcmi.Init.Request = DMA_REQUEST_DCMI;
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_NORMAL;
hdma_dcmi.Init.Priority = DMA_PRIORITY_VERY_HIGH;
hdma_dcmi.Init.FIFOMode = DMA_FIFOMODE_ENABLE;
hdma_dcmi.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL;
hdma_dcmi.Init.MemBurst = DMA_MBURST_SINGLE;
hdma_dcmi.Init.PeriphBurst = DMA_PBURST_SINGLE;Some system info:
- SYSCLK = 400Mhz
- AXI/HCLK = 400Mhz
- FMC = 200Mhz (SDRAM @ 100Mhz)
- SDRAM (is42s16800, 12-bit address , 16-bit data)
- STM32Cube FW_H7 V1.6.0
Some tests:
- DMA1 (peripheral to memory) from DCMI to buffer in RAM_D2 (internal), it works and takes 78-83ms for frame 320x240x3
- DMA1 (memory to memory) from buffer in RAM_D2 to buffer in SDRAM, it works and takes 3-8ms for frame 320x240x3, so it is faster than 1)
- DMA1 (peripheral to memory) from DCMI to buffer in SDRAM, it does NOT WORK.
- DMA1 (peripheral to memory) from DCMI to buffer in AXI SRAM, it does NOT WORK
Has anyone had a similar problem?
Is there some other configuration for DCMI with external SDRAM? or DMA? or D2-D1-bridge?
Please, help.
BR
Jakub
