cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F429I-Discovery DCMI DMA OV7670

vincent_au_93
Associate
Posted on November 17, 2014 at 06:01

Hi,

I want to implement DCMI on the STM32F429I Discovery using OV7670. I am using external clock of 20MHz for OV7670 clock source. I can get the frame interrupt, but cannot get the dma interrupt working. Also, no data is written to the buffer. My code is posted below. So my question is can i actually implement DCMI with STM32F429 and use lcd at the same time? I am using lcd driver without ltdc, so the dcmi pin is still not used. And, how can I write data received to DCMI to the data buffer? Any help will be greatly appreciated

Thanks

Vincent

code 

https://www.dropbox.com/s/rcdn0erle0epxna/CameraTest.zip?dl=0

#stm32f429 #dcmi #lcd #dma
21 REPLIES 21
Chuev.Vladimir
Associate III
Posted on August 28, 2015 at 10:32

Hi

I have the same issue.

You

deal with it

?

stm322399
Senior
Posted on August 28, 2015 at 11:22

Vladimir,

using DCMI on F429 might require some trade-off: resolution versus frame rate versus image processing. Example: 1.3MP at 30fps to be stored in a file is very difficult to achieve due to the combination of small internal SRAM (cannot fit 1.3MP RGB image), latency or bandwidth limitation of external memory, small DCMI output FIFO (only 16 words!!), low number of DMA masters on the bus, etc ...

Tell us a bit more about your project, with some luck there could be a chance to find a successful combination that works.

Chuev.Vladimir
Associate III
Posted on August 28, 2015 at 11:36

I have QVGA RGB565

And allocate memory space:

uint8_t OV7670_buffer[320 * 240 * 2];

When I try to pick up the data, but the buffer is empty:

HAL_DCMI_Start_DMA(&OV7670_hdcmi_eval, DCMI_MODE_SNAPSHOT, (uint32_t)&OV7670_buffer, (uint32_t)((IMG_ROWS * IMG_COLUMNS * 2) / 4))

HAL_Delay(300);

LCD_DisplayImage((uint16_t*)OV7670_buffer);

Init code:

Sorry for my English
stm322399
Senior
Posted on August 28, 2015 at 11:52

Did you verify that the OV7670 outputs any data ?

Does HAL allows you to catch DMA errors ? If yes, are there any of them ?

Chuev.Vladimir
Associate III
Posted on August 28, 2015 at 12:00

Interrupting DMA2_Stream1_IRQHandler works often

DMA2_Stream1_IRKHandler interrupt is triggered only once, after calling HAL_DCMI_Start_DMA()

If you disconnect the camera from the data bus, the interrupt will stop working
stm322399
Senior
Posted on August 28, 2015 at 13:58

Very good.

Now, what's make you think there is no image data ?

Are you sure that your LCD is working properly ? Did you test with a crafted image of your own ?

Chuev.Vladimir
Associate III
Posted on August 28, 2015 at 14:38

Yes,

I use the

display for

logs

I write

for the test

in the first cell

array

data

:

OV7670_buffer [

0] = 0xFFFF;

This

pixel is

visible on

the display.

In all other

cells of

the zeros

stm322399
Senior
Posted on August 28, 2015 at 15:05

Good point.

Now, does the manually written 0xFFFF survives another HAL_DCMI_Start_DMA ?

Next step is to make sure that data arrives at the DCMI port. First check GPIO config (PushPull config look always suspicious to me about inputs!), then make sure that your OV7870 sends another data than blank image !

Do you use a custom HW or a well known (verified) platform ?

Chuev.Vladimir
Associate III
Posted on August 28, 2015 at 15:47

Yes, 0xFFFF survives.

I just checked the oscilloscope - the data coming from the camera.

I use STM32F429I - Discovery.

I changed the configuration of ports on GPIO_PULLDOWN, but nothing has changed