cancel
Showing results for 
Search instead for 
Did you mean: 

DCMI STM32F40x CAMERA VSYNC ISSUE

kirem
Associate II
Posted on April 15, 2014 at 15:06

Dear All,

I'm initialising the DCMI and DMAing camera data fine. The problem comes when I reset and then re-initialise the DCMI after disabling and then re-enabling the camera. The DCMI doesn't seem to wait for the first falling edge of the VSYNC and reads data in regardless. This results in the image start point being set randomly the screen.

I've used the DCMI_DeInit() function and initialised the DCMI in exactly the same way as it was first initialised.

Any advice on this issue?

Thanks in advance.

Kirem
3 REPLIES 3
michaelmccartyeng
Associate II
Posted on April 17, 2014 at 16:52

This article may be of some help ?

http://blog.frankvh.com/2011/08/19/stm32f2xx-digital-camera-interface-dcmi/

kirem
Associate II
Posted on April 17, 2014 at 20:05

Hi Michael,

I'd read that article but was hoping that there was something that could be done in software within the DCMI itself.

Seems silly that it doesn't quite work. Well, it does once. Maybe ST only tried it once.. who knows.

It appears that the VSYNC Level is used rather than Edge.

Currently the solution seems to be along the following lines:

1. Disable DCMI.

2. Enable the VSYNC line's GPIO configuring it for rising interrupt and then wait.

3. After got rising edge on VSYNC, reconfigure as DCMI_VSYNC, disable GPIO interrupt.

4. Enable DCMI and DMA and so on.

Does this sound like it would work? I will try it.

Thanks, Kirem

michaelmccartyeng
Associate II
Posted on April 19, 2014 at 17:28

Hey Kirem,

  I did read another article on that same page Frank talks about

http://www.frankvh.com/stm32-information.html

There are two blog posts on the STM32 DMA controllers.

http://blog.frankvh.com/2011/08/18/stm32f2xx-dma-controllers/

, and

http://blog.frankvh.com/2011/11/21/stm32f2xx-dma-controllers-part-2/

.  If you're going to be using the DMA controllers for anything beyond an exact copy of some ST example code, I strongly suggest you read these posts. They will help you understand why your DMA transfer works the first time but not the second time, why you're getting an interrupt when you turn off the DMA controller (and what you can do to prevent that), why some DMA registers seem to change values but others don't, and so forth.

So maybe thats the dma int when you turn it off. I have seen that before.

Theres always another way to do it. Why do you have to turn the DCMI off ? I reconfigure my camera but I leave the DCMI on, the i2c updates dont take effect till the next frame. And I'm using jpeg so I can look for the ''end marker'' I know it might be more difficult with raw rgb.