Jetson Nano multi CSI without CAM_I2CMUX

Jetson nano multi CSI without CAM_I2C

Hi, I’m newbie in NVIDIA Forums :-D
I need some help to modify the device tree for bring up custom board

custom board using NANO SOM module
And Using two IMX230.
L4T is 32.3.1

The Hardware engineer Describe the custom board like this.

CAM_I2C :

  • Using device : imx230, thcv242, thcv241
  • CSI_Name : CSI0, CSI1

I2C 1:

  • Using device : imx230, thcv242, thcv241
  • CSI_Name : CSI4

We verify i2c@546c0000(guess it CAM_I2CMUX)
work with imx230 and thcv242 and thcv241.

attach parts of DT

		i2c@546c0000 {
			thcv241@34 {
				status = "okay";
				compatible = "nvidia,thcv241";
				reg = <0x34>;	
			};

			thcv242@0b {
				status = "okay";
				compatible = "nvidia,thcv242";
				reg = <0x0b>;	
			};		
			imx230_single_cam0: rbpcv2_imx230_a@10 {
				compatible = "nvidia,imx230";
				/* 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 = "imx230";

				use_sensor_mode_id = "true";
                                
                               ....

Any guide reference source or document to bringup multi cameras by i2c1?

@kayccc
Thanks to find right tag

hello swkim88888,

just for confirmation.
would you like to have multi-camera with or without i2c multiplexer? how many cameras is your use-case?

@JerryChang
thanks to first comments

I understand, using other i2c multiplexers IC.
We don’t have i2c multiplexer IC on the custom board.
And I want to use 2 cameras connect directly (cam_i2c, i2c-1)
Yepp dual camera with V-by-One connect with thcv242, thcv241.

So I want to use two imx230 each i2c(cam_i2c and i2c-1)

hello swkim88888,

the CAM_I2C interface is connected to the power monitor device on the module which uses I2C address 7’h40
please also check this, Camera Module Hardware Design Guide.

1 Like

Thanks, @JerryChang
We don’t use address 7’h40 in our i2c device(thcv242, thcv241, imx230).

Power monitor device is related to the Camera module and etc I mentioned?
Does it have some problem with bringup dual imx230 by cam_i2c and i2c-1?

Also sadly, we don’t have i2cMUX on our custom board.

hello swkim88888,

Jetson Nano (B01) Developer Kits use a MUX to direct CAM_I2C.
if they’re not sharing the same I2C address, you should instead using direct I2C to communicate with camera modules.

@JerryChang It’s nice !!!

If it is possible,
There are any reference documents or example DT files?​

Or can you give me a hand step by step?

Have a wonderful evening.

hello swkim88888,

since Nano is sharing the architecture with Jetson TX1, you may check this reference driver which used by Jetson TX1 series,
for example,
it’s using dual ov23850 at different i2c address.
$L4T_Sources/r32.6.1/Linux_for_Tegra/source/public/hardware/nvidia/platform/t210/jetson/kernel-dts/jetson-platforms/tegra210-camera-e3323-a00.dtsi

        i2c@546c0000 {
                ov23850_a@10 {

        i2c@7000c000 {
                ov23850_c@36 {
1 Like

Hi, @JerryChang

Thnx to reference source,
I try and give you feedback soon with some code and dmesg.

have a nice weekend.

@JerryChang
Ask about this forum: NANO multi CSI without I2C HUB

I followed this forum before your kindly reply.
And it seems to work and add some log.

DT code is look like this

    cam_i2cmux {
        i2c_0: i2c@0 {
            thcv241@34 {
                status = "okay";
                compatible = "nvidia,thcv241";
                reg = <0x34>;
            };

            thcv242@77 {
                status = "okay";
                compatible = "nvidia,thcv242";
                reg = <0x77>;
            };
            imx230_cam0: rbpcv2_imx230_a@10 {

	...

        GEN_I2C1: i2c@7000c400 {
            thcv241@34 {
                status = "okay";
                compatible = "nvidia,thcv241";
                reg = <0x34>;
            };

            thcv242@0b {
                status = "okay";
                compatible = "nvidia,thcv242";
                reg = <0x0b>;
            };
            imx230_cam1: rbpcv2_imx230_e@10 {
    ...

Device seems to be probe correctly,
But It attached i2c-7. I add only one camera module for test. (cam_i2c line).

It’s my dmesg log to verify device probe correctly. Can you let me know why my device is attached i2c-7, not i2c-6(cam-i2c) ?

And, Verify my work is correct?

nano@localhost:~$ dmesg | grep -E "imx230|thcv"
[    4.857349] thcv241_probe started
[    4.857358] thcv241 1-0034: [thcv241_probe] at addr 0x34
[    4.857405] thcv241 1-0034: detected SerDes transmitter thcv241!
[    4.888565] thcv241 1-0034: thcv241_write_table failed!
[    4.888638] thcv241: probe of 1-0034 failed with error -121
[    4.896484] thcv241_probe started
[    4.896493] thcv241 7-0034: [thcv241_probe] at addr 0x34
[    4.896558] thcv241 7-0034: detected SerDes transmitter thcv241!
[    4.896612] thcv242_probe started
[    4.896618] thcv242 1-000b: [thcv242_probe] at addr 0xb
[    4.896651] thcv242 1-000b: detected SerDes receiver thcv242!
[    4.969135] thcv242 1-000b: thcv242_write_table successed!
[    4.969263] imx230 1-0010: [imx230_probe] probing v4l2 sensor at addr 0x10
[    4.969388] imx230 1-0010: #### [imx230_parse_dt] ended!###
[    4.969413] imx230 1-0010: unable to get clock (null)
[    5.000027] imx230 1-0010: unable to power get
[    5.030534] imx230 1-0010: tegra camera driver registration failed
[    5.038748] imx230: probe of 1-0010 failed with error -14
[    5.096580] thcv241 7-0034: thcv241_write_table successed!
[    5.096657] thcv242_probe started
[    5.096663] thcv242 7-0077: [thcv242_probe] at addr 0x77
[    5.096710] thcv242 7-0077: detected SerDes receiver thcv242!
[    5.228858] thcv242 7-0077: thcv242_write_table successed!
[    5.229304] imx230 7-0010: [imx230_probe] probing v4l2 sensor at addr 0x10
[    5.229408] imx230 7-0010: #### [imx230_parse_dt] ended!###
[    5.229440] imx230 7-0010: imx230_power_get: request reset_gpio ok!
[    5.229445] imx230 7-0010: [imx230_power_get] gpio_get_value: 0
[    5.229713] imx230 7-0010: tegracam sensor driver:imx230_v2.0.6
[    5.229717] imx230 7-0010: tegra camera driver registration successed
[    5.253818] imx230 7-0010: imx230_read_reg: i2c read, 0x16 = 2
[    5.256054] imx230 7-0010: imx230_read_reg: i2c read, 0x17 = 30
[    5.257008] imx230 7-0010: imx230_read_reg: i2c read, 0x200 = 5
[    5.257982] imx230 7-0010: imx230_read_reg: i2c read, 0x201 = 4c
[    5.257987] imx230 7-0010: imx230_board_setup: sensor fine integ. time : 1356
[    5.264091] imx230 7-0010: board setup successed
[    5.264117] imx230 7-0010: imx230_set_gain_ex: gain reg: 0(0-448), times: 16
[    5.271818] imx230 7-0010: imx230_set_exposure_ex: exposure reg: 0(5) AE: 0
[    5.280581] imx230 7-0010: imx230_write_reg: i2c write, 0x340 = a
[    5.296660] imx230 7-0010: imx230_write_reg: i2c write failed, 0x340 = a
[    5.303712] imx230 7-0010: imx230_write_reg: i2c write, 0x341 = 81
[    5.315171] imx230 7-0010: imx230_write_reg: i2c write failed, 0x341 = 81
[    5.322009] imx230 7-0010: imx230_set_frame_rate_ex: frame_length:2689[Line]
[    5.322023] imx230 7-0010: imx230_set_gain_ex: gain reg: 0(0-448), times: 16
[    5.333919] imx230 7-0010: imx230_set_exposure_ex: exposure reg: 0(5) AE: 13
[    5.341983] imx230 7-0010: imx230_write_reg: i2c write, 0x340 = a
[    5.354213] imx230 7-0010: imx230_write_reg: i2c write failed, 0x340 = a
[    5.363848] imx230 7-0010: imx230_write_reg: i2c write, 0x341 = 81
[    5.374629] imx230 7-0010: imx230_write_reg: i2c write failed, 0x341 = 81
[    5.385309] imx230 7-0010: imx230_set_frame_rate_ex: frame_length:2689[Line]
[    5.385321] vi 54080000.vi: subdev imx230 7-0010 bound
[    5.387302] imx230 7-0010: tegra camera subdev registration successed
[    5.387307] imx230 7-0010: detected imx230 sensor
[    7.024937] imx230 7-0010: #### [imx230_set_mode] mode[0] started!###
[    7.024974] imx230 7-0010: #### [imx230_start_streaming] started!###

hello swkim88888,

could you please share your tegra-camera-platform{} node definition for reference?
for example,

        tcp: tegra-camera-platform {
                compatible = "nvidia, tegra-camera-platform";
                modules {
                        cam_module0: module0 {...}

@JerryChang Thnx your reply

filename is :porg-platforms/tegra210-camera-rbpcv2-dual-imx230.dtsi
This dtsi file is derived from tegra210-camera-rbpcv2-dual-imx219.dtsi

If you need some code to verify, ask me freely.

Have a nice weekend :-D

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

		num_csi_lanes = <4>;
		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 {
			cam_module0: module0 {
				badge = "porg_front_RBPCV2";
				position = "front";
				orientation = "1";
				cam_module0_drivernode0: drivernode0 {
					pcl_id = "v4l2_sensor";
					devname = "imx230 7-0010";
					proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@0/rbpcv2_imx230_a@10";
				};
				cam_module0_drivernode1: drivernode1 {
					pcl_id = "v4l2_lens";
					proc-device-tree = "/proc/device-tree/lens_imx230@RBPCV2/";
				};
			};
			cam_module1: module1 {
				badge = "porg_rear_RBPCV2";
				position = "rear";
				orientation = "1";
				cam_module1_drivernode0: drivernode0 {
					pcl_id = "v4l2_sensor";
					devname = "imx230 1-0010";
                    proc-device-tree = "/proc/device-tree/i2c@7000c400/rbpcv2_imx230_e@10";
				};
				cam_module1_drivernode1: drivernode1 {
					pcl_id = "v4l2_lens";
					proc-device-tree = "/proc/device-tree/lens_imx230@RBPCV2/";
				};
			};
		};
	};

hello swkim88888,

please also revise the settings of devname, you should given correct i2c bus and address behind the camera node naming.

BTW,
here’s tutorials page, you should check V4L2 Sensor Driver Development Tutorial for reference.
thanks

1 Like

HI @JerryChang

First, Thanks to give me a good tutorial to reference.

But ** tegra210-camera-rbpcv2-dual-imx219.dtsi** 's devname like below.
And Other 3 IC (thcv242, thcv241a, IMX230) probed success on I2c-7
And IMX219’s dtsi use like dename like below.

devname = "imx219 7-0010";
devname = "imx219 8-0010";

So, Should I revise my devname?

modules {
			cam_module0: module0 {
				badge = "porg_front_RBPCV2";
				position = "front";
				orientation = "1";
				cam_module0_drivernode0: drivernode0 {
					pcl_id = "v4l2_sensor";
					devname = "imx219 7-0010";
					proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@0/rbpcv2_imx219_a@10";
				};
				cam_module0_drivernode1: drivernode1 {
					pcl_id = "v4l2_lens";
					proc-device-tree = "/proc/device-tree/lens_imx219@RBPCV2/";
				};
			};
			cam_module1: module1 {
				badge = "porg_rear_RBPCV2";
				position = "rear";
				orientation = "1";
				cam_module1_drivernode0: drivernode0 {
					pcl_id = "v4l2_sensor";
					devname = "imx219 8-0010";
					proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@1/rbpcv2_imx219_e@10";
				};
				cam_module1_drivernode1: drivernode1 {
					pcl_id = "v4l2_lens";
					proc-device-tree = "/proc/device-tree/lens_imx219@RBPCV2/";
				};
			};

hello swkim88888,

I was answering your previous question,
since you have this definition, devname = "imx230 7-0010"; that’s why it attach to i2c-7.

1 Like

@JerryChang Oh,

Opps I go too far. It just my mistake.

All 6 Ic (probe success)
How can I test my camera work? I mean test my module work?

nano@localhost:~$ dmesg | grep -E "thcv24|imx230"
[    4.681697] imx230 1-0010: [imx230_probe] probing v4l2 sensor at addr 0x10
[    4.681815] imx230 1-0010: #### [imx230_parse_dt] ended!###
[    4.681835] imx230 1-0010: imx230_power_get: request reset_gpio ok!
[    4.681840] imx230 1-0010: [imx230_power_get] gpio_get_value: 0
[    4.684652] imx230 1-0010: tegracam sensor driver:imx230_v2.0.6
[    4.684659] imx230 1-0010: tegra camera driver registration successed
[    4.708786] imx230 1-0010: imx230_read_reg: i2c read, 0x16 = 2
[    4.709903] imx230 1-0010: imx230_read_reg: i2c read, 0x17 = 30
[    4.710732] imx230 1-0010: imx230_read_reg: i2c read, 0x200 = 5
[    4.711317] imx230 1-0010: imx230_read_reg: i2c read, 0x201 = 4c
[    4.711323] imx230 1-0010: imx230_board_setup: sensor fine integ. time : 1356
[    4.719271] imx230 1-0010: board setup successed
[    4.719304] imx230 1-0010: imx230_set_gain_ex: gain reg: 0(0-448), times: 16
[    4.731373] imx230 1-0010: imx230_set_exposure_ex: exposure reg: 0(5) AE: 0
[    4.742994] imx230 1-0010: imx230_write_reg: i2c write, 0x340 = a
[    4.763316] imx230 1-0010: imx230_write_reg: i2c write failed, 0x340 = a
[    4.783945] imx230 1-0010: imx230_write_reg: i2c write, 0x341 = 81
[    4.803240] imx230 1-0010: imx230_write_reg: i2c write failed, 0x341 = 81
[    4.810736] imx230 1-0010: imx230_set_frame_rate_ex: frame_length:2689[Line]
[    4.810750] imx230 1-0010: imx230_set_gain_ex: gain reg: 0(0-448), times: 16
[    4.818745] imx230 1-0010: imx230_set_exposure_ex: exposure reg: 2(5) AE: 13
[    4.826306] imx230 1-0010: imx230_write_reg: i2c write, 0x340 = a
[    4.839298] imx230 1-0010: imx230_write_reg: i2c write failed, 0x340 = a
[    4.847171] imx230 1-0010: imx230_write_reg: i2c write, 0x341 = 81
[    4.871309] imx230 1-0010: imx230_write_reg: i2c write failed, 0x341 = 81
[    4.878226] imx230 1-0010: imx230_set_frame_rate_ex: frame_length:2689[Line]
[    4.878240] vi 54080000.vi: subdev imx230 1-0010 bound
[    4.879530] imx230 1-0010: tegra camera subdev registration successed
[    4.879535] imx230 1-0010: detected imx230 sensor
[    4.879648] thcv241_probe started
[    4.879654] thcv241 1-0034: [thcv241_probe] at addr 0x34
[    4.879700] thcv241 1-0034: detected SerDes transmitter thcv241!
[    4.879821] imx230 7-0010: [imx230_probe] probing v4l2 sensor at addr 0x10
[    4.879894] imx230 7-0010: #### [imx230_parse_dt] ended!###                            +-----------------------------+
[    4.879914] imx230 7-0010: imx230_power_get: request reset_gpio ok!                    |                             |
[    4.879919] imx230 7-0010: [imx230_power_get] gpio_get_value: 0                        |  Cannot open /dev/ttyUSB0!  |
[    4.880146] imx230 7-0010: tegracam sensor driver:imx230_v2.0.6                        |                             |
[    4.880150] imx230 7-0010: tegra camera driver registration successed                  +-----------------------------+
[    4.907341] imx230 7-0010: imx230_read_reg: i2c read, 0x16 = 2
[    4.908908] imx230 7-0010: imx230_read_reg: i2c read, 0x17 = 30
[    4.911865] imx230 7-0010: imx230_read_reg: i2c read, 0x200 = 5
[    4.912825] imx230 7-0010: imx230_read_reg: i2c read, 0x201 = 4c
[    4.912830] imx230 7-0010: imx230_board_setup: sensor fine integ. time : 1356
[    4.916736] thcv241 1-0034: thcv241_write_table successed!
[    4.916865] thcv242_probe started
[    4.916871] thcv242 1-000b: [thcv242_probe] at addr 0xb
[    4.916915] thcv242 1-000b: detected SerDes receiver thcv242!
[    4.920307] imx230 7-0010: board setup successed
[    4.920333] imx230 7-0010: imx230_set_gain_ex: gain reg: 0(0-448), times: 16
[    4.929187] imx230 7-0010: imx230_set_exposure_ex: exposure reg: 0(5) AE: 0
[    4.945159] imx230 7-0010: imx230_write_reg: i2c write, 0x340 = a
[    4.953591] imx230 7-0010: imx230_write_reg: i2c write failed, 0x340 = a
[    4.954620] thcv242 1-000b: thcv242_write_table successed!
[    4.960679] imx230 7-0010: imx230_write_reg: i2c write, 0x341 = 81
[    4.969449] imx230 7-0010: imx230_write_reg: i2c write failed, 0x341 = 81
[    4.976476] imx230 7-0010: imx230_set_frame_rate_ex: frame_length:2689[Line]
[    4.976490] imx230 7-0010: imx230_set_gain_ex: gain reg: 0(0-448), times: 16
[    4.983858] imx230 7-0010: imx230_set_exposure_ex: exposure reg: 0(5) AE: 13
[    4.983863] imx230 7-0010: imx230_write_reg: i2c write, 0x340 = a
[    4.985445] imx230 7-0010: imx230_write_reg: i2c write failed, 0x340 = a
[    4.985448] imx230 7-0010: imx230_write_reg: i2c write, 0x341 = 81
[    4.986342] imx230 7-0010: imx230_write_reg: i2c write failed, 0x341 = 81
[    4.986347] imx230 7-0010: imx230_set_frame_rate_ex: frame_length:2689[Line]
[    4.986356] vi 54080000.vi: subdev imx230 7-0010 bound
[    4.987076] imx230 7-0010: tegra camera subdev registration successed
[    4.987079] imx230 7-0010: detected imx230 sensor
[    4.987152] thcv241_probe started
[    4.987156] thcv241 7-0034: [thcv241_probe] at addr 0x34
[    4.987198] thcv241 7-0034: detected SerDes transmitter thcv241!
[    5.029927] thcv241 7-0034: thcv241_write_table successed!
[    5.030729] thcv242_probe started
[    5.030736] thcv242 7-0077: [thcv242_probe] at addr 0x77
[    5.030792] thcv242 7-0077: detected SerDes receiver thcv242!
[    5.125739] thcv242 7-0077: thcv242_write_table successed!
[    6.801277] imx230 7-0010: #### [imx230_set_mode] mode[0] started!###
[    6.801305] imx230 7-0010: #### [imx230_start_streaming] started!###
[    6.910208] imx230 1-0010: #### [imx230_set_mode] mode[0] started!###
[    6.910235] imx230 1-0010: #### [imx230_start_streaming] started!###

hello swkim88888,

your sensor driver should be functional according to those logs,
please refer to Approaches for Validating and Testing the V4L2 Driver for the sample command-line to access the camera stream through user-space.
thanks

@JerryChang
I close my issue.
Thank’s to give a nice reference and tutorial.