2016-10-30 03:19 PM
Hello everybody,
I've got a NTSC camera with decoder which delivers me 480x272 image data in 4:2:2 YCbCr format. NTSC has the characteristic to transmit every second line. First the odd frame 1, 3, 5, ..., 271 (480x136). Then the even frame 2, 4, 6, ..., 272 (480x136). I receive everything and in single buffer mode it's working fine. I have to work on the frame to extract the luminance channel (later on calculate RGB) and it begins flickering a little bit when I use both frames. With only one it's working fine. So I want use DMA in double buffer mode that I can work on one frame during the other is coming in. That odd and even frames are stored in different buffers. My hardware is the STM32F746 Discovery board. For single buffer mode I use the functionHAL_DCMI_Start_DMA(&hDcmiHandler, DCMI_MODE_CONTINUOUS, CAMERA_BUFFER, 0x7F80);
inside this function it calls the
HAL_DMA_Start_IT(hdcmi->DMA_Handle, (uint32_t)&hdcmi->Instance->DR, (uint32_t)pData, Length);for double buffer mode I changed it to
HAL_DMAEx_MultiBufferStart_IT(hdcmi->DMA_Handle, (uint32_t)&hdcmi->Instance->DR, (uint32_t)pData, (uint32_t)0xC0020000, Length);where I added the second memory address to store the even frames.
Through debugging I saw that I get DMA FIFO Error with the first transfer complete interrupt and a Transfer Error with the following transfer complete interrupt. Then DMA is disabled by the error handler. On my display I can see that I receive one image. Do I have to do anything in the error callback? Does anybody see what I am doing wrong? Or what I can do better. I don't have an idea. Greets Jan #dma #dma #dcmi #double-buffer #circular-mode2016-10-31 10:10 AM
Hello,
Have a look to the working examples under :STM32Cube_FW_F7_V1.5.1\Projects\STM32756G_EVAL\Examples\DCMIYou can get inspired from the available example which can help you on your application.You can refer to this about STM32F7 DCMI.For DCMI with DMA in Double Buffer Mode, you can refer to the DMA section in the STM32F7 reference manual.I hope that this brings some help to you.Regards2016-11-02 05:55 AM
Hello, I red the manuals before. They don't help a lot. Also I tried to set up the DMA for double buffering mode manually. It works until I enable one of the interrupts. For example the transfer complete interrupt. But the interrupt is necessary that the memory buffer addresses (M0AR, M1AR) are swapped or not? Or does it happen anywhere else? Because the image I get looks more or less good.
But with interrupt I still have the FIFO Error and Transfer Error. Does anybody had the same issues? :(