2025-10-31 4:55 AM
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!
2025-10-31 5:41 AM
Hello @0xdharanesh and welcome to the community;
I recommend you take a look at these examples:
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.
2025-11-07 11:18 PM
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?
2025-11-09 1:46 PM
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
2025-11-13 3:29 AM - edited 2025-11-19 8:50 PM
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