This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Capture image with Raspberry pi camera module v2 (Sony IMX219)

Part Number: SK-AM62


I am trying to capture image with  Raspberry pi camera Module v2 (Sony IMX219) on AM62-SK board with pre-build Image from SDK (08_04_01_03) by adding below dts as overlay

/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/pinctrl/k3.h>

/ {
        fragment@101 {
                target-path = "/";

                __overlay__ {
                        clk_imx219_fixed: imx219-xclk {
                                compatible = "fixed-clock";
                                #clock-cells = <0>;
                                clock-frequency = <24000000>;
                        };
                };
        };
};

&main_i2c2 {
        pinctrl-names = "default";
        pinctrl-0 = <&main_i2c2_pins_default>;
        #address-cells = <1>;
        #size-cells = <0>;
        status = "okay";

        /*
         * HACK: The camera module only works reliably at 10 KHz. So drop the
         * bus frequency to 10 KHz.
         */
        clock-frequency = <10000>;

        i2c-switch@71 {
                compatible = "nxp,pca9543";
                #address-cells = <1>;
                #size-cells = <0>;
                reg = <0x71>;

                /* CAM port */
                i2c@0 {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        reg = <1>;

                        imx219: imx219@10 {
                                compatible = "sony,imx219";
                                reg = <0x10>;

                                clocks = <&clk_imx219_fixed>;
                                clock-names = "xclk";

                                pinctrl-names = "default";
                                reset-gpios = <&exp1 13 GPIO_ACTIVE_HIGH>;

                                port {
                                        csi2_cam0: endpoint {
                                                remote-endpoint = <&csi2rx0_in_sensor>;
                                                link-frequencies = /bits/ 64 <456000000>;
                                                clock-lanes = <0>;
                                                data-lanes = <1 2>;
                                        };
                                };
                        };
                };
        };
};

&csi0_port0 {
        status = "okay";

        csi2rx0_in_sensor: endpoint {
                remote-endpoint = <&csi2_cam0>;
                bus-type = <4>; /* CSI2 DPHY. */
                clock-lanes = <0>;
                data-lanes = <1 2>;
        };
};

imx219 module is loaded and node are generated

root@am62xx-evm:~# v4l2-ctl --list-devices

j721e-csi2rx (platform:30102000.ticsi2rx):

        /dev/video0

        /dev/video1

        /dev/video2

        /dev/video3

        /dev/media0

root@am62xx-evm:~# media-ctl -d /dev/media0 -p

Media controller API version 5.10.140

Media device information

------------------------

driver          j721e-csi2rx

model           TI-CSI2RX

serial

bus info        platform:30102000.ticsi2rx

hw revision     0x1

driver version  5.10.140

 

Device topology

- entity 1: 30102000.ticsi2rx (5 pads, 5 links, 1 route)

            type V4L2 subdev subtype Unknown flags 0

            device node name /dev/v4l-subdev0

        routes:

                0/0 -> 1/0 [ACTIVE]

        pad0: Sink

                [stream:0 fmt:UYVY8_2X8/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]

                <- "cdns_csi2rx.30101000.csi-bridge":1 [ENABLED,IMMUTABLE]

        pad1: Source

                [stream:0 fmt:UYVY8_2X8/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]

                -> "30102000.ticsi2rx context 0":0 [ENABLED,IMMUTABLE]

        pad2: Source

                -> "30102000.ticsi2rx context 1":0 [ENABLED,IMMUTABLE]

        pad3: Source

                -> "30102000.ticsi2rx context 2":0 [ENABLED,IMMUTABLE]

        pad4: Source

                -> "30102000.ticsi2rx context 3":0 [ENABLED,IMMUTABLE]

 

- entity 7: cdns_csi2rx.30101000.csi-bridge (5 pads, 2 links, 0 route)

            type V4L2 subdev subtype Unknown flags 0

            device node name /dev/v4l-subdev1

        pad0: Sink

                [stream:0 fmt:UYVY8_2X8/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]

                <- "imx219 4-0010":0 [ENABLED,IMMUTABLE]

        pad1: Source

                [stream:0 fmt:UYVY8_2X8/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]

                -> "30102000.ticsi2rx":0 [ENABLED,IMMUTABLE]

        pad2: Source

                [stream:0 fmt:UYVY8_2X8/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]

        pad3: Source

                [stream:0 fmt:UYVY8_2X8/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]

        pad4: Source

                [stream:0 fmt:UYVY8_2X8/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]

 

- entity 13: imx219 4-0010 (1 pad, 1 link, 0 route)

             type V4L2 subdev subtype Sensor flags 0

             device node name /dev/v4l-subdev2

        pad0: Source

                [stream:0 fmt:SRGGB10_1X10/3280x2464 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range

                 crop.bounds:(8,8)/3280x2464

                 crop:(8,8)/3280x2464]

                -> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]

 

- entity 19: 30102000.ticsi2rx context 0 (1 pad, 1 link, 0 route)

             type Node subtype V4L flags 0

             device node name /dev/video0

        pad0: Sink

                <- "30102000.ticsi2rx":1 [ENABLED,IMMUTABLE]

 

- entity 25: 30102000.ticsi2rx context 1 (1 pad, 1 link, 0 route)

             type Node subtype V4L flags 0

             device node name /dev/video1

        pad0: Sink

                <- "30102000.ticsi2rx":2 [ENABLED,IMMUTABLE]

 

- entity 31: 30102000.ticsi2rx context 2 (1 pad, 1 link, 0 route)

             type Node subtype V4L flags 0

             device node name /dev/video2

        pad0: Sink

                <- "30102000.ticsi2rx":3 [ENABLED,IMMUTABLE]

 

- entity 37: 30102000.ticsi2rx context 3 (1 pad, 1 link, 0 route)

             type Node subtype V4L flags 0

             device node name /dev/video3

        pad0: Sink

                <- "30102000.ticsi2rx":4 [ENABLED,IMMUTABLE]

root@am62xx-evm:~# v4l2-ctl -d /dev/v4l-subdev2 --list-subdev-mbus-codes pad=0

ioctl: VIDIOC_SUBDEV_ENUM_MBUS_CODE (pad=0,stream=0)

        0x300f: MEDIA_BUS_FMT_SRGGB10_1X10

        0x3014: MEDIA_BUS_FMT_SRGGB8_1X8

 

root@am62xx-evm:~# v4l2-ctl -d /dev/v4l-subdev2 --list-subdev-framesizes pad=0,code=0x300f

ioctl: VIDIOC_SUBDEV_ENUM_FRAME_SIZE (pad=0,stream=0)

        Size Range: 3280x2464 - 3280x2464

        Size Range: 1920x1080 - 1920x1080

        Size Range: 1640x1232 - 1640x1232

        Size Range: 640x480 - 640x480

root@am62xx-evm:~# v4l2-ctl -d /dev/v4l-subdev2 --list-subdev-framesizes pad=0,code=0x3014

ioctl: VIDIOC_SUBDEV_ENUM_FRAME_SIZE (pad=0,stream=0)

        Size Range: 3280x2464 - 3280x2464

        Size Range: 1920x1080 - 1920x1080

        Size Range: 1640x1232 - 1640x123

        Size Range: 640x480 - 640x480

facing issue to list supported frame rates and getting below error

root@am62xx-evm:~# v4l2-ctl -d /dev/v4l-subdev2 --list-subdev-frameintervals pad=0,width=3280,height=2464,code=0x3014

ioctl: VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL (pad=0,stream=0)

root@am62xx-evm:~# v4l2-ctl --device /dev/video0 --set-fmt-video=width=3280,height=2464,pixelformat='RG10'

root@am62xx-evm:~# v4l2-ctl --device /dev/video0 --stream-mmap --stream-to=demo.raw --stream-count=1

[ 7436.082088] cdns-mipi-dphy 30110000.phy: DPHY wait for lane ready timeout

[ 7436.088899] cdns-csi2rx 30101000.csi-bridge: Failed to configure external DPHY: -110

                VIDIOC_STREAMON returned -1 (Connection timed out)

any info to solve issue will be help full.

Thanks,

Gireesh Hiremath