Skip to content

Conversation

@csvke
Copy link

@csvke csvke commented Oct 13, 2025

Add support for OmniVision OV02C10 2MP MIPI CSI camera sensor with the following features:

Hardware Specifications:

  • 2 Megapixel (1920x1080) resolution
  • 10-bit RAW Bayer GBRG output format
  • MIPI CSI interface (1-lane and 2-lane modes)
  • 1/5" optical format
  • 24MHz input clock
  • I2C address: 0x36 (7-bit)

Supported Configurations:

  • 1288x728 @ 30fps (MIPI 1-lane, 24MHz input)
  • 1920x1080 @ 30fps (MIPI 1-lane, 24MHz input)
  • 1920x1080 @ 30fps (MIPI 2-lane, 24MHz input)

Driver Features:

  • Auto-detection via I2C (PID: 0x5602)
  • ISP pipeline controller support
  • Configurable analog and digital gain priority modes
  • Auto-focus (AF) support
  • CSI line sync option
  • Customizable IPA JSON configuration
  • VFLIP and HMIRROR support

Implementation includes:

  • Complete sensor driver (ov02c10.c)
  • Register definitions and initialization settings
  • Default ISP configuration (ov02c10_default.json)
  • Kconfig integration with format selection
  • CMakeLists.txt build rules
  • Auto-detect function for MIPI interface
  • Test configuration updates

Tested on ESP32-P4 with JC4880P443C display module.

Description

Related

Testing


Checklist

Before submitting a Pull Request, please ensure the following:

  • 🚨 This PR does not introduce breaking changes.
  • All CI checks (GH Actions) pass.
  • Documentation is updated as needed.
  • Tests are updated or added as necessary.
  • Code is well-commented, especially in complex areas.
  • Git history is clean — commits are squashed to the minimum necessary.

Add support for OmniVision OV02C10 2MP MIPI CSI camera sensor with the following features:

Hardware Specifications:
- 2 Megapixel (1920x1080) resolution
- 10-bit RAW Bayer GBRG output format
- MIPI CSI interface (1-lane and 2-lane modes)
- 1/5" optical format
- 24MHz input clock
- I2C address: 0x36 (7-bit)

Supported Configurations:
- 1288x728 @ 30fps (MIPI 1-lane, 24MHz input)
- 1920x1080 @ 30fps (MIPI 1-lane, 24MHz input)
- 1920x1080 @ 30fps (MIPI 2-lane, 24MHz input)

Driver Features:
- Auto-detection via I2C (PID: 0x5602)
- ISP pipeline controller support
- Configurable analog and digital gain priority modes
- Auto-focus (AF) support
- CSI line sync option
- Customizable IPA JSON configuration
- VFLIP and HMIRROR support

Implementation includes:
- Complete sensor driver (ov02c10.c)
- Register definitions and initialization settings
- Default ISP configuration (ov02c10_default.json)
- Kconfig integration with format selection
- CMakeLists.txt build rules
- Auto-detect function for MIPI interface
- Test configuration updates

Tested on ESP32-P4 with JC4880P443C display module.

Closes #XXX
@github-actions github-actions bot changed the title feat(esp_cam_sensor): Add OV02C10 MIPI camera sensor driver feat(esp_cam_sensor): Add OV02C10 MIPI camera sensor driver (AEGHB-1263) Oct 13, 2025
@wujiangang wujiangang requested a review from Copilot October 13, 2025 07:39
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive support for the OmniVision OV02C10 2MP MIPI CSI camera sensor, including a complete driver implementation with multiple resolution modes, ISP pipeline integration, and auto-detection functionality.

  • Adds OV02C10 sensor driver with support for 1288x728@30fps and 1920x1080@30fps in both 1-lane and 2-lane MIPI modes
  • Integrates comprehensive configuration system with Kconfig options for format selection, gain mapping, and ISP settings
  • Provides default ISP JSON configuration and auto-detection capability for MIPI interface

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
esp_cam_sensor/sensors/ov02c10/ov02c10.c Main sensor driver implementation with register control and format support
esp_cam_sensor/sensors/ov02c10/private_include/ov02c10_settings.h Register configuration arrays for different resolution modes
esp_cam_sensor/sensors/ov02c10/private_include/ov02c10_regs.h Register address definitions and constants
esp_cam_sensor/sensors/ov02c10/include/ov02c10_types.h Type definitions for register info structure
esp_cam_sensor/sensors/ov02c10/include/ov02c10.h Public header with sensor detection function
esp_cam_sensor/sensors/ov02c10/cfg/ov02c10_default.json Default ISP configuration parameters
esp_cam_sensor/sensors/ov02c10/Kconfig.ov02c10 Configuration options for format selection and gain mapping
esp_cam_sensor/CMakeLists.txt Build system integration for OV02C10 sensor
esp_cam_sensor/project_include.cmake IPA JSON configuration file integration
esp_cam_sensor/test_apps/detect/sdkconfig.ci.all_cameras Test configuration update

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

{0x395d, 0x05},
{0x395e, 0x02},
{0x395f, 0x00},
{0x395f, 0x00},
Copy link

Copilot AI Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate register write detected. The register 0x395f is written twice consecutively with the same value 0x00. This duplication should be removed to avoid confusion and potential timing issues.

Suggested change
{0x395f, 0x00},

Copilot uses AI. Check for mistakes.
{0x395d, 0x05},
{0x395e, 0x02},
{0x395f, 0x00},
{0x395f, 0x00},
Copy link

Copilot AI Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate register write detected. The register 0x395f is written twice consecutively with the same value 0x00. This duplication should be removed to avoid confusion and potential timing issues.

Suggested change
{0x395f, 0x00},

Copilot uses AI. Check for mistakes.
{0X395d, 0X05},
{0X395e, 0X02},
{0X395f, 0X00},
{0X395f, 0X00},
Copy link

Copilot AI Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate register write detected. The register 0x395f is written twice consecutively with the same value 0x00. This duplication should be removed to avoid confusion and potential timing issues.

Suggested change
{0X395f, 0X00},

Copilot uses AI. Check for mistakes.
((int32_t)(((double)v) * 1000000 / (sf)->fps / (sf)->isp_info->isp_v1_info.vts / EXPOSURE_V4L2_UNIT_US + 0.5))

#define OV02C10_PID 0x5602
#define OV02C10_SENSOR_NAME "OV02C10"
Copy link

Copilot AI Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sensor name OV02C10_SENSOR_NAME is defined twice in this file (lines 19 and 68). This duplication should be removed to avoid potential inconsistencies.

Suggested change
#define OV02C10_SENSOR_NAME "OV02C10"

Copilot uses AI. Check for mistakes.
qdesc->type = ESP_CAM_SENSOR_PARAM_TYPE_NUMBER;
qdesc->number.minimum = s_ov02c10_exp_min;
qdesc->number.maximum = dev->cur_format->isp_info->isp_v1_info.vts - OV02C10_EXP_MAX_OFFSET; // max = VTS-6 = height+vblank-6, so when update vblank, exposure_max must be updated
qdesc->number.step = 1;;
Copy link

Copilot AI Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double semicolon detected. This should be a single semicolon to follow proper C syntax.

Suggested change
qdesc->number.step = 1;;
qdesc->number.step = 1;

Copilot uses AI. Check for mistakes.
@csvke csvke force-pushed the feat/add-ov02c10-sensor branch from d333ee3 to dddc26e Compare October 14, 2025 08:24
- Remove duplicate register 0x395f writes in all three format arrays
- Remove duplicate OV02C10_SENSOR_NAME definition (line 68)
- Fix double semicolon in exposure step assignment (line 1260)

These were identified by GitHub Copilot automated code review.
@csvke csvke force-pushed the feat/add-ov02c10-sensor branch from a072f65 to fa8f15e Compare October 14, 2025 08:42
@csvke
Copy link
Author

csvke commented Oct 14, 2025

Commit fa8f15e - Bug fixes from Copilot review

@@ -0,0 +1,27 @@
/*
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the date, and other documents as well.

@WangYuxin-esp
Copy link
Collaborator

@csvke Thank you for your PR. May I know if the current driver can acquire image data on the ESP32-P4?

@csvke
Copy link
Author

csvke commented Oct 15, 2025

@csvke Thank you for your PR. May I know if the current driver can acquire image data on the ESP32-P4?

Yes it can. Details as follows:

1288x728 @ 30fps worked

1920x1080 1-lane not tested

1920x1080 2-lane 8.2fps
With a different set of HTS and VTS values in their registers, I can push it to 11.2fps. I inherited this driver from manufacturer provided sample codes in which there were some small bugs in which I cleaned up with the second commit.

My question is: Can ESP32P4's ISP + MIPI CSI + current ESP-IDF v5.5.1 processes 1920x1080 @ 30fps camera image data? I think theoretically yes but perhaps my test case created some bottleneck somewhere.

My current test case is to use ESP-Brookesia v0.5.0 with LVGL9, create a camera app, and to show a live preview based on after resolutions. I have safely ruled out the speed of PSRAM, and bitrate of the MIPI CSI bus (400Mbit should be sufficient) so the next logical culprit would be a misconfigured driver in which I would first look at the timings, hence the PCLK, VTS and HTS values.

The development board I'm using is GUITION JC4880P443-I-W

@WangYuxin-esp
Copy link
Collaborator

@csvke Hi. 1920x1080 @ 30fps? -> Yes.
In reality, this sensor's small pixel size will result in high image noise, which places high demands on the ISP's noise reduction capabilities.
I recommend contacting a sales representative and mailing the camera sensor to Espressif. This will allow you to quickly evaluate the sensor's image quality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants