-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
base: main
Are you sure you want to change the base?
boards: frdm_mcxn947: turn OV7670 into a shield #89131
Conversation
Tested with UVC (by cherry-picking commits): Before: After: 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] |
a0d81be
to
e03e9da
Compare
- dvp_20pin_interface: the video interface that receives the video | ||
feed and use with the zephyr,camera chosen node. | ||
- dvp_20pin_ep_in: video endpoint of the devkit receiving the video | ||
feed (see video-interfaces.yaml). | ||
- dvp_20pin_ep_out: video endpoint of the camera module to interconnect | ||
with this endpoint (see video-interfaces.yaml). | ||
- dvp_20pin_i2c: the I2C device of the devkit on which the camera | ||
module is instantiated. | ||
- dvp_20pin_gpio: the gpio nexus using the arducam,dvp-20pin-connector | ||
that defines the camera 'reset' pin, 'power-down' pin, etc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shields does not talk about a zephyr_...
prefix:
zephyr/boards/weact/mini_stm32h743/mini_stm32h743.dts
Lines 243 to 253 in 02f85b2
zephyr_camera_i2c: &i2c1 { | |
pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; | |
pinctrl-names = "default"; | |
}; | |
zephyr_camera_dvp: &dcmi { | |
pinctrl-0 = <&dcmi_hsync_pa4 &dcmi_pixclk_pa6 &dcmi_vsync_pb7 | |
&dcmi_d0_pc6 &dcmi_d1_pc7 &dcmi_d2_pe0 &dcmi_d3_pe1 | |
&dcmi_d4_pe4 &dcmi_d5_pd3 &dcmi_d6_pe5 &dcmi_d7_pe6>; | |
pinctrl-names = "default"; | |
}; |
So I went with dvp_20pin_<sensorname>
and dvp_20pin_<feature>
.
Let me know if zephyr_camera_<...>
is better!
e03e9da
to
283745b
Compare
283745b
to
d171799
Compare
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>
d171799
to
c159802
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the added shield.
Did you test the video capture sample ? I think you need to update the frdm_mcxn947_cpu0.overlay
in the sample as well because the camera is now moved out of the board.
port { | ||
sdma_ep_in: endpoint { | ||
remote-endpoint-label = "ov7670_ep_out"; | ||
dvp_20pin_ep_in: endpoint { | ||
remote-endpoint-label = "dvp_20pin_ep_out"; | ||
}; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be here but in the overlay as it is out of the board. If there are multiple ports / endpoints, you can reserve a port for it as below (but it's not the case here):
https://github.com/zephyrproject-rtos/zephyr/blob/main/dts/arm/nxp/nxp_rt11xx.dtsi#L911-#L934
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the remote-endpoint-label = "dvp_20pin_ep_out";
and it still works!
Is that what I should remove?
I am not sure how to remove the label itself dvp_20pin_ep_in:
as the shield cannot know where it should insert itself on every board, the board.dts
has to provide a label for the shield insertion point?
Thank you for your help as I learn DTS further.
8f6cc03
to
a094905
Compare
Good point! Now I can remove it as the shield would select the Trying again after enabling the debug logging:
|
a094905
to
ecee1dd
Compare
I was hitting a CI error when removing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
I am not sure if this 20-pin shield is generic and not specific only to NXP boards. If it is generic (as currently implemented), it will be similar to the dvp_fpc24_mt9m114 shield used on the mimxrt1064_evk. Could you take a look at
https://github.com/zephyrproject-rtos/zephyr/blob/main/dts/arm/nxp/nxp_rt10xx.dtsi#L885-#L890
https://github.com/zephyrproject-rtos/zephyr/blob/main/boards/nxp/mimxrt1064_evk/mimxrt1064_evk.dts#L352-#L354
https://github.com/zephyrproject-rtos/zephyr/blob/main/boards/shields/dvp_fpc24_mt9m114/dvp_fpc24_mt9m114.overlay -
Could you add an entry for the frdm_mcxn947_cpu0 in the video capture sample README, section "Build and Running" as well ?
https://github.com/zephyrproject-rtos/zephyr/blob/main/samples/drivers/video/capture/README.rst
Thanks
&smartdma { | ||
status = "okay"; | ||
program-mem = <0x4000000>; | ||
video_sdma: video-sdma { | ||
status = "okay"; | ||
/* Shields do not enable video-sdma parent node */ | ||
status = "okay"; | ||
|
||
dvp_20pin_interface: video_sdma: video-sdma { | ||
compatible = "nxp,video-smartdma"; | ||
pinctrl-0 = <&pinmux_smartdma_camera>; | ||
pinctrl-names = "default"; | ||
vsync-pin = <4>; | ||
hsync-pin = <11>; | ||
pclk-pin = <5>; | ||
status = "disabled"; | ||
|
||
port { | ||
sdma_ep_in: endpoint { | ||
remote-endpoint-label = "ov7670_ep_out"; | ||
dvp_20pin_ep_in: endpoint { | ||
remote-endpoint-label = "empty"; | ||
}; | ||
}; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I am confused here. I think the right way is keeping the video sdma node and label it as a dvp_20pin_interface
as in https://github.com/zephyrproject-rtos/zephyr/blob/main/boards/nxp/mimxrt1064_evk/mimxrt1064_evk.dts#L352-#L354
&dvp_20pin_ep_in { | ||
remote-endpoint-label = "dvp_20pin_ep_out"; | ||
}; | ||
|
||
&dvp_20pin_interface { | ||
status = "okay"; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The endpoint should be inside the interface node.
ecee1dd
to
dc57200
Compare
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>
13ea982
to
cb237fc
Compare
Force-push:
It is the closest thing from a standard for DVP we might have, plenty of Arducam modules available via UCTRONICS, and some 3rd-party too, like the Olimex one for the OV7670. But a de-facto standard, no official document describing it. This will help for testing all these drivers! |
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.
This also proposes an
arducam,dvp-20pin-connector
GPIO nexus:https://github.com/zephyrproject-rtos/zephyr/pull/89131/files#diff-a39283efe7f5b76e206c8d2b9b65c4b45d130ceb1aa6bb8a0083486793172537