cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H753 with the OV5640 Camera

0xdharanesh
Associate II

Hello everyone,

I’m new to STM32 development and I’m trying to set up a simple test using the STM32H753 with an OV5640 camera module.

My goal is to capture frames from the OV5640 and send them over USB to view them on my laptop — just to verify that the camera is working and capturing images correctly.

I’ve gone through various online examples and references, but most of them are either for different STM32 families or for other camera sensors. I’ve written some code based on those examples, but it doesn’t seem to work — I suspect I might be missing something in the clock configuration.

I’m currently using the official OV5640 driver from ST:
:backhand_index_pointing_right: https://github.com/STMicroelectronics/stm32-ov5640/blob/main/ov5640.c

If anyone has experience connecting the OV5640 to an STM32H7 series MCU (especially the H753) or has an example project to share, I’d really appreciate your help or guidance on the correct initialization and clock setup.

Thank you in advance!

4 REPLIES 4
KDJEM.1
ST Employee

Hello @0xdharanesh and welcome to the community;

 

I recommend you take a look at these examples:

  • Examples  in FP-AI-VISION1 package: The FP-AI-VISION1 function pack features a USB webcam application, which can be used to create image and video datasets as well as to perform live testing on the host. The FP-AI-VISION1 runs on the STM32H747I-DISCO Discovery board connected to the B-CAMS-OMV (OV5640) camera module 
  • DCMI_CaptureMode this example explains how to use the DCMI to interface with a camera module (OV5640) and continuously capture images to a Camera Frame Buffer located in external SDRAM. Each camera image is then copied to the LCD display frame buffer using the DMA2D in ARGB8888 format.
  • DCMI_SnapshotMode this example describes how to use the DCMI to interface with a camera module (OV5640), capture a single image in Camera Frame Buffer (320x240 with RGB565 format) and once full frame camera is captured display it on the LCD in ARGB8888 format.

These examples have been tested with STM32H747I-DISCO board and can be easily tailored to any other device.

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.

0xdharanesh
Associate II

Hi Kaouthar,

Thanks for your response.

I’ve gone through the examples you mentioned, but since I’m new to STM32 controllers, I’m still facing a few challenges:

1. Using the examples
When I try to use the DCMI_CaptureMode example, I’d like to check the .ioc file - but it seems there isn’t one included.

2. Also, I’m not sure what exactly to refer to in this repository:

https://github.com/STMicroelectronics/stm32ai-modelzoo-services I initially had trouble connecting via the middleware USB port, but I eventually managed to set it up. However, where can i find the API calls for that 
Using driver

3. Regarding this driver:
https://github.com/STMicroelectronics/stm32-ov5640.git
It’s mentioned as a BSP, but I’m not sure how to use it properly – especially how to handle the input parameters for the functions.

4. Testing camera capture without USB
Before connecting via USB, I’d like to verify that the controller can capture and process a frame from the camera. Could you please guide me on how to test this?

5. Clock configuration issue
The generated code reports a clock configuration issue — how can I fix or configure the clock properly?

I’ve referred to several videos online, but most of them are outdated or don’t match my setup. Could you please suggest where I can find up-to-date and well-explained resources for this?

Have you managed to solve this issue?

I'm currently facing the same problem — the **DCMI interrupt never fires**.
The 24 MHz XCLK output on **PA8 (MCO1)** is confirmed with an oscilloscope, and **I2C communication with the OV5640** works correctly (the device at 0x3C/0x3D acknowledges and initialization completes).

However, neither `HAL_DCMI_FrameEventCallback()` nor other DCMI callbacks are triggered.
All related configurations seem correct:
- DCMI and DMA clocks are enabled
- GPIOs for D0–D7, HSYNC, VSYNC, and PCLK are set to **AF13_DCMI**
- NVIC interrupts are enabled for both DCMI and DMA

Despite this, no frame or line interrupt occurs.
If you’ve found a fix or have any insight into what might be missing (timing, polarity, DMA setup, cache issues, etc.), please share — it would be a big help!

My repository for reference:


 https://github.com/aaljo222/ov5640-stm32h7-capture-tutorial.git

LEEJAEOH_2-1762723253384.png

 

LEEJAEOH_1-1762722249668.png

 

LEEJAEOH_0-1762722224926.png

 

I tried to refer to your code, but I can't open the .ioc file. I think you missed some dot files like .projects, .MXproject, and ... to upload on Git.

Have you fixed it? I have fixed the clock, but I still have to fix the USB

Can we connect on Telegram? t.me/dabeet_lucifer