Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8597

Camera board • Re: How to use the imx662 camera on Raspberry Pi Compute Module 5?

$
0
0
I am currently using the following imx662-overlay.dts configuration, which successfully initializes two IMX662 cameras.

Device Tree Overlay (imx662-overlay.dts)

Code:

// SPDX-License-Identifier: GPL-2.0-only// Device Tree Overlay for IMX662 camera module on Raspberry Pi CM5 (BCM2712)/dts-v1/;/plugin/;/ {compatible = "brcm,bcm2712", "brcm,bcm2835";fragment@0 {target = <&cam_endpoint>;__overlay__ {data-lanes = <1 2>;link-frequencies = /bits/ 64 <594000000>;};};fragment@1 {target = <&cam_endpoint>;__dormant__ {data-lanes = <1 2 3 4>;link-frequencies = /bits/ 64 <297000000>;};};fragment@2 {target = <&csi_ep>;__overlay__ {data-lanes = <1 2>;};};fragment@3 {target = <&csi_ep>;__dormant__ {data-lanes = <1 2 3 4>;};};i2c_frag: fragment@10 {target = <&i2c_csi_dsi1>;__overlay__ {#address-cells = <1>;#size-cells = <0>;status = "okay";cam_node: imx662@1a {compatible = "sony,imx662";reg = <0x1a>;clocks = <&cam1_clk>;clock-names = "xclk";clock-frequency = <37125000>;rotation = <0>;orientation = <2>;vdda-supply = <&cam1_reg>;vdddo-supply = <&cam_dummy_reg>;vddd-supply = <&cam_dummy_reg>;port {cam_endpoint: endpoint {remote-endpoint = <&csi_ep>;clock-lanes = <0>;};};};};};csi_frag: fragment@11 {target = <&csi1>;csi: __overlay__ {status = "okay";brcm,media-controller;port {csi_ep: endpoint {remote-endpoint = <&cam_endpoint>;};};};};fragment@12 {target = <&i2c0if>;__overlay__ {status = "okay";};};clk_frag: fragment@13 {target = <&cam1_clk>;cam_clk: __overlay__ {status = "okay";clock-frequency = <37125000>;};};fragment@14 {target = <&i2c0mux>;__overlay__ {status = "okay";};};__overrides__ {4lane = <0>, "-0+1-2+3";clock-frequency = <&cam_clk>,"clock-frequency:0",  <&cam_node>,"clock-frequency:0";rotation = <&cam_node>,"rotation:0";orientation = <&cam_node>,"orientation:0";media-controller = <&csi>,"brcm,media-controller?";cam0 = <&i2c_frag>, "target:0=", <&i2c_csi_dsi0>,<&csi_frag>, "target:0=", <&csi0>,<&clk_frag>, "target:0=", <&cam0_clk>,<&cam_node>, "clocks:0=", <&cam0_clk>,<&cam_node>, "vdda-supply:0=", <&cam0_reg>;mono = <0>, "";};};
Config.txt Configuration
I have added the following configurations in /boot/config.txt:

Code:

dtoverlay=imx662,cam0dtoverlay=imx662,cam1
I ran the i2cdetect command to verify if the devices are detected properly.
pi@raspberrypi:~ $ sudo i2cdetect -l
i2c-0 i2c Synopsys DesignWare I2C adapter I2C adapter
i2c-1 i2c Synopsys DesignWare I2C adapter I2C adapter
i2c-10 i2c Synopsys DesignWare I2C adapter I2C adapter
i2c-13 i2c 107d508200.i2c I2C adapter
i2c-14 i2c 107d508280.i2c I2C adapter
pi@raspberrypi:~ $ ls -l /dev/i2c*
crw-rw---- 1 root i2c 89, 0 Mar 1 15:18 /dev/i2c-0
crw-rw---- 1 root i2c 89, 1 Mar 1 15:18 /dev/i2c-1
crw-rw---- 1 root i2c 89, 10 Mar 1 15:18 /dev/i2c-10
lrwxrwxrwx 1 root root 5 Mar 1 15:18 /dev/i2c-11 -> i2c-0
crw-rw---- 1 root i2c 89, 13 Mar 1 15:18 /dev/i2c-13
crw-rw---- 1 root i2c 89, 14 Mar 1 15:18 /dev/i2c-14
lrwxrwxrwx 1 root root 6 Mar 1 15:18 /dev/i2c-6 -> i2c-10
pi@raspberrypi:~ $ sudo i2cdetect -y 10
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- UU -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
pi@raspberrypi:~ $ sudo i2cdetect -y 11
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- UU -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: 50 -- -- -- -- -- -- -- 58 -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

Error Messages
After running libcamera-hello for testing, I checked dmesg and found the following errors:

Code:

[    3.197153] pps pps0: new PPS source ptp1[    3.197249] macb 1f00100000.ethernet: gem-ptp-timer ptp clock registered.[    6.276939] macb 1f00100000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off[    7.450731] cfg80211: Loading compiled-in X.509 certificates for regulatory database[    7.455110] Loaded X.509 cert 'benh@debian.org: 577e021cb980e0e820821ba7b54b4961b8b4fadf'[    7.455312] Loaded X.509 cert 'romain.perier@gmail.com: 3abbc6ec146e09d1b6016ab9d6cf71dd233f0328'[    7.455504] Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'[    7.455692] Loaded X.509 cert 'wens: 61c038651aabdcf94bd0ac7ff06c7248db18c600'[   44.844122] source of link 'rp1-cfe-fe_config':0->'pisp-fe':1 is not a V4L2 sub-device, driver bug![   44.844143] rp1-cfe 1f00110000.csi: Using a link rate of 1188 Mbps[   44.938479] write INCK_SEL with 01
Let me know if there are any additional steps I should try.
Thank you for your assistance!

Statistics: Posted by LchiChung — Sat Mar 01, 2025 7:45 am



Viewing all articles
Browse latest Browse all 8597

Trending Articles