Unable to get /dev/video* handle for imx477 camera

Hello all,

Current setup:
Jetson xavier Nx SOM (16gb emmc -production module) - custom carrier board
Linux : jetson linux 35.4.1 (jetpack 5.1.2)
Camera : arducam imx 477

I am trying to interface the imx477 arducam camera with jetson xavier nx. The custom board is similar to developer kit. I have modified the dts file for imx477 in the dts file. I have attached the dts file with this thread.
tegra194-p3668-0001-p3509-0000_dts.txt (375.2 KB)

	tegra-camera-platform {
		compatible = "nvidia, tegra-camera-platform";
		num_csi_lanes = <0x04>;
		max_lane_speed = <0x16e360>;
		min_bits_per_pixel = <0x0a>;
		vi_peak_byte_per_pixel = <0x02>;
		vi_bw_margin_pct = <0x19>;
		max_pixel_rate = <0x3a980>;
		isp_peak_byte_per_pixel = <0x05>;
		isp_bw_margin_pct = <0x19>;
		phandle = <0x465>;

		modules {

			module0 {
				badge = "jakku_front_IMX477";
				position = "front";
				orientation = [31 00];
				phandle = <0x466>;

				drivernode0 {
					pcl_id = "v4l2_sensor";
					devname = "imx477 2-001a";
					proc-device-tree = "/proc/device-tree/i2c@3180000/rbpcv3_imx477_a@1a";
				};
			};
		};
	};

		rbpcv3_imx477_a@1a {
			compatible = "ridgerun,imx477";
			reg = <0x1a>;
			devnode = "video0";
			physical_w = "3.680";
			physical_h = "2.760";
			sensor_model = "imx477";
			use_sensor_mode_id = "true";
			reset-gpios = <0x0c 0x7c 0x00>;
			phandle = <0x45f>;

			mode0 {
				mclk_khz = "24000";
				num_lanes = [32 00];
				tegra_sinterface = "serial_a";
				phy_mode = "DPHY";
				discontinuous_clk = "no";
				dpcm_enable = "false";
				cil_settletime = [30 00];
				active_w = "3840";
				active_h = "2160";
				mode_type = "bayer";
				pixel_phase = "rggb";
				csi_pixel_bit_depth = "10";
				readout_orientation = "90";
				line_length = "11200";
				inherent_gain = [31 00];
				mclk_multiplier = "80";
				pix_clk_hz = "300000000";
				gain_factor = "16";
				framerate_factor = "1000000";
				exposure_factor = "1000000";
				min_gain_val = "16";
				max_gain_val = "356";
				step_gain_val = [31 00];
				default_gain = "16";
				min_hdr_ratio = [31 00];
				max_hdr_ratio = [31 00];
				min_framerate = "2000000";
				max_framerate = "30000000";
				step_framerate = [31 00];
				default_framerate = "30000000";
				min_exp_time = "13";
				max_exp_time = "683709";
				step_exp_time = [31 00];
				default_exp_time = "2495";
				embedded_metadata_height = [32 00];
			};

			mode1 {
				mclk_khz = "24000";
				num_lanes = [32 00];
				tegra_sinterface = "serial_a";
				phy_mode = "DPHY";
				discontinuous_clk = "no";
				dpcm_enable = "false";
				cil_settletime = [30 00];
				active_w = "1920";
				active_h = "1080";
				mode_type = "bayer";
				pixel_phase = "rggb";
				csi_pixel_bit_depth = "10";
				readout_orientation = "90";
				line_length = "7000";
				inherent_gain = [31 00];
				mclk_multiplier = "80";
				pix_clk_hz = "300000000";
				gain_factor = "16";
				framerate_factor = "1000000";
				exposure_factor = "1000000";
				min_gain_val = "16";
				max_gain_val = "356";
				step_gain_val = [31 00];
				default_gain = "16";
				min_hdr_ratio = [31 00];
				max_hdr_ratio = [31 00];
				min_framerate = "2000000";
				max_framerate = "60000000";
				step_framerate = [31 00];
				default_framerate = "60000000";
				min_exp_time = "13";
				max_exp_time = "683709";
				step_exp_time = [31 00];
				default_exp_time = "2495";
				embedded_metadata_height = [32 00];
			};

			ports {
				#address-cells = <0x01>;
				#size-cells = <0x00>;

				port@0 {
					reg = <0x00>;

					endpoint {
						port-index = <0x00>;
						bus-width = <0x02>;
						remote-endpoint = <0x28>;
						phandle = <0x267>;
					};
				};
			};
		};
	};

		nvcsi@15a00000 {
			compatible = "nvidia,tegra194-nvcsi";
			clocks = <0x04 0x51>;
			clock-names = "nvcsi";
			num-channels = <0x01>;
			#address-cells = <0x01>;
			#size-cells = <0x00>;
			phandle = <0x23c>;

			prod-settings {
				#prod-cells = <0x04>;

				prod {
					prod = <0x00 0x11018 0x70000 0x20000 0x00 0x1109c 0xe000e000 0xc000c000 0x00 0x110a8 0xfefe 0x4c4c 0x00 0x11128 0xe000e000 0xc000c000 0x00 0x11134 0xfefe 0x4c4c 0x00 0x21018 0x70000 0x20000 0x00 0x2109c 0xe000e000 0xc000c000 0x00 0x210a8 0xfefe 0x4c4c 0x00 0x21128 0xe000e000 0xc000c000 0x00 0x21134 0xfefe 0x4c4c 0x00 0x31018 0x70000 0x20000 0x00 0x3109c 0xe000e000 0xc000c000 0x00 0x310a8 0xfefe 0x4c4c 0x00 0x31128 0xe000e000 0xc000c000 0x00 0x31134 0xfefe 0x4c4c 0x00 0x41018 0x70000 0x20000 0x00 0x4109c 0xe000e000 0xc000c000 0x00 0x410a8 0xfefe 0x4c4c 0x00 0x41128 0xe000e000 0xc000c000 0x00 0x41134 0xfefe 0x4c4c 0x00 0x1102c 0xfc000000 0xe0000000 0x00 0x110b8 0xfc000000 0xe0000000 0x00 0x2102c 0xfc000000 0xe0000000 0x00 0x210b8 0xfc000000 0xe0000000 0x00 0x3102c 0xfc000000 0xe0000000 0x00 0x310b8 0xfc000000 0xe0000000 0x00 0x4102c 0xfc000000 0xe0000000 0x00 0x410b8 0xfc000000 0xe0000000>;
				};

				prod_c_cphy_mode {
					prod = <0x00 0x11030 0x7f7f7f 0x444444 0x00 0x110bc 0x7f7f7f 0x444444 0x00 0x21030 0x7f7f7f 0x444444 0x00 0x210bc 0x7f7f7f 0x444444 0x00 0x31030 0x7f7f7f 0x444444 0x00 0x310bc 0x7f7f7f 0x444444 0x00 0x41030 0x7f7f7f 0x444444 0x00 0x410bc 0x7f7f7f 0x444444 0x00 0x110a8 0xffff 0xfcfc 0x00 0x1109c 0xffffffff 0xd848d848 0x00 0x110a0 0x03 0x00 0x00 0x11098 0x03 0x03 0x00 0x11134 0xffff 0xfcfc 0x00 0x11128 0xffffffff 0xd848d848 0x00 0x1112c 0x03 0x00 0x00 0x11124 0x03 0x03 0x00 0x210a8 0xffff 0xfcfc 0x00 0x2109c 0xffffffff 0xd848d848 0x00 0x210a0 0x03 0x00 0x00 0x21098 0x03 0x03 0x00 0x21134 0xffff 0xfcfc 0x00 0x21128 0xffffffff 0xd848d848 0x00 0x2112c 0x03 0x00 0x00 0x21124 0x03 0x03 0x00 0x310a8 0xffff 0xfcfc 0x00 0x3109c 0xffffffff 0xd848d848 0x00 0x310a0 0x03 0x00 0x00 0x31098 0x03 0x03 0x00 0x31134 0xffff 0xfcfc 0x00 0x31128 0xffffffff 0xd848d848 0x00 0x3112c 0x03 0x00 0x00 0x31124 0x03 0x03 0x00 0x410a8 0xffff 0xfcfc 0x00 0x4109c 0xffffffff 0xd848d848 0x00 0x410a0 0x03 0x00 0x00 0x41098 0x03 0x03 0x00 0x41134 0xffff 0xfcfc 0x00 0x41128 0xffffffff 0xd848d848 0x00 0x4112c 0x03 0x00 0x00 0x41124 0x03 0x03>;
				};

				prod_c_dphy_mode {
					prod = <0x00 0x11030 0x7f7f7f 0x00 0x00 0x110bc 0x7f7f7f 0x00 0x00 0x21030 0x7f7f7f 0x00 0x00 0x210bc 0x7f7f7f 0x00 0x00 0x31030 0x7f7f7f 0x00 0x00 0x310bc 0x7f7f7f 0x00 0x00 0x41030 0x7f7f7f 0x00 0x00 0x410bc 0x7f7f7f 0x00>;
				};
			};

			channel@0 {
				reg = <0x00>;

				ports {
					#address-cells = <0x01>;
					#size-cells = <0x00>;

					port@0 {
						reg = <0x00>;

						endpoint@0 {
							port-index = <0x00>;
							bus-width = <0x02>;
							remote-endpoint = <0x267>;
							phandle = <0x2b8>;
						};
					};

					port@1 {
						reg = <0x01>;

						endpoint@1 {
							remote-endpoint = <0x268>;
							phandle = <0x247>;
						};
					};
				};
			};
		};

In the dmesg i get no errors with respect video/camera/dev handle . Below is what my dmesg looks like with respect to camera . I have attached the full dmesg in below text file.
dmesg_full_logs2_21_06_24.txt (67.7 KB)

nvidia@ubuntu:~$ sudo dmesg | grep -i i2c
[    2.954116] i2c /dev entries driver
[    2.957497] tegra-i2c 3160000.i2c: Adding to iommu group 2
[    2.962997] tegra-i2c c240000.i2c: Adding to iommu group 2
[    2.968642] tegra-i2c 3180000.i2c: Adding to iommu group 2
[    2.974011] tegra-i2c 3190000.i2c: Adding to iommu group 2
[    2.979363] tegra-i2c 31b0000.i2c: Adding to iommu group 2
[    2.984648] tegra-i2c 31c0000.i2c: Adding to iommu group 2
[    2.990276] tegra-i2c c250000.i2c: Adding to iommu group 2
[    7.444279] tegra-i2c 31e0000.i2c: Adding to iommu group 2

nvidia@ubuntu:~$ sudo dmesg | grep -i imx477
[   12.174692] imx477 2-001a: tegracam sensor driver:imx477_v2.0.6

nvidia@ubuntu:~$ sudo dmesg | grep -i video
[    0.000000] Kernel command line: root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyTCU0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 video=efifb:off nospectre_bhb nv-auto-config 
[    0.403888] videodev: Linux video capture interface: v2.00

nvidia@ubuntu:~$ sudo dmesg | grep -i camera
[    4.383857] tegra186-cam-rtcpu bc00000.rtcpu: using cam RTCPU IRQ (50)
[    4.384079] tegra186-cam-rtcpu bc00000.rtcpu: tegra_camrtc_mon_create is successful
[    4.386480] tegra186-cam-rtcpu bc00000.rtcpu: firmware version cpu=rce cmd=6 sha1=058eec606b43624552a5258fda5b4f3967bdfde1

nvidia@ubuntu:/lib/modules$ sudo media-ctl -p -d /dev/media0 ? media_ctl.txt
Media controller API version 5.10.120

Media device information
------------------------
driver          tegra-camrtc-ca
model           NVIDIA Tegra Video Input Device
serial          
bus info        
hw revision     0x3
driver version  5.10.120

Device topology
- entity 1: imx477 2-001a (1 pad, 0 link)
            type V4L2 subdev subtype Sensor flags 0
	pad0: Source


Verified hardware connections. Even though there are no any errors as such in dmesg boot messges but still i am not able to get the /video handle in /dev/ . Does anyone has any suggestions/idea what might be going wrong.

hello dxt,

did you Configuring the CSI Connector to enable IMX477?

Thanks for the response @JerryChang

No i did not do that , is it mandatory ?

Because i am configuring the same things in the dts file, so still is it needed?

hello dxt,

it’s mandatory by using developer kits.
I assume you’re flashing Jetpack release image directly, it’s by default to detect IMX219 camera sensors.
so, you may double check the complete kernel logs for the probing messages.

I am using the custom board. so i hope configuring the csi connector is not mandoatory here.

Well, now i am able to get the video0 handle in the /dev/

But when i do nvgstcapture-1.0 i am able to preview the camera.
But if i try to run a gstreamer command gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! autovideosink
i get the error as below:

nvidia@ubuntu:~$ gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! autovideosink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
gstbasesrc.c(3072): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

For anyone who may face the same issue with respect to not getting the video0 handle in the /dev/:
In the above given dts file there is cam_i2cmux node which is intended to use when there are two camera imx219 and imx477.In my case i am using the imx477 only. So try to move the rbpcv3_imx477_a@1a node directly under the i2c@3180000 controller node which is initilzed to cam_i2c . Also register this driver node in the tegra-camera-platform node.

i have a question here , i wonder what if i was using both the camera , then i should be using the cam_i2cmux node itself right ?

you cannot use v4l2src since it’s a bayer sensor.
anyways, please refer to Applications Using V4L2 IOCTL Directly to use V4L2 IOCTL to verify basic camera functionality.

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