Arducam B0250 IMX477 or CSI on Jetson Nano or NX

Hi,

I’ve noticed that there is support in the kernel patches of Jetson balena-jetson/jetson-dtbs.bb at master · balena-os/balena-jetson · GitHub

And i’m testing with a standard raspberry pi CSI camera

Sadly enough i’ve noticed its impossible to install the driver that is deliverd out-of-the-box due that it patches the kernel. I don’t think its possible to do this from a container isn’t it?

I’ve tested it on the v2.98.12 on a jetson nano 2gb . Nothing was detected according to dmesg and no /dev/video0 became visible on host.
After this i’ve moved to the NX v2.107.10 which didn’t recognize the CSI cam and recognized the arducam, but no /dev/video* on host. Are there any known issues with kernel patches? And are /dev/video* visible without the nvargus-daemon?

I’ve done some digging and found a list of dtb files in their installer.

The following DTS file i’ve decompiled from their deb file called Camera_IMX477-A_and_Arducam-B.dtb which sounds like the one I need. I’m compiling now the yocto with this one added to see if this has a good result.

/dts-v1/;

/ {
	overlay-name = "Camera IMX477-A and Arducam-B";
	jetson-header-name = "Jetson Nano CSI Connector";
	compatible = "nvidia,p3449-0000-b00+p3448-0000-b00\0nvidia,p3449-0000-b00+p3448-0002-b00";

	fragment@0 {
		target = <0xffffffff>;

		__overlay__ {
			status = "okay";
		};
	};

	fragment@1 {
		target = <0xffffffff>;

		__overlay__ {
			status = "okay";
			badge = "porg_front_RBPCV3";
			position = "front";
			orientation = [31 00];
		};
	};

	fragment@2 {
		target = <0xffffffff>;

		__overlay__ {
			status = "okay";
			pcl_id = "v4l2_sensor";
			devname = "arducam 8-000c";
			proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@1/arducam_e@0c";
		};
	};

	fragment@3 {
		target = <0xffffffff>;

		__overlay__ {
			status = "okay";
		};
	};

	fragment@4 {
		target = <0xffffffff>;

		__overlay__ {
			status = "okay";
			badge = "porg_rear_RBPCV2";
			position = "rear";
			orientation = [31 00];
		};
	};

	fragment@5 {
		target = <0xffffffff>;

		__overlay__ {
			status = "okay";
			pcl_id = "v4l2_sensor";
			devname = "imx477 7-001a";
			proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@0/rbpcv3_imx477_a@1a";
		};
	};

	fragment@6 {
		target = <0xffffffff>;

		__overlay__ {
			status = "disabled";
		};
	};

	fragment@7 {
		target = <0xffffffff>;

		__overlay__ {
			status = "okay";
			port-index = <0x04>;
			bus-width = <0x02>;
			remote-endpoint = <0xffffffff>;
		};
	};

	fragment@8 {
		target = <0xffffffff>;

		__overlay__ {
			status = "okay";
			port-index = <0x00>;
			bus-width = <0x02>;
			remote-endpoint = <0xffffffff>;
		};
	};

	fragment@9 {
		target = <0xffffffff>;

		__overlay__ {
			status = "okay";
			port-index = <0x04>;
			bus-width = <0x02>;
			remote-endpoint = <0xffffffff>;
		};
	};

	fragment@10 {
		target = <0xffffffff>;

		__overlay__ {
			status = "okay";
		};
	};

	fragment@11 {
		target = <0xffffffff>;

		__overlay__ {
			status = "okay";
			port-index = <0x00>;
			bus-width = <0x02>;
			remote-endpoint = <0xffffffff>;
		};
	};

	fragment@12 {
		target = <0xffffffff>;

		__overlay__ {
			status = "okay";
		};
	};

	fragment@13 {
		target = <0xffffffff>;

		__overlay__ {
			status = "disabled";
		};
	};

	__fixups__ {
		arducam_cam1 = "/fragment@0:target:0";
		cam_module0 = "/fragment@1:target:0";
		cam_module1_drivernode0 = "/fragment@2:target:0";
		imx477_cam0 = "/fragment@3:target:0";
		cam_module1 = "/fragment@4:target:0";
		cam_module0_drivernode0 = "/fragment@5:target:0";
		imx219_cam0 = "/fragment@6:target:0";
		arducam_vi_in1 = "/fragment@7:target:0";
		arducam_csi_out1 = "/fragment@7/__overlay__:remote-endpoint:0\0/fragment@10:target:0";
		rbpcv3_imx477_vi_in0 = "/fragment@8:target:0";
		rbpcv3_imx477_csi_out0 = "/fragment@8/__overlay__:remote-endpoint:0\0/fragment@12:target:0";
		arducam_csi_in1 = "/fragment@9:target:0";
		arducam_out1 = "/fragment@9/__overlay__:remote-endpoint:0";
		rbpcv3_imx477_csi_in0 = "/fragment@11:target:0";
		rbpcv3_imx477_dual_out0 = "/fragment@11/__overlay__:remote-endpoint:0";
		imx219_cam1 = "/fragment@13:target:0";
	};
};

There is an other one called common-arducam.dtb but I don’t expect this one to be relevant to the camera

/dts-v1/;

/ {
	overlay-name = "Camera Arducam";
	jetson-header-name = "Jetson Nano CSI Connector";
	compatible = "nvidia,p3542-0000+p3448-0003\0nvidia,p3449-0000-a02+p3448-0000-a02\0nvidia,p3449-0000-a01+p3448-0000-a01";

	fragment@0 {
		target = <0xffffffff>;

		__overlay__ {
			status = "okay";
		};
	};

	fragment@1 {
		target = <0xffffffff>;

		__overlay__ {
			status = "okay";
			badge = "porg_front_RBPCV3";
			position = "front";
			orientation = [31 00];
		};
	};

	fragment@2 {
		target = <0xffffffff>;

		__overlay__ {
			status = "okay";
			pcl_id = "v4l2_sensor";
			devname = "arducam 6-000c";
			proc-device-tree = "/proc/device-tree/host1x/i2c@546c0000/arducam_a@0c";
		};
	};

	fragment@3 {
		target = <0xffffffff>;

		__overlay__ {
			num-channels = <0x01>;
		};
	};

	fragment@4 {
		target = <0xffffffff>;

		__overlay__ {
			status = "okay";
		};
	};

	fragment@5 {
		target = <0xffffffff>;

		__overlay__ {
			status = "okay";
			port-index = <0x00>;
			bus-width = <0x02>;
			remote-endpoint = <0xffffffff>;
		};
	};

	fragment@6 {
		target = <0xffffffff>;

		__overlay__ {
			num-channels = <0x01>;
		};
	};

	fragment@7 {
		target = <0xffffffff>;

		__overlay__ {
			status = "okay";
		};
	};

	fragment@8 {
		target = <0xffffffff>;

		__overlay__ {
			status = "okay";
		};
	};

	fragment@9 {
		target = <0xffffffff>;

		__overlay__ {
			status = "okay";
			port-index = <0x00>;
			bus-width = <0x02>;
			remote-endpoint = <0xffffffff>;
		};
	};

	fragment@10 {
		target = <0xffffffff>;

		__overlay__ {
			status = "okay";
		};
	};

	fragment@11 {
		target = <0xffffffff>;

		__overlay__ {
			status = "okay";
			remote-endpoint = <0xffffffff>;
		};
	};

	fragment@12 {
		target = <0xffffffff>;

		__overlay__ {
			num_csi_lanes = <0x02>;
			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>;
		};
	};

	fragment@13 {
		target = <0xffffffff>;

		__overlay__ {
			status = "disabled";
		};
	};

	fragment@14 {
		target = <0xffffffff>;

		__overlay__ {
			status = "disabled";
		};
	};

	__fixups__ {
		arducam_single_cam0 = "/fragment@0:target:0";
		cam_module0 = "/fragment@1:target:0";
		cam_module0_drivernode0 = "/fragment@2:target:0";
		vi_base = "/fragment@3:target:0";
		vi_port0 = "/fragment@4:target:0";
		arducam_vi_in0 = "/fragment@5:target:0\0/fragment@11/__overlay__:remote-endpoint:0";
		arducam_csi_out0 = "/fragment@5/__overlay__:remote-endpoint:0\0/fragment@11:target:0";
		csi_base = "/fragment@6:target:0";
		csi_chan0 = "/fragment@7:target:0";
		csi_chan0_port0 = "/fragment@8:target:0";
		arducam_csi_in0 = "/fragment@9:target:0";
		arducam_out0 = "/fragment@9/__overlay__:remote-endpoint:0";
		csi_chan0_port1 = "/fragment@10:target:0";
		tcp = "/fragment@12:target:0";
		imx219_single_cam0 = "/fragment@13:target:0";
		imx477_single_cam0 = "/fragment@14:target:0";
	};
};

Thank you for sharing @neonlink let us know if this works!

I added the dtb to the build. Currently only testing Nano. I had a kernel compile issue, but it was not on a fresh build. Is this the correct way? Comparing balena-os:master...minusplusminus:master · balena-os/balena-jetson · GitHub

Here’s the error. thanks :slight_smile:

WARNING: The BB_DISKMON_DIRS "ABORT" action has been renamed to "HALT", update configuration
Initialising tasks: 100% |####################################################################################################################################################| Time: 0:00:01
Sstate summary: Wanted 55 Local 0 Mirrors 0 Missed 55 Current 1852 (0% match, 97% complete)
NOTE: Executing Tasks
Setscene tasks: 1907 of 1907
ERROR: kernel-modules-headers-1.0-r0 do_compile: ExecutionError('/home/martijn/balena-jetson/build/tmp/work/jetson_nano-poky-linux/kernel-modules-headers/1.0-r0/temp/run.do_compile.1429059', 2, None, None)
ERROR: Logfile of failure stored in: /home/martijn/balena-jetson/build/tmp/work/jetson_nano-poky-linux/kernel-modules-headers/1.0-r0/temp/log.do_compile.1429059
Log data follows:
| DEBUG: Executing shell function do_compile
| Running modules_prepare...
| make[1]: Entering directory '/home/martijn/balena-jetson/build/tmp/work/jetson_nano-poky-linux/kernel-modules-headers/1.0-r0/kernel_modules_headers'
| scripts/kconfig/conf  --silentoldconfig Kconfig
| init/Kconfig:2055: symbol 'MODULES' redefines option 'modules' already defined by symbol 'MODULES'
| init/Kconfig:2055: symbol 'MODULES' redefines option 'modules' already defined by symbol 'MODULES'
| init/Kconfig:2055: symbol 'MODULES' redefines option 'modules' already defined by symbol 'MODULES'
| Kconfig:6: syntax error
| Kconfig:5: invalid statement
| init/Kconfig:2055: symbol 'MODULES' redefines option 'modules' already defined by symbol 'MODULES'
| init/Kconfig:2055: symbol 'MODULES' redefines option 'modules' already defined by symbol 'MODULES'
| init/Kconfig:2055: symbol 'MODULES' redefines option 'modules' already defined by symbol 'MODULES'
| init/Kconfig:2055: symbol 'MODULES' redefines option 'modules' already defined by symbol 'MODULES'
| make[3]: *** [/home/martijn/balena-jetson/build/tmp/work-shared/jetson-nano/kernel-source/scripts/kconfig/Makefile:39: silentoldconfig] Error 1
| make[2]: *** [/home/martijn/balena-jetson/build/tmp/work-shared/jetson-nano/kernel-source/Makefile:575: silentoldconfig] Error 2
| make[1]: Leaving directory '/home/martijn/balena-jetson/build/tmp/work/jetson_nano-poky-linux/kernel-modules-headers/1.0-r0/kernel_modules_headers'
| make[1]: *** No rule to make target 'include/config/auto.conf', needed by 'include/config/kernel.release'.  Stop.
| make: *** [Makefile:170: sub-make] Error 2
| WARNING: exit code 2 from a shell command.