cancel
Showing results for 
Search instead for 
Did you mean: 

Increasing Resolution of OV5640 Camera

Drew M
Associate II

Hi,

I am using the STM32H747I-DISCO board and B-CAMS-OMV daughterboard with integrated OV5640 image sensor to test out using a camera on an MCU. I have been using this example as the base code I am working with but have modified it to communicate image data externally instead of just showing up on the integrated LCD: https://github.com/STMicroelectronics/STM32CubeH7/tree/master/Projects/STM32H747I-DISCO/Examples/DCMI/DCMI_SnapshotMode

I have been successfully capturing images at the example 320x240, 480x272, and 640x480 resolutions. However, when trying to use the example 800x480 resolution, I am not able to capture an image. With the other resolutions I can see I am getting callbacks to BSP_CAMERA_LineEventCallback() and BSP_CAMERA_FrameEventCallback() as data is transferred via DCMI to SDRAM. With the 800x480 resolutions I get no such callbacks, giving the impression that the capture silently hangs.

I've tried to look for any errors that may be generated during configuration of the camera, DCMI, etc., but haven't found anything. I've also tried to see if DMA generates any errors during transfer, but it doesn't look like the driver is flagging any errors. Any thoughts on why an increased resolution may cause image capture to stop working?

 

2 REPLIES 2
KDJEM.1
ST Employee

Hello @Drew M ,

When you increase the resolution to 800x480 the DMA configuration should be adapted to support this resolution.

In your case, it is a medium resolution, for that  it must be configured the DMA with Double-buffer mode.

I recommend you to refer to AN5020 and precisely 6.4 DMA configuration Section.

When your question is answered, please close this topic by choosing "Accept as Solution". This will help other users find that answer faster.

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.

Hi Kaouthar, thanks for your reply.

I believe I am already using DMA double buffer mode, as utilized by HAL_DCMI_Start_DMA() in stm32h7xx_hal_dcmi.c : https://github.com/STMicroelectronics/STM32CubeH7/blob/master/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dcmi.c#L362

I ended up connecting a logic analyzer to the pins on my camera module and found that at lower resolutions the camera is outputting PCLK, HSYNC, and VSYNC signals as expected. However, when I increase the resolution to 800x480 or other higher resolutions, the camera stops outputting the VSYNC signal. I believe this is why the camera appears to hang on the capture, because it is not actually outputting a full frame.My guess is that there is some issue in the register configuration of the OV5640. However, my team has decided that we are no longer interested in pursuing an embedded camera in our device, so I don't have the ability to look into this further.