Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Portenta H7: Enable Camera clock#184

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
KurtE wants to merge1 commit intoarduino:main
base:main
Choose a base branch
Loading
fromKurtE:enable_camera_on_h7

Conversation

KurtE
Copy link

We need to start the clock in the same way as we do for the Arduino GIGA.

As without the clock started, most cameras will not even make the camera visible to I2C
This unrelated change was in the branch of#165
And has now been pulled out of it.

This PR is only a change of a #if statement that adds the Portenta H7 to the line that enables the clock for the Giga.
And only if Video (Camera) is configured in the .conf files.

Currently the overlay for the PortentaH7 is setup with the configuration to run on the Mid Carrier board, which is
different than the Portenta Vision shield. At some point probably need to configure it for either. Not sure
what Arduino wishes to do for this. Define them as Shields in Zephyr and have multiple variants? But that
is beyond the scope of this simple change.

@KurtE
Copy link
Author

KurtE commentedAug 25, 2025
edited
Loading

@iabdalkader@pillo79@facchinm and others: As I have asked in issue#164 wondering best way to do this.

For example: currently it is setup like:

#if (defined(CONFIG_BOARD_ARDUINO_GIGA_R1) || defined(CONFIG_BOARD_ARDUINO_PORTENTA_H7)) \&& defined(CONFIG_VIDEO)#include <zephyr/kernel.h>#include <zephyr/device.h>#include <zephyr/drivers/clock_control.h>#include <zephyr/logging/log.h>int camera_ext_clock_enable(void){int ret;uint32_t rate;const struct device *cam_ext_clk_dev = DEVICE_DT_GET(DT_NODELABEL(pwmclock));if (!device_is_ready(cam_ext_clk_dev)) {return -ENODEV;}ret = clock_control_on(cam_ext_clk_dev, (clock_control_subsys_t)0);if (ret < 0) {return ret;}ret = clock_control_get_rate(cam_ext_clk_dev, (clock_control_subsys_t)0, &rate);if (ret < 0) {return ret;}return 0;}SYS_INIT(camera_ext_clock_enable, POST_KERNEL, CONFIG_CLOCK_CONTROL_PWM_INIT_PRIORITY);#endif

Note: this includes my one line change in this PR to enable it on Portenta H7.

But I keep wondering on ArduinoCore-zephyr, that Not all user sketches use Cameras, and yet we always start up
a clock pin running doing PWM. Could this not all be done within the Camera::begin(...) method?
That way only done if the sketch actually does anything with Cameras. Wondering if starting up resources like this
when they may or may not be applicable is a good thing. For example if your board is running off of a battery,
will this cause unnecessary power drain?

Also with this, maybe define some way to allow the sketch to specify which pins and/or which Carrier/Shield they
are using. For example: on the Portenta H7, they don't all use the same pin for the Clock (PA_8, PK_1). They use the same
timer. I know that OpenMV starts the timer ands sets both pins MUX(AF) to the timer. But again not sure in this
case we want to dedicate two pins for this as again not all sketches uses cameras.
But maybe if there was something like: myCamera.setShield(PORTENTA_VISION_SHIELD); it could set the
time pin and probably the Reset (actually the power on pin) and PWDN (not applicable)...

Thoughts?

Edit: Note: there currently is no approved way to actually access the PK_1 pin on Zephyr. Except if it is called out
somewhere within the overlay files. That is there is no Arduino Pin number associated with it, nor do we have
access by pin names.

@KurtEKurtEforce-pushed theenable_camera_on_h7 branch 2 times, most recently from3d8bddd to75ccddaCompareAugust 28, 2025 14:44
We need to start the clock in the same way as we do for the Arduino GIGA.As without the clock started, most cameras will not even make the cameravisible to I2C
@KurtEKurtE changed the titleEnable Camera clock on Arduino Portenta H7Portenta H7: Enable Camera clockAug 28, 2025
@KurtE
Copy link
Author

Note: - I believe that my PR#195 is a better solution. It does not start the clocks until/if the sketch calls camera.begin

But to do this the cameras and DCIM need to be marked as defered init in the overlay, as to not have them try to initialize things
before the clock has been started. That PR updated both GIGA and H7 with the changes.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@KurtE

[8]ページ先頭

©2009-2025 Movatter.jp