Skip to content

boards: frdm_mcxn947: turn OV7670 into a shield #89131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

josuah
Copy link
Contributor

@josuah josuah commented Apr 26, 2025

Dependencies:

The FRDM-MCXN board is featuring an Arducam connector originally designed for the Arduino GIGA R1, and spread broadly since then for inexpensive OmniVision and low-power Himax image sensor modules.

Other modules than the Olimex OV7670 can be used.

PXL_20250426_115548902
PXL_20250426_115605997
PXL_20250426_115649291

This also proposes an arducam,dvp-20pin-connector GPIO nexus:
https://github.com/zephyrproject-rtos/zephyr/pull/89131/files#diff-a39283efe7f5b76e206c8d2b9b65c4b45d130ceb1aa6bb8a0083486793172537

@josuah
Copy link
Contributor Author

josuah commented Apr 26, 2025

Tested with UVC (by cherry-picking commits):

Before:

mpv-shot0001-before

After:

mpv-shot0001

It does not really look like correct data, but it is showing the same thing before and after, which shows the current PR does not break the sensor operation. :)

[EDIT: no problem with other hardware on UVC (i.e. Arducam Nicla or virtual source), I'll try with other sensors to debug this, which this PR helps doing]

@josuah josuah added the In progress For PRs: is work in progress and should not be merged yet. For issues: Is being worked on label Apr 26, 2025
@josuah josuah force-pushed the pr-frdm-mcxn947-shield branch from a0d81be to e03e9da Compare April 26, 2025 12:29
@josuah josuah force-pushed the pr-frdm-mcxn947-shield branch from e03e9da to 283745b Compare April 26, 2025 13:24
@josuah josuah force-pushed the pr-frdm-mcxn947-shield branch from cb237fc to b1d86c1 Compare April 29, 2025 13:33
@josuah josuah force-pushed the pr-frdm-mcxn947-shield branch from b1d86c1 to 29d6608 Compare April 29, 2025 17:26
@josuah josuah requested a review from ngphibang April 29, 2025 17:33
ngphibang
ngphibang previously approved these changes Apr 29, 2025
@kartben kartben requested a review from Copilot May 3, 2025 06:17
Copy link

@Copilot 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 introduces support for using the Olimex OV7670 camera with the FRDM-MCXN947 board by adding a new shield configuration and related GPIO nexus definitions. Key changes include:

  • Adding a new board configuration entry in the sample YAML file for frdm_mcxn947 using the set shield parameters.
  • Introducing a new header file (dvp-20pin-connector.h) defining pin mappings for the Arducam DVP 20-pin connector.
  • Updating vendor prefixes and adding a device tree binding YAML for the new arducam,dvp-20pin-connector.

Reviewed Changes

Copilot reviewed 4 out of 11 changed files in this pull request and generated 2 comments.

File Description
samples/drivers/video/capture/sample.yaml Added new board configuration for frdm_mcxn947 shield.
include/zephyr/dt-bindings/gpio/dvp-20pin-connector.h Added definitions for the Arducam DVP 20-pin connector.
dts/bindings/vendor-prefixes.txt Included vendor prefix for Arducam.
dts/bindings/gpio/arducam,dvp-20pin-connector.yaml Added YAML binding for the Arducam DVP 20-pin connector nexus.
Files not reviewed (7)
  • boards/nxp/frdm_mcxn947/frdm_mcxn947.dtsi: Language not supported
  • boards/shields/dvp_20pin_ov7670/Kconfig.shield: Language not supported
  • boards/shields/dvp_20pin_ov7670/doc/index.rst: Language not supported
  • boards/shields/dvp_20pin_ov7670/dvp_20pin_ov7670.overlay: Language not supported
  • boards/shields/dvp_fpc24_mt9m114/Kconfig.shield: Language not supported
  • samples/drivers/video/capture/README.rst: Language not supported
  • samples/drivers/video/capture/boards/frdm_mcxn947_cpu0.overlay: Language not supported

@josuah josuah force-pushed the pr-frdm-mcxn947-shield branch 2 times, most recently from 58bba81 to c4107f8 Compare May 6, 2025 12:17
@github-actions github-actions bot added the area: USB Universal Serial Bus label May 6, 2025
@josuah josuah force-pushed the pr-frdm-mcxn947-shield branch 2 times, most recently from 0e3dc17 to d7b3565 Compare May 6, 2025 12:28
@josuah
Copy link
Contributor Author

josuah commented May 6, 2025

Force-push:

Tested again using UVC temporarily cherry-picked on top.

ngphibang
ngphibang previously approved these changes May 6, 2025
********

This series of shields supports the camera modules which use a 18-pin connector compatible with
the ``arducam,dvp-20pin-connector`` to connect a devkit to an OV7670 image sensor via DVP
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
the ``arducam,dvp-20pin-connector`` to connect a devkit to an OV7670 image sensor via DVP
the :dtcompatible:`arducam,dvp-20pin-connector` to connect a devkit to an OV7670 image sensor via DVP

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good to know!

Requirements
************

This shield can be used with any board which provides a 18 or 20-pin header spread over two rows
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
This shield can be used with any board which provides a 18 or 20-pin header spread over two rows
This shield can be used with any board that provides an 18 or 20-pin header spread over two rows

Comment on lines 5 to 6
GPIO pins exposed on ArduCam 20-pin header camera connector,
originally designed to connect Arducam modules to Arduino Giga R1,
Copy link
Contributor

Choose a reason for hiding this comment

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

This makes sure there is a short "title" instead of the otherwise long sentence.
You may also used the new-ish title property, actually.

Suggested change
GPIO pins exposed on ArduCam 20-pin header camera connector,
originally designed to connect Arducam modules to Arduino Giga R1,
GPIO pins exposed on ArduCam 20-pin header camera connector.
Originally designed to connect Arducam modules to Arduino Giga R1,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seemed a bit long for a title looking at #86533 so tried to balance it out.

Comment on lines 12 to 13
#define DVP_20PIN_SCL 3 /**< I2C pin */
#define DVP_20PIN_SDA 4 /**< I2C pin */
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: explicit better one is clock the other is data?

josuah added 4 commits May 7, 2025 10:58
Add the 20-pin camera connector used by at least Arducam, Waveshare,
Olimex, Arduino, NXP, ST, Adafruit that connects image sensor module
boards and devkits.

Signed-off-by: Josuah Demangeon <me@josuah.net>
The OV7670 was defined as part of the FRDM-MCXN947 board attached to the
SmartDMA and I2C peripheral. Migrate the devicetree to a reusable shield
that can be swapped with other image sensors.

Signed-off-by: Josuah Demangeon <me@josuah.net>
Add FRDM-MCXN947 to the video capture sample documentation and twister
YAML configuration, using the DVP OV7670 camera module newly introduced.

Signed-off-by: Josuah Demangeon <me@josuah.net>
The script zephyr/scripts/kconfig/kconfigfunctions.py used by
Kconfig's "shields_list_contains" searches shield names in lower-case,
like they are passed through the SHIELD in CMake, --shield argument
in west. Make the mt9m114 shield upper-case. This has no effect currently
as this Kconfig entry is not used anywhere in Zephyr.

Signed-off-by: Josuah Demangeon <me@josuah.net>
@josuah josuah force-pushed the pr-frdm-mcxn947-shield branch from d7b3565 to 5aa807e Compare May 7, 2025 11:01
@josuah josuah requested a review from kartben May 7, 2025 12:52
@kartben kartben requested a review from ngphibang May 7, 2025 13:03
Copy link
Contributor

@ngphibang ngphibang left a comment

Choose a reason for hiding this comment

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

Thanks !

@fabiobaltieri fabiobaltieri merged commit c674723 into zephyrproject-rtos:main May 7, 2025
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants