CSI2 Camera does not work properly for 1080@60fps

Hardware connection:
image sensor(imx390)---->ISP—>mx9295a-----GSML------>mx9296a----MIPI---->nano

camera hardware configuration:
imx390
1920X1080@60fps

problem:
The camera outputs 1080p@60 data by default, without any settings, just power on.
Measured with oscilloscope, Mipi signal is also normal to csi2 interface。
Modify this file “nvidia/drivers/media/i2c/imx219.c”, Let imx219 driver probe succeed and register the v4l2 device.
Run as below at terminal:
sudo gst-launch-1.0 nvarguscamerasrc ! ‘video/x-raw(memory:NVMM),width=1920,height=1080,framerate=60/1,format=NV12’ ! nvvidconv flip-method=0 ! ‘video/x-raw,width=800,height=600’ ! nvvidconv ! nvegltransform ! nveglglessink -e

Kernel error reporting as below:
vi 54080000.vi: tegra_channel_error_status:error 4000 frame 0
vi 54080000.vi: tegra_channel_error_status:error 4000 frame 1
vi 54080000.vi: tegra_channel_error_status:error 4000 frame 2
vi 54080000.vi: tegra_channel_error_status:error 4000 frame 3
vi 54080000.vi: tegra_channel_error_status:error 4000 frame 4

Please help to see how to solve this problem. Thank you.

Have a reference to below link to check the trace log.

https://elinux.org/Jetson_TX2_Camera_BringUp

OOPS it’s nano there’s no trace machine.
Have enable the kernel log from the csi2_fops.c and use v4l2-ctl to capture to check the error.

Thank you for your reply!

log as below:
[ 157.055065] imx219 6-0048: camera_common_mclk_enable: enable MCLK with 24000000 Hz
[ 157.055122] imx219 6-0048: camera_common_dpd_disable: csi 0
[ 157.055128] imx219 6-0048: imx219_power_on: power on
[ 157.313863] vi 54080000.vi: Calibrate csi port 0
[ 157.314219] imx219 6-0048: imx219_power_off: power off
[ 157.319556] imx219 6-0048: camera_common_dpd_enable: csi 0
[ 157.319575] imx219 6-0048: camera_common_mclk_disable: disable MCLK
[ 157.319623] imx219 6-0048: camera_common_mclk_enable: enable MCLK with 24000000 Hz
[ 157.319672] imx219 6-0048: camera_common_dpd_disable: csi 0
[ 157.319675] imx219 6-0048: imx219_power_on: power on
[ 157.371540] vi 54080000.vi: cil_settingtime was autocalculated
[ 157.371544] vi 54080000.vi: csi clock settle time: 13, cil settle time: 10
[ 157.609318] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 0
[ 157.626055] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 1
[ 157.642640] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 2
[ 157.659429] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 3
[ 157.676155] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 4
[ 157.692659] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 5
[ 157.709403] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 6
[ 157.726097] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 7
[ 157.743113] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 8
[ 157.759456] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 9
[ 157.776176] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 10
[ 157.792835] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 11
[ 157.809610] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 12
[ 157.826109] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 13
[ 157.843566] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 14
[ 157.859375] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 15
[ 157.876171] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 16
[ 157.892843] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 17
[ 157.909504] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 18
[ 157.926107] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 19
[ 157.943015] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 20
[ 157.959514] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 21
[ 157.976163] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 22
[ 157.992714] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 23
[ 158.009224] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 24
[ 158.026026] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 25
[ 158.042770] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 26
[ 158.059624] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 27
[ 158.076019] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 28
[ 158.092722] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 29
[ 158.109317] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 30
[ 158.126013] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 31
[ 158.142842] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 32
[ 158.159816] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 33
[ 158.176192] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 34
[ 158.186444] imx219 6-0048: imx219_power_off: power off
[ 158.191921] imx219 6-0048: camera_common_dpd_enable: csi 0
[ 158.191928] imx219 6-0048: camera_common_mclk_disable: disable MCLK

dts config:
/ {
host1x {
vi_base: vi {
num-channels = <1>;
ports {
#address-cells = <1>;
#size-cells = <0>;
vi_port0: port@0 {
reg = <0>;
rbpcv2_imx219_vi_in0: endpoint {
port-index = <0>;
bus-width = <2>;
remote-endpoint = <&rbpcv2_imx219_csi_out0>;
};
};
};
};

            csi_base: nvcsi {
                    num-channels = <1>;
                    #address-cells = <1>;
                    #size-cells = <0>;
                    csi_chan0: channel@0 {
                            reg = <0>;
                            ports {
                                    #address-cells = <1>;
                                    #size-cells = <0>;
                                    csi_chan0_port0: port@0 {
                                            reg = <0>;
                                            rbpcv2_imx219_csi_in0: endpoint@0 {
                                                    port-index = <0>;
                                                    bus-width = <2>;
                                                    remote-endpoint = <&rbpcv2_imx219_out0>;
                                            };
                                    };
                                    csi_chan0_port1: port@1 {
                                            reg = <1>;
                                            rbpcv2_imx219_csi_out0: endpoint@1 {
                                                    remote-endpoint = <&rbpcv2_imx219_vi_in0>;
                                            };
                                    };
                            };
                    };
            };

            i2c@546c0000 {
                    imx219_single_cam0: rbpcv2_imx219_a@10 {
                            compatible = "nvidia,imx219";
                            /* I2C device address */
                            reg = <0x10>;
                            /* V4L2 device node location */
                            devnode = "video0";

                            /* Physical dimensions of sensor */
                            physical_w = "3.680";
                            physical_h = "2.760";

                            sensor_model = "imx219";

                            use_sensor_mode_id = "true";
                            mode0 { /* IMX219_MODE_1920x1080_60FPS */
                                    mclk_khz = "24000";
                                    num_lanes = "2";
                                    tegra_sinterface = "serial_a";
                                    phy_mode = "DPHY";
                                    discontinuous_clk = "yes";
                                    dpcm_enable = "false";
                                    cil_settletime = "0";

                                    active_w = "1920";
                                    active_h = "1080";
                                    pixel_t = "yuv_yuyv16";/* bayer_rggb */
                                    /*csi_pixel_bit_depth = "16";*/

                                    readout_orientation = "90";
                                    line_length = "3448";
                                    inherent_gain = "1";
                                    mclk_multiplier = "9.33";
                                    pix_clk_hz = "62208000"; /* 576000000*/

                                    gain_factor = "16";
                                    framerate_factor = "1000000";
                                    exposure_factor = "1000000";
                                    min_gain_val = "16"; /* 1.00x */
                                    max_gain_val = "170"; /* 10.66x */
                                    step_gain_val = "1";
                                    default_gain = "16"; /* 1.00x */
                                    min_hdr_ratio = "1";
                                    max_hdr_ratio = "1";
                                    min_framerate = "2000000"; /* 2.0 fps */
                                    max_framerate = "60000000"; /* 30.0 fps */
                                    step_framerate = "1";
                                    default_framerate = "60000000"; /* 30.0 fps */
                                    min_exp_time = "13"; /* us */
                                    max_exp_time = "683709"; /* us */
                                    step_exp_time = "1";
                                    default_exp_time = "2495"; /* us */

                                    embedded_metadata_height = "0";
                            };
                            ports {
                                    #address-cells = <1>;
                                    #size-cells = <0>;

                                    port@0 {
                                            reg = <0>;
                                            rbpcv2_imx219_out0: endpoint {
                                                    port-index = <0>;
                                                    bus-width = <2>;
                                                    remote-endpoint = <&rbpcv2_imx219_csi_in0>;
                                            };
                                    };
                            };
                    };
            };
};

    lens_imx219@RBPCV2 {
            min_focus_distance = "0.0";
            hyper_focal = "0.0";
            focal_length = "3.04";
            f_number = "2.0";
            aperture = "0.0";
    };

};
/ {
tcp: tegra-camera-platform {
compatible = “nvidia, tegra-camera-platform”;

            /**
            * Physical settings to calculate max ISO BW
            *
            * num_csi_lanes = <>;
            * Total number of CSI lanes when all cameras are active
            *
            * max_lane_speed = <>;
            * Max lane speed in Kbit/s
            *
            * min_bits_per_pixel = <>;
            * Min bits per pixel
            *
            * vi_peak_byte_per_pixel = <>;
            * Max byte per pixel for the VI ISO case
            *
            * vi_bw_margin_pct = <>;
            * Vi bandwidth margin in percentage
            *
            * max_pixel_rate = <>;
            * Max pixel rate in Kpixel/s for the ISP ISO case
            *
            * isp_peak_byte_per_pixel = <>;
            * Max byte per pixel for the ISP ISO case
            *
            * isp_bw_margin_pct = <>;
            * Isp bandwidth margin in percentage
            */
            num_csi_lanes = <2>;
            max_lane_speed = <1500000>;
            min_bits_per_pixel = <10>;
            vi_peak_byte_per_pixel = <2>;
            vi_bw_margin_pct = <25>;
            max_pixel_rate = <750000>;
            isp_peak_byte_per_pixel = <5>;
            isp_bw_margin_pct = <25>;

            modules {
                    cam_module0: module0 {
                            badge = "porg_front_RBPCV2";
                            position = "front";
                            orientation = "1";
                            cam_module0_drivernode0: drivernode0 {
                                    pcl_id = "v4l2_sensor";
                                    devname = "imx219 6-0010";
                                    proc-device-tree = "/proc/device-tree/host1x/i2c@546c0000/rbpcv2_imx219_a@10";
                            };
                            cam_module0_drivernode1: drivernode1 {
                                    pcl_id = "v4l2_lens";
                                    proc-device-tree = "/proc/device-tree/lens_imx219@RBPCV2/";
                            };
                    };
            };
    };

};

You need enable the message from this function.
Try below command
sudo su
echo file csi2_fops.c +p > /sys/kernel/debug/dynamic_debug/control

void tegra_csi_status(struct tegra_csi_channel *chan,
			enum tegra_csi_port_num port_num)
{
	int i;
	u32 val;
	struct tegra_csi_port *port;

	for (i = 0; i < chan->numports; i++) {
		port = &chan->ports[i];
		val = pp_read(port, TEGRA_CSI_PIXEL_PARSER_STATUS);

		dev_dbg(chan->csi->dev,
			"TEGRA_CSI_PIXEL_PARSER_STATUS 0x%08x\n",
			val);

		val = cil_read(port, TEGRA_CSI_CIL_STATUS);
		dev_dbg(chan->csi->dev,
			"TEGRA_CSI_CIL_STATUS 0x%08x\n", val);

		val = cil_read(port, TEGRA_CSI_CILX_STATUS);
		dev_dbg(chan->csi->dev,
			"TEGRA_CSI_CILX_STATUS 0x%08x\n", val);
	}
}

[ 35.044036] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 0
[ 35.052616] video4linux video0: [harrison]TEGRA_VI_CSI_ERROR_STATUS 0x00000001
[ 35.060007] vi 54080000.vi: TEGRA_CSI_PIXEL_PARSER_STATUS 0x00004015
[ 35.066563] vi 54080000.vi: TEGRA_CSI_CIL_STATUS 0x00000000
[ 35.073509] vi 54080000.vi: TEGRA_CSI_CILX_STATUS 0x00000000
[ 35.094000] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 1
[ 35.101099] video4linux video0: [harrison]TEGRA_VI_CSI_ERROR_STATUS 0x00000001
[ 35.108428] vi 54080000.vi: TEGRA_CSI_PIXEL_PARSER_STATUS 0x00004015
[ 35.114818] vi 54080000.vi: TEGRA_CSI_CIL_STATUS 0x00000000
[ 35.120458] vi 54080000.vi: TEGRA_CSI_CILX_STATUS 0x00000000
[ 35.127255] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 2
[ 35.135226] video4linux video0: [harrison]TEGRA_VI_CSI_ERROR_STATUS 0x00000001
[ 35.142453] vi 54080000.vi: TEGRA_CSI_PIXEL_PARSER_STATUS 0x00004015
[ 35.149950] vi 54080000.vi: TEGRA_CSI_CIL_STATUS 0x00000000
[ 35.155537] vi 54080000.vi: TEGRA_CSI_CILX_STATUS 0x00000000
[ 35.177218] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 3
[ 35.184028] video4linux video0: [harrison]TEGRA_VI_CSI_ERROR_STATUS 0x00000001
[ 35.191265] vi 54080000.vi: TEGRA_CSI_PIXEL_PARSER_STATUS 0x00004015
[ 35.197627] vi 54080000.vi: TEGRA_CSI_CIL_STATUS 0x00000000
[ 35.203266] vi 54080000.vi: TEGRA_CSI_CILX_STATUS 0x00000000
[ 35.210498] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 4
[ 35.217521] video4linux video0: [harrison]TEGRA_VI_CSI_ERROR_STATUS 0x00000001
[ 35.225052] vi 54080000.vi: TEGRA_CSI_PIXEL_PARSER_STATUS 0x00004015
[ 35.231506] vi 54080000.vi: TEGRA_CSI_CIL_STATUS 0x00000000
[ 35.237095] vi 54080000.vi: TEGRA_CSI_CILX_STATUS 0x00000000
[ 35.243886] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 5
[ 35.250692] video4linux video0: [harrison]TEGRA_VI_CSI_ERROR_STATUS 0x00000001
[ 35.258175] vi 54080000.vi: TEGRA_CSI_PIXEL_PARSER_STATUS 0x00004015
[ 35.264580] vi 54080000.vi: TEGRA_CSI_CIL_STATUS 0x00000000
[ 35.270169] vi 54080000.vi: TEGRA_CSI_CILX_STATUS 0x00000000
[ 35.277170] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 6
[ 35.284154] video4linux video0: [harrison]TEGRA_VI_CSI_ERROR_STATUS 0x00000001
[ 35.291439] vi 54080000.vi: TEGRA_CSI_PIXEL_PARSER_STATUS 0x00004015
[ 35.297806] vi 54080000.vi: TEGRA_CSI_CIL_STATUS 0x00000000
[ 35.303479] vi 54080000.vi: TEGRA_CSI_CILX_STATUS 0x00000000
[ 35.310497] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 7
[ 35.317468] video4linux video0: [harrison]TEGRA_VI_CSI_ERROR_STATUS 0x00000001
[ 35.325026] vi 54080000.vi: TEGRA_CSI_PIXEL_PARSER_STATUS 0x00004015
[ 35.331426] vi 54080000.vi: TEGRA_CSI_CIL_STATUS 0x00000000
[ 35.337023] vi 54080000.vi: TEGRA_CSI_CILX_STATUS 0x00000000
[ 35.343862] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 8
[ 35.350868] video4linux video0: [harrison]TEGRA_VI_CSI_ERROR_STATUS 0x00000001
[ 35.358320] vi 54080000.vi: TEGRA_CSI_PIXEL_PARSER_STATUS 0x00004015
[ 35.364775] vi 54080000.vi: TEGRA_CSI_CIL_STATUS 0x00000000
[ 35.370371] vi 54080000.vi: TEGRA_CSI_CILX_STATUS 0x00000000
[ 35.377184] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 9
[ 35.384081] video4linux video0: [harrison]TEGRA_VI_CSI_ERROR_STATUS 0x00000001
[ 35.391398] vi 54080000.vi: TEGRA_CSI_PIXEL_PARSER_STATUS 0x00004015
[ 35.397803] vi 54080000.vi: TEGRA_CSI_CIL_STATUS 0x00000000
[ 35.403510] vi 54080000.vi: TEGRA_CSI_CILX_STATUS 0x00000000
[ 35.410519] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 10

Looks like there are short line and playload crc error. You may need to confirm with the vendor for output size and output signal is match MIPI spec.

You can check the TRM to get the detail information for the “CSI_PIXEL_PARSER_STATUS”

I have two more questions:
1 Can you provide download address for TRM, I can’t find the register datasheet.
2 Which parameters need to be matched MIPI spec? Is there any description document?

TKS!

Download the document from below link.