cancel
Showing results for 
Search instead for 
Did you mean: 

Cause of Overrun Error (OVR) in DCMI

SLavi
Associate II

So I want to briefly explain my project. I am using STM32F746 MCU for my smart home project. In this project I have to include live stream from a PAL camera. I am using a TW9912 to get 8 bit progressive YCbCr after which I convert to RGB and display it on screen. My display resolution is 800x480 pixels. I am using the crop feature to get 720x480 window to display the video. I am fairly experienced with STM32MCUs and especially DCMI as I have used digital cameras for my system which work fine.

The problem is that when I run the program the DCMI is capturing just one frame or sometimes a fraction of a frame before it disables DMA due to an overrun error. I tried getting the same resolution with a digital camera, progressive YCbCr 8 bit, it works fine without any problem. Same program, same hardware connections to DCMI but one causes an error and the other doesnt. I verified the signals from the decoder chip, and all are normal. Infact an interesting thing I found out is when I choose to capture alternative bytes from the data received, the video plays normally, albeit its divided into 4 lower resolution windows due to the lost bytes. This has had me baffled on what maybe causing the overrun. The AN5020 on DCMI for STM32MCUs does not give clear explanation on what may cause the overru or how to avoid it. And on forums there is just one thread related to DCMI overrun in which the OVR cause was unanswered.

Could Someone please help on the probable cuases of the OVR and guide me on where I may be doing wrong.

Many Thanks

4 REPLIES 4

It is a pretty fast interface, an overrun suggests it is getting overwhelmed with data.

Not sure you have much of a window to update the DMA controller so want to be using circular or double buffering​ methods.

Also consider bandwidth of memory being written to, best to use 32-bit wide memories​. SDRAM that's 16-bit wide apt the be a bit slow, check FIFO/Burst settings.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
SLavi
Associate II

Thanks for the suggestions. I indeed am using circular and double buffer modes. FIFO is enabled with a full threshold, Memburst ia at Increment4 and Peripheral burst at Single. SDRAM used with Bus width 16 and am currebtly using 32 bit wide memories. In short I have done a lot of research and have almost eliminated many of the obvious causes that may apply for my problem. Note: Am using HAL drivers

You probably simply hit the ceiling of what your system allows. Using both DCMI and LTDC onto one bus/FMC may simply be too much. You can try to calculate bandwidth, but it's far far from being simple.

Doesn't the digital camera have lower pixel clock frequency than the PAL decoder?

JW

SLavi
Associate II

Well I guess that is indeed the case unfortunately. As you said the frequency of the digital camera is indeed lower and that seems to be a major difference between the two. Any other suggestions on ST side to maybe trim data apart from the normal line and byte select?