IMX568c Camera does not open in Jetson Orin Nano

You can also see the issue under the camera driver repo.
Some links are shortened because of the link limit.
I tried setting up the driver for IMX568c camera but keep getting error or black image.
Here are the steps I followed:
In x86 ubuntu 20.08 host;
1- Clone your driver repo
2- Switch to jetson-orin-nano branch
3- Run ./quickstart.sh
4- Edit the device tree for imx568c as

/*
 * Copyright (c) 2023, Vision Components GmbH.  All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <dt-bindings/media/camera.h>

// ------------------------------------------------------------------------------------------------
//  Driver Configuration for NVIDIA Jetson Orin Nano on NVIDIA Jetson Orin Nano Developer Kit
// ------------------------------------------------------------------------------------------------
#define VC_MIPI_CAM_1       1   // 1: Enabled, 0: Disabled  (serial_a => CSI Port 0 => VI Stream 0)
#define VC_MIPI_CAM_0       1   // 1: Enabled, 0: Disabled  (serial_c => CSI Port 2 => VI Stream 2)
// ------------------------------------------------------------------------------------------------
//  Supported number of lanes
// -----+------------------------------------------------------------------------------------------
//  1   | OV7251, IMX296, IMX297
//  2   | OV9281, IMX264, IMX265
//  2,4 | IMX178, IMX183, IMX226, IMX250, IMX252, IMX273, IMX290, IMX327, IMX335, IMX392, 
//      | IMX412, IMX415, IMX568
// -----+------------------------------------------------------------------------------------------
#define VC_MIPI_LANES       2   // 1, 2, 4 Lanes
// ------------------------------------------------------------------------------------------------
//  Embedded Metadata Height
// -----+------------------------------------------------------------------------------------------
//  0   | IMX178, IMX183, IMX226, IMX250, IMX252, IMX264, IMX265, IMX273, IMX392, OV7251, OV9281
//  1   | IMX290, IMX327, IMX335, IMX415, IMX462
//  2   | IMX296, IMX297, IMX412
//  4   | IMX565, IMX566, IMX567, IMX568
// -----+------------------------------------------------------------------------------------------
#define VC_MIPI_METADATA_H  "4" // "0", "1", "2", "4" Lines of meta data
// ------------------------------------------------------------------------------------------------
//   Sensor Manufacturer
// -----+------------------------------------------------------------------------------------------
//   1  | Sony Sensor (IMX)
//   2  | Omni Vision Sensor (OV)
// -----+------------------------------------------------------------------------------------------
#define VC_MIPI_MANUFACTURER 1
// ------------------------------------------------------------------------------------------------
//  GStreamer Support
// ------------------------------------------------------------------------------------------------
//  If you want to use GStreamer with nvarguscamerasrc you have to adjust this settings in the 
//  device tree below. The sections which have to be modified are marked by a comment. 
//  To find the correct parameter values please follow the instruction in the main README.md of 

// ------------------------------------------------------------------------------------------------

#if VC_MIPI_LANES == 1
    #define BUS_WIDTH 1
    #define NUM_LANES "1" 
    #define NUM_CSI_LANES 2
	#define PIX_CLK_HZ "150000000"
#endif
#if VC_MIPI_LANES == 2
    #define BUS_WIDTH 2
    #define NUM_LANES "2" 
    #define NUM_CSI_LANES 4
	#define PIX_CLK_HZ "300000000"
#endif
#if VC_MIPI_LANES == 4
    #define BUS_WIDTH 4
    #define NUM_LANES "4" 
    #define NUM_CSI_LANES 8
	#define PIX_CLK_HZ "600000000"
#endif

#if VC_MIPI_CAM_1 == 1 && VC_MIPI_CAM_0 == 1
    #define VC_MIPI_CAMERAS 2
#else
    #define VC_MIPI_CAMERAS 1
#endif

/ {
	tegra-capture-vi  {
		num-channels = <VC_MIPI_CAMERAS>;
		ports {
			#address-cells = <1>;
			#size-cells = <0>;
#if VC_MIPI_CAM_1 == 1
			vc_vi_port0: port@0 {
				reg = <0>;
				vc_vi_in0: endpoint {
					port-index = <0>;
					bus-width = <BUS_WIDTH>;
					remote-endpoint = <&vc_csi_out0>;
				};
			};
#endif
#if VC_MIPI_CAM_0 == 1
			vc_vi_port1: port@1 {
				reg = <1>;
				vc_vi_in1: endpoint {
					port-index = <2>;
					bus-width = <BUS_WIDTH>;
					remote-endpoint = <&vc_csi_out1>;
				};
			};
#endif
		}; // ports
	};

	host1x@13e00000 {
		nvcsi@15a00000 {
			num-channels = <VC_MIPI_CAMERAS>;
			#address-cells = <1>;
			#size-cells = <0>;
#if VC_MIPI_CAM_1 == 1
			vc_csi_chan0: channel@0 {
				reg = <0>;
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					vc_csi_chan0_port0: port@0 {
						reg = <0>;
						vc_csi_in0: endpoint@0 {
							port-index = <0>;
							bus-width = <BUS_WIDTH>;
							remote-endpoint = <&vc_mipi_out0>;
						};
					};
					vc_csi_chan0_port1: port@1 {
						reg = <1>;
						vc_csi_out0: endpoint@1 {
							remote-endpoint = <&vc_vi_in0>;
						};
					};
				};
			};
#endif
#if VC_MIPI_CAM_0 == 1
			vc_csi_chan1: channel@1 {
				reg = <1>;
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					vc_csi_chan1_port0: port@0 {
						reg = <0>;
						vc_csi_in1: endpoint@2 {
							port-index = <2>;
							bus-width = <BUS_WIDTH>;
							remote-endpoint = <&vc_mipi_out1>;
						};
					};
					vc_csi_chan1_port1: port@1 {
						reg = <1>;
						vc_csi_out1: endpoint@3 {
							remote-endpoint = <&vc_vi_in1>;
						};
					};
				};
			};
#endif
		};
	};

	cam_i2cmux {
#if VC_MIPI_CAM_1 == 1
		i2c@0 {
#if VC_MIPI_MANUFACTURER == 1
			vc_mipi_cam0: vc_mipi@1a {
				reg                     = <0x1a>;
#else
			vc_mipi_cam0: vc_mipi@60 {
				reg                     = <0x60>;
#endif
				compatible              = "nvidia,vc_mipi";
				devnode                 = "video0";
				use_sensor_mode_id      = "false";
				sensor_model            = "vc_mipi";

				num_lanes               = NUM_LANES;
				trigger_mode            = "0";
				io_mode                 = "0";

				// ----------------------------------------------------
				// If you want to use GStreamer with nvarguscamerasrc
				// you have to adjust this settings
				physical_w              = "6.752";
				physical_h              = "5.612";
				// ----------------------------------------------------

				// This node is needed by the Tegra framework.
				// You don't have to change any settings if just want 
				// to use the V4L API.
				mode0 {
					num_lanes                = NUM_LANES;
					tegra_sinterface         = "serial_a";
					embedded_metadata_height = VC_MIPI_METADATA_H;
					readout_orientation      = "0";
					lane_polarity            = "0";

					// ----------------------------------------------------
					// If you want to use GStreamer with nvarguscamerasrc
					// you have to adjust this settings. 
					active_l                 = "0";
					active_t                 = "0";
					active_w                 = "2464";
					active_h                 = "2048";
					mode_type                = "bayer";
					pixel_phase              = "rggb";
					csi_pixel_bit_depth      = "10";

					min_gain_val             = "0";         // mdB
					max_gain_val             = "48000";     // mdB
					step_gain_val            = "100";       // mdB
					default_gain             = "0";         // mdB

					min_exp_time             = "1";         // us
					max_exp_time             = "1000000";   // us
					step_exp_time            = "1";         // us
					default_exp_time         = "10000";     // us

					// For applications like argus_camera, there should 
					// be a minimal frame rate greater than zero!
					min_framerate            = "100";       // mHz
					max_framerate            = "78800";     // mHz
					step_framerate           = "100";       // mHz
					default_framerate        = "60000";     // mHz
					// ----------------------------------------------------

					gain_factor              = "1000";
					exposure_factor          = "1000000";
					framerate_factor         = "1000";
					inherent_gain            = "1";
					min_hdr_ratio            = "1";
					max_hdr_ratio            = "1";

					line_length              = "0";
					phy_mode                 = "DPHY";
					discontinuous_clk        = "no";
					mclk_khz                 = "24000";
					pix_clk_hz               = PIX_CLK_HZ;
					mclk_multiplier          = "0.0";		// deprecated
					cil_settletime           = "0";
					dpcm_enable              = "false";
				};

				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					port@0 {
						reg = <0>;
						vc_mipi_out0: endpoint {
							port-index = <0>;
							bus-width = <BUS_WIDTH>;
							remote-endpoint = <&vc_csi_in0>;
						};
					};
				};
			};
		};
#endif // VC_MIPI_CAM_1

#if VC_MIPI_CAM_0 == 1
		i2c@1 {
#if VC_MIPI_MANUFACTURER == 1
			vc_mipi_cam1: vc_mipi@1a {
				reg                     = <0x1a>;
#else
			vc_mipi_cam1: vc_mipi@60 {
				reg                     = <0x60>;
#endif
				compatible              = "nvidia,vc_mipi";
				devnode                 = "video1";
				use_sensor_mode_id      = "false";
				sensor_model            = "vc_mipi";

				num_lanes               = NUM_LANES;
				trigger_mode            = "0";
				io_mode                 = "0";

				// ----------------------------------------------------
				// If you want to use GStreamer with nvarguscamerasrc
				// you have to adjust this settings
				physical_w              = "6.752";
				physical_h              = "5.612";
				// ----------------------------------------------------

				// This node is needed by the Tegra framework.
				// You don't have to change any settings if just want 
				// to use the V4L API.
				mode0 {
					num_lanes                = NUM_LANES;
					tegra_sinterface         = "serial_c";
					embedded_metadata_height = VC_MIPI_METADATA_H;
					readout_orientation      = "0";
					lane_polarity            = "0";

					// ----------------------------------------------------
					// If you want to use GStreamer with nvarguscamerasrc
					// you have to adjust this settings. 
					active_l                 = "0";
					active_t                 = "0";
					active_w                 = "2464";
					active_h                 = "2048";
					mode_type                = "bayer";
					pixel_phase              = "rggb";
					csi_pixel_bit_depth      = "10";

					min_gain_val             = "0";         // mdB
					max_gain_val             = "48000";     // mdB
					step_gain_val            = "100";       // mdB
					default_gain             = "0";         // mdB

					min_exp_time             = "1";         // us
					max_exp_time             = "1000000";   // us
					step_exp_time            = "1";         // us
					default_exp_time         = "10000";     // us

					// For applications like argus_camera, there should 
					// be a minimal frame rate greater than zero!
					min_framerate            = "100";       // mHz
					max_framerate            = "78800";     // mHz
					step_framerate           = "100";       // mHz
					default_framerate        = "60000";     // mHz
					// ----------------------------------------------------

					gain_factor              = "1000";
					exposure_factor          = "1000000";
					framerate_factor         = "1000";
					inherent_gain            = "1";
					min_hdr_ratio            = "1";
					max_hdr_ratio            = "1";

					line_length              = "0";
					phy_mode                 = "DPHY";
					discontinuous_clk        = "no";
					mclk_khz                 = "24000";
					pix_clk_hz               = PIX_CLK_HZ;
					mclk_multiplier          = "0.0";		// deprecated
					cil_settletime           = "0";
					dpcm_enable              = "false";
				};

				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					port@0 {
						reg = <0>;
						vc_mipi_out1: endpoint {
							port-index = <2>;
							bus-width = <BUS_WIDTH>;
							remote-endpoint = <&vc_csi_in1>;
						};
					};
				};
			};
		};
#endif // VC_MIPI_CAM_0
	};

	lens@vc_mipi {
		min_focus_distance  = "0.0";
		hyper_focal         = "0.0";
		focal_length        = "6.0";
		f_number            = "2.0";
		aperture            = "0.0";
	};
};

/ {
	tcp: tegra-camera-platform {
		compatible = "nvidia, tegra-camera-platform";

		num_csi_lanes = <NUM_CSI_LANES>;
		max_lane_speed = <1500000>;
		min_bits_per_pixel = <10>;
		vi_peak_byte_per_pixel = <2>;
		vi_bw_margin_pct = <25>;
		max_pixel_rate = <240000>;
		isp_peak_byte_per_pixel = <5>;
		isp_bw_margin_pct = <25>;

		modules {
#if VC_MIPI_CAM_1 == 1
			cam_module0: module0 {
				badge = "jakku_front_vc_mipi";
				position = "front";
				orientation = "1";
				cam_module0_drivernode0: drivernode0 {
					pcl_id = "v4l2_sensor";
#if VC_MIPI_MANUFACTURER == 1
					devname = "vc_mipi 9-001a";
					proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@0/vc_mipi@1a";
#else
					devname = "vc_mipi 9-0060";
					proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@0/vc_mipi@60";
#endif
				};
				cam_module0_drivernode1: drivernode1 {
					pcl_id = "v4l2_lens";
					proc-device-tree = "/proc/device-tree/lens@vc_mipi/";
				};
			};
#endif // VC_MIPI_CAM_1
			
#if VC_MIPI_CAM_0 == 1
			cam_module1: module1 {
				badge = "jakku_rear_vc_mipi";
				position = "rear";
				orientation = "1";
				cam_module1_drivernode0: drivernode0 {
					pcl_id = "v4l2_sensor";
#if VC_MIPI_MANUFACTURER == 1
					devname = "vc_mipi 10-001a";
					proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@1/vc_mipi@1a";
#else
					devname = "vc_mipi 10-0060";
					proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@1/vc_mipi@60";
#endif	
				};
				cam_module1_drivernode1: drivernode1 {
					pcl_id = "v4l2_lens";
					proc-device-tree = "/proc/device-tree/lens@vc_mipi/";
				};
			};
#endif // VC_MIPI_CAM_0
		};
	};
};

#define CAM0_PWDN	TEGRA234_MAIN_GPIO(H, 6)
#define CAM1_PWDN	TEGRA234_MAIN_GPIO(AC, 0)
#define CAM_I2C_MUX 	TEGRA234_AON_GPIO(CC, 3)

/ {
	cam_i2cmux {
		status = "okay";
		compatible = "i2c-mux-gpio";
		#address-cells = <1>;
		#size-cells = <0>;
		mux-gpios = <&tegra_aon_gpio CAM_I2C_MUX GPIO_ACTIVE_HIGH>;
		i2c-parent = <&cam_i2c>;
#if VC_MIPI_CAM_1 == 1
		i2c@0 {
			status = "okay";
			reg = <0>;
			#address-cells = <1>;
			#size-cells = <0>;
#if VC_MIPI_MANUFACTURER == 1
			vc_mipi@1a {
#else
			vc_mipi@60 {
#endif
				reset-gpios = <&tegra_main_gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;
			};
		};
#endif
#if VC_MIPI_CAM_0 == 1
		i2c@1 {
			status = "okay";
			reg = <1>;
			#address-cells = <1>;
			#size-cells = <0>;
#if VC_MIPI_MANUFACTURER == 1
			vc_mipi@1a {
#else
            		vc_mipi@60 {
#endif
				reset-gpios = <&tegra_main_gpio CAM1_PWDN GPIO_ACTIVE_HIGH>;
			};
		};
#endif
	};

	gpio@2200000 {
		camera-control-output-low {
			gpio-hog;
			output-low;
			gpios = <CAM0_PWDN 0 CAM1_PWDN 0>;
			label = "cam0-pwdn","cam1-pwdn";
		};
	};
};

5- It fails at first with error 'md5sum: Jetson_Linux_R35.3.1_aarch64.tbz2: No such file or directory Jetson_Linux_R35.3.1_aarch64.tbz2: FAILED open or read md5sum: WARNING: 1 listed file could not be read'., so I download the necessary files to build/Xavier35.3.1/downloads/ for Jetson 35.3.1 from page https://developer.nvidia.com/embedded/jetson-linux-r3531
I opened the bash scripts, followed the flow and saw these in vc_mipi_nvidia/bin/config/L4T/R35.3.1.sh at 9-support-for-jetson-orin-nano · VC-MIPI-modules/vc_mipi_nvidia · GitHub. . But the url in the script is developer.nvidia.com/downloads/embedded/l4t/r35_release_v3.1 so changing url solves this issue
6- Run quickstart.sh again and this time it runs successfully in around 2 hours.
7- Go to /target and run $ sudo ./max_speed.sh

Demo Repo

I tried running the first 3 steps both on host and target
Rest is run only on target
1- Clone the demo repo github/VC-MIPI-modules/vc_mipi_demo
2- Run ./setup.sh --host
3- Run $ ./build.sh --all
4- Run # v4l2-ctl --set-fmt-video=pixelformat=RG10,width=3840,height=3040
I also tried setting it with 2464x2048 too.
5- I can see the device from v4l2-ctl --list-devices as

NVIDIA Tegra Video Input Device (platform:tegra-camrtc-ca):
/dev/media0

vi-output, vc_mipi 9-001a (platform:tegra-capture-vi:1):
/dev/video0

6- The output

 vc@nvidia:~$ v4l2-ctl --list-formats
ioctl: VIDIOC_ENUM_FMT

	Type: Video Capture
[0]: 'RG10' (10-bit Bayer RGRG/GBGB)

7- Also output

vc@nvidia:~$ v4l2-ctl -d /dev/video0 --all
Driver Info:
	Driver name      : tegra-video
	Card type        : vi-output, vc_mipi 9-001a
	Bus info         : platform:tegra-capture-vi:1
	Driver version   : 5.10.104
	Capabilities     : 0x84200001
		Video Capture
		Streaming
		Extended Pix Format
		Device Capabilities
	Device Caps      : 0x04200001
		Video Capture
		Streaming
		Extended Pix Format
Media Driver Info:
	Driver name      : tegra-camrtc-ca
	Model            : NVIDIA Tegra Video Input Device
	Serial           : 
	Bus info         : 
	Media version    : 5.10.104
	Hardware revision: 0x00000003 (3)
	Driver version   : 5.10.104
Interface Info:
	ID               : 0x0300000b
	Type             : V4L Video
Entity Info:
	ID               : 0x00000009 (9)
	Name             : vi-output, vc_mipi 9-001a
	Function         : V4L2 I/O
	Pad 0x0100000a   : 0: Sink
	  Link 0x0200000f: from remote pad 0x1000003 of entity '13e40000.host1x:nvcsi@15a00000-': Data, Enabled
Priority: 2
Video input : 0 (Camera 1: no power)
Format Video Capture:
	Width/Height      : 640/480
	Pixel Format      : 'YUYV'
	Field             : None
	Bytes per Line    : 1280
	Size Image        : 614400
	Colorspace        : sRGB
	Transfer Function : Default (maps to sRGB)
	YCbCr/HSV Encoding: Default (maps to ITU-R 601)
	Quantization      : Default (maps to Limited Range)
	Flags             : 
Selection Video Capture: crop, Left 0, Top 0, Width 640, Height 480, Flags: 
Selection Video Output: crop, Left 0, Top 0, Width 640, Height 480, Flags: 

Camera Controls

                     group_hold 0x009a2003 (bool)   : default=0 value=0 flags=execute-on-write
                    sensor_mode 0x009a2008 (int64)  : min=0 max=1 step=1 default=0 value=0 flags=slider
                           gain 0x009a2009 (int64)  : min=0 max=48000 step=100 default=0 value=0 flags=slider
                       exposure 0x009a200a (int64)  : min=1 max=148226464 step=1 default=10000 value=1 flags=slider
                     frame_rate 0x009a200b (int64)  : min=0 max=51778 step=1 default=0 value=100 flags=slider
                   trigger_mode 0x009a200e (int)    : min=0 max=7 step=1 default=0 value=0
                        io_mode 0x009a200f (int)    : min=0 max=5 step=1 default=0 value=0
                    black_level 0x009a2010 (int)    : min=0 max=100000 step=1 default=0 value=0
                 single_trigger 0x009a2011 (button) : flags=write-only, execute-on-write
           sensor_configuration 0x009a2032 (u32)    : min=0 max=4294967295 step=1 default=0 [22] flags=read-only, volatile, has-payload
         sensor_mode_i2c_packet 0x009a2033 (u32)    : min=0 max=4294967295 step=1 default=0 [1026] flags=read-only, volatile, has-payload
      sensor_control_i2c_packet 0x009a2034 (u32)    : min=0 max=4294967295 step=1 default=0 [1026] flags=read-only, volatile, has-payload
                    bypass_mode 0x009a2064 (intmenu): min=0 max=1 default=0 value=0
				0: 0 (0x0)
				1: 1 (0x1)
                override_enable 0x009a2065 (intmenu): min=0 max=1 default=0 value=0
				0: 0 (0x0)
				1: 1 (0x1)
                   height_align 0x009a2066 (int)    : min=1 max=16 step=1 default=1 value=1
                     size_align 0x009a2067 (intmenu): min=0 max=2 default=0 value=0
				0: 1 (0x1)
				1: 65536 (0x10000)
				2: 131072 (0x20000)
               write_isp_format 0x009a2068 (int)    : min=1 max=1 step=1 default=1 value=1
       sensor_signal_properties 0x009a2069 (u32)    : min=0 max=4294967295 step=1 default=0 [30][18] flags=read-only, has-payload
        sensor_image_properties 0x009a206a (u32)    : min=0 max=4294967295 step=1 default=0 [30][18] flags=read-only, has-payload
      sensor_control_properties 0x009a206b (u32)    : min=0 max=4294967295 step=1 default=0 [30][36] flags=read-only, has-payload
              sensor_dv_timings 0x009a206c (u32)    : min=0 max=4294967295 step=1 default=0 [30][16] flags=read-only, has-payload
               low_latency_mode 0x009a206d (bool)   : default=0 value=0
               preferred_stride 0x009a206e (int)    : min=0 max=65535 step=1 default=0 value=0
                   sensor_modes 0x009a2082 (int)    : min=0 max=30 step=1 default=30 value=1 flags=read-only

7- Then I am trying different things to capture image but all of them either gets error or returns black image.

Possible problems might be:

  • Jetson 35.3.1 Driver files are outdated in your repo but I downloaded them manually and still does not work
  • My device tree file has something wrong but then would it be appeared under /dev
  • Something outdated in the bash scripts

Connect single camera?
Try connect to another port to verify.

Thanks

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.