cancel
Showing results for 
Search instead for 
Did you mean: 

OV2640 no bytes in DMA

Grat04
Associate

 

I'm using an STM32H7 microcontroller to interface with an OV2640 camera. I'm utilizing the 8-bit DCMI interface to capture data from the camera and transfer it to a DMA FIFO buffer. My camera configuration includes generating an 8MHz MCO signal for the MCLK input on the OV2640. I'm processing the data with a Digital Signal Processor to obtain RGB565 format at a resolution of 120x160 pixels. Currently, my HSYNC is set to HIGH, VSYNC to LOW, and I'm using a pixel clock with a rising edge. The problem I am having is I get no valid bytes from the DMA FIFO buffer. I get the value of 0x00. Below is my main.c with the functions running the program, the values I write to the register also work. Please help.

Screenshot 2025-04-28 094027.pngScreenshot 2025-04-28 094135.pngScreenshot 2025-04-28 094201.pngScreenshot 2025-04-28 094228.png

1 ACCEPTED SOLUTION

Accepted Solutions
KDJEM.1
ST Employee

Hello @Grat04 and welcome to the community;

 

Could you please refer to the camera sensor datasheet and check the  HSYNC polarity.

I recommend you to look at AN5020 application note section 8.3.7 JPEG data capture to check the camera sensor initialization.  This example is implemented using OV2640 CMOS sensor, supporting the 8-bit format compressed data.

phdcmi->Init.CaptureRate = DCMI_CR_ALL_FRAME;
phdcmi->Init.HSPolarity = DCMI_HSPOLARITY_LOW;
phdcmi->Init.SynchroMode = DCMI_SYNCHRO_HARDWARE;
phdcmi->Init.VSPolarity = DCMI_VSPOLARITY_LOW;
phdcmi->Init.ExtendedDataMode = DCMI_EXTEND_DATA_8B;
phdcmi->Init.PCKPolarity = DCMI_PCKPOLARITY_RISING;

 

I hope this help you.

Thank you.

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

2 REPLIES 2
KDJEM.1
ST Employee

Hello @Grat04 and welcome to the community;

 

Could you please refer to the camera sensor datasheet and check the  HSYNC polarity.

I recommend you to look at AN5020 application note section 8.3.7 JPEG data capture to check the camera sensor initialization.  This example is implemented using OV2640 CMOS sensor, supporting the 8-bit format compressed data.

phdcmi->Init.CaptureRate = DCMI_CR_ALL_FRAME;
phdcmi->Init.HSPolarity = DCMI_HSPOLARITY_LOW;
phdcmi->Init.SynchroMode = DCMI_SYNCHRO_HARDWARE;
phdcmi->Init.VSPolarity = DCMI_VSPOLARITY_LOW;
phdcmi->Init.ExtendedDataMode = DCMI_EXTEND_DATA_8B;
phdcmi->Init.PCKPolarity = DCMI_PCKPOLARITY_RISING;

 

I hope this help you.

Thank you.

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

KDJEM.1
ST Employee

Hello @Grat04 ;

 

Any update about the issue?

If you need any further support, don't hesitate to share an update.

If your issue is solved, please click on Accept as Solution on the reply which solved your issue.

Thank you.

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.