Orin nano crashes when calling VIDIOC_STREAMON

I have been working on developing a camera driver and working to get an image on screen. The device tree and driver create the /dev/video0 node but whenever I use any v4l2 command line function to attempt streaming, jetson freezes and then crashes shortly after. I have narrowed it down to whenever the VIDIOC_STREAMON ioctl is called. Is there a direct mapping between this ioctl and a function in my device driver for further debugging?

Nothing is output through the serial log before and after crashing so I didn’t include it.

Hello @richardcusolito1

Could you please share your driver.c and the device tree files?

Regards!
Eduardo Salazar
Embedded SW Engineer at RidgeRun

Contact us: support@ridgerun.com
Developers wiki: https://developer.ridgerun.com/
Website: www.ridgerun.com

Thank you for your response.
nv_oah0428_driver.txt (26.0 KB)
oah0428_dt.txt (10.4 KB)

Hello @richardcusolito1

Thanks for sharing your files.

Here you said that there is no output from the serial log. Does dmesg command out print the following line?

dev_info(dev, "Detected oah0428 sensor\n");

Regards!

Yes, dmesg prints

Detected oah0428 sensor

it also prints

tegra-camrtc-capture-vi tegra-capture-vi: subdev oah0428 9-0036 bound

right before the detected print statement.

Hello @richardcusolito1

Could you please share the output of the commands?

v4l2-ctl --list-devices
v4l2-ctl --list-formats-ext -d /dev/video0
media-ctl -d /dev/media0 -p

Furthermore, what command do you use to try capturing video?

Regards!

Calling

v4l2-ctl --list-devices

produces

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

vi-output, oah0428 10-0036 (platform:tegra-capture-vi:1):
	/dev/video1

vi-output, oah0428 9-0036 (platform:tegra-capture-vi:2):
	/dev/video0

calling

v4l2-ctl --list-formats-ext -d /dev/video1

produces

ioctl: VIDIOC_ENUM_FMT
	Type: Video Capture

	[0]: 'RG10' (10-bit Bayer RGRG/GBGB)
		Size: Discrete 400x400
			Interval: Discrete 0.033s (30.000 fps)

calling

media-ctl -d /dev/media0 -p

produces

Media controller API version 5.15.148

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

Device topology
- entity 1: 13e00000.host1x:nvcsi@15a00000- (2 pads, 2 links)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev0
	pad0: Sink
		<- "oah0428 10-0036":0 [ENABLED]
	pad1: Source
		-> "vi-output, oah0428 10-0036":0 [ENABLED]

- entity 4: 13e00000.host1x:nvcsi@15a00000- (2 pads, 2 links)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev1
	pad0: Sink
		<- "oah0428 9-0036":0 [ENABLED]
	pad1: Source
		-> "vi-output, oah0428 9-0036":0 [ENABLED]

- entity 7: oah0428 9-0036 (1 pad, 1 link)
            type V4L2 subdev subtype Sensor flags 0
            device node name /dev/v4l-subdev2
	pad0: Source
		[fmt:SRGGB10_1X10/400x400 field:none colorspace:srgb]
		-> "13e00000.host1x:nvcsi@15a00000-":0 [ENABLED]

- entity 9: vi-output, oah0428 9-0036 (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video0
	pad0: Sink
		<- "13e00000.host1x:nvcsi@15a00000-":1 [ENABLED]

- entity 23: oah0428 10-0036 (1 pad, 1 link)
             type V4L2 subdev subtype Sensor flags 0
             device node name /dev/v4l-subdev3
	pad0: Source
		[fmt:SRGGB10_1X10/400x400 field:none colorspace:srgb]
		-> "13e00000.host1x:nvcsi@15a00000-":0 [ENABLED]

- entity 25: vi-output, oah0428 10-0036 (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video1
	pad0: Sink
		<- "13e00000.host1x:nvcsi@15a00000-":1 [ENABLED]

The command I use to try and capture video that causes a crash is

v4l2-ctl --set-fmt-video=width=400,height=400,pixelformat=RG10 --stream-mmap --stream-count=1 -d /dev/video1 --stream-to=ov6946.raw

I will also add that attempting to start a gstreamer pipeline with the following command

gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=10 ! ‘video/x-bayer,width=400,height=400,format=rggb,framerate=30/1’ ! identity silent=false ! filesink location=test.bayer

It doesn’t cause a crash but it generates this output if its relevant

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
../libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
Execution ended after 0:00:00.000367333
Setting pipeline to NULL ...
Freeing pipeline ...

Hello @richardcusolito1

Thanks for the information provided.

I was checking your device tree. I see more than one node related to tegra-capture-viand host1x@13e00000. Also, in the tegra-camera-platform the compatible field is incorrect, it should be compatible = "nvidia, tegra-camera-platform";. In general, I suggest to check your device tree. You can take tegra234-p3767-camera-p3768-imx477-dual.dts file as a reference. That file is in the following path:

hardware/nvidia/t23x/nv-public/overlay/tegra234-p3767-camera-p3768-imx477-dual.dts

You can download the sources from Jetson Linux | NVIDIA Developer if you are using JetPack 6.1

Regards!

Thank you very much! after implementing your changes it no longer crashes but instead hanges when running the v4l2-ctl command from before.

dmesg produces these errors as it hangs.

[  132.914549] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[  132.914579] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[  132.915440] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel

I think this error is occuring because of the device tree but I don’t know how to further narrow down the cause of the problem.

Hello @richardcusolito1

Could you please share the new device tree?

Regards!


/dts-v1/;
/plugin/;

#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)

#include <dt-bindings/tegra234-p3767-0000-common.h>
#include <dt-bindings/clock/tegra234-clock.h>
/ {
	overlay-name = "Camera IMX477 Dual";
	jetson-header-name = "Jetson 24pin CSI Connector";
	compatible = JETSON_COMPATIBLE_P3768;

	fragment@0 {
		target-path = "/";
		__overlay__ {
			tegra-capture-vi  {
				num-channels = <2>; 
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					port@0 {
						reg = <0>;
						oah0428_vi_in0: endpoint {
							port-index = <2>; // prev 1
							bus-width = <2>;
							remote-endpoint = <&oah0428_csi_out0>;
						};
					};
					port@1 {
						reg = <1>;
						oah0428_vi_in1: endpoint {
							port-index = <2>;
							bus-width = <2>;
							remote-endpoint = <&oah0428_csi_out1>;
						};
					};
				};
			};
			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 = <7500000>;
				isp_peak_byte_per_pixel = <5>;
				isp_bw_margin_pct = <25>;

				modules {
					module0 {
						badge = "jakku_front_RBPCV3";
						position = "front";
						orientation = "1";
						drivernode0 {
							pcl_id = "v4l2_sensor";
							sysfs-device-tree = "/sys/firmware/devicetree/base/bus@0/cam_i2cmux/i2c@0/oah0428_a@36";
						};
					};
					module1 {
						badge = "jakku_rear_RBPCV3";
						position = "rear";
						orientation = "1";
						drivernode0 {
							pcl_id = "v4l2_sensor";
							sysfs-device-tree = "/sys/firmware/devicetree/base/bus@0/cam_i2cmux/i2c@1/oah0428_c@36";
						};
					};
				};
			};
			bus@0 {
				host1x@13e00000 {
					nvcsi@15a00000 {
						num-channels = <2>; 
						#address-cells = <1>;
						#size-cells = <0>;
						channel@0 {
							reg = <0>;
							ports {
								#address-cells = <1>;
								#size-cells = <0>;
								port@0 {
									reg = <0>;
									oah0428_csi_in0: endpoint@0 {
										port-index = <2>; // prev 2
										bus-width = <2>;
										remote-endpoint = <&oah0428_out0>;
									};
								};
								port@1 {
									reg = <1>;
									oah0428_csi_out0: endpoint@1 {
										remote-endpoint = <&oah0428_vi_in0>;
									};
								};
							};
						};
						channel@1 {
							reg = <1>;
							ports {
								#address-cells = <1>;
								#size-cells = <0>;
								port@0 {
									reg = <0>;
									oah0428_csi_in1: endpoint@2 {
										port-index = <2>;
										bus-width = <2>;
										remote-endpoint = <&oah0428_out1>;
									};
								};
								port@1 {
									reg = <1>;
									oah0428_csi_out1: endpoint@3 {
										remote-endpoint = <&oah0428_vi_in1>;
									};
								};
							};
						};
					};
				};
				cam_i2cmux {
					status = "okay";
					compatible = "i2c-mux-gpio";
					#address-cells = <1>;
					#size-cells = <0>;
					mux-gpios = <&gpio_aon CAM_I2C_MUX GPIO_ACTIVE_HIGH>;
					i2c-parent = <&cam_i2c>;
					i2c@0 {
						status = "okay";
						reg = <0>;
						#address-cells = <1>;
						#size-cells = <0>;
						rbpcv2_imx219_a@10 {
							status = "disabled";
						};
						oah0428_a@36 {
							reset-gpios = <&gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;
							compatible = "steris,oah0428";
							/* I2C device address */
							reg = <0x36>;
							/* V4L2 device node location */
							devnode = "video0";
							/* Physical dimensions of sensor */
							physical_w = "3.680";
							physical_h = "2.760";
							sensor_model = "ov6946";
							use_sensor_mode_id = "true";

							clocks = <&bpmp TEGRA234_CLK_EXTPERIPH1>,
									 <&bpmp TEGRA234_CLK_PLLP_OUT0>;
							clock-names = "extperiph1", "pllp_grtba";
							mclk = "extperiph1"; // testing
							avdd-reg = "vana";
							iovdd-reg = "vif";

							mode0 { /* 	mode0 { /* OV6946_MODE_400X400 */
								mclk_khz = "24000";
								num_lanes = "2";
								tegra_sinterface = "serial_c"; // previously b
								phy_mode = "DPHY";
								discontinuous_clk = "no";
								dpcm_enable = "false";
								cil_settletime = "0";
								lane_polarity = "0"; // previously 6
								active_w = "400";
								active_h = "400";
								mode_type = "bayer";
								pixel_phase = "rggb";
								csi_pixel_bit_depth = "10";
								readout_orientation = "90";
								line_length = "11200";
								inherent_gain = "1";
								mclk_multiplier = "80";
								pix_clk_hz = "12000000"; //300000000
								gain_factor = "16";
								framerate_factor = "1000000";
								exposure_factor = "1000000";
								min_gain_val = "16"; /* 1.00x */
								max_gain_val = "356"; /* 22x */
								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 = "30000000"; /* 30.0 fps */
								step_framerate = "1";
								default_framerate = "30000000"; /* 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 = "2";
							};
							ports {
								#address-cells = <1>;
								#size-cells = <0>;
								port@0 {
									reg = <0>;
									oah0428_out0: endpoint {
										status = "okay";
										port-index = <2>; // prev 1
										bus-width = <2>;
										remote-endpoint = <&oah0428_csi_in0>;
									};
								};
							};
						};
					};
					i2c@1 {
						status = "okay";
						reg = <1>;
						#address-cells = <1>;
						#size-cells = <0>;
						rbpcv2_imx219_c@10 {
							status = "disabled";
						};
						oah0428_c@36 {
							reset-gpios = <&gpio CAM1_PWDN GPIO_ACTIVE_HIGH>;
							compatible = "steris,oah0428";
							/* I2C device address */
							reg = <0x36>;
							/* V4L2 device node location */
							devnode = "video1";
							/* Physical dimensions of sensor */
							physical_w = "3.680";
							physical_h = "2.760";
							sensor_model = "ov6946";
							use_sensor_mode_id = "true";

							clocks = <&bpmp TEGRA234_CLK_EXTPERIPH1>,
									 <&bpmp TEGRA234_CLK_PLLP_OUT0>;
							clock-names = "extperiph1", "pllp_grtba";
							mclk = "extperiph1"; // testing
							avdd-reg = "vana";
							iovdd-reg = "vif";

							mode0 { /* OV6946_MODE_400X400 */
								mclk_khz = "24000";
								num_lanes = "2";
								tegra_sinterface = "serial_c";
								phy_mode = "DPHY";
								discontinuous_clk = "no";
								dpcm_enable = "false";
								cil_settletime = "0";
								lane_polarity = "0";
								active_w = "400";
								active_h = "400";
								mode_type = "bayer";
								pixel_phase = "rggb";
								csi_pixel_bit_depth = "10";
								readout_orientation = "90";
								line_length = "11200";
								inherent_gain = "1";
								mclk_multiplier = "80";
								pix_clk_hz = "12000000"; // 300000000
								gain_factor = "16";
								framerate_factor = "1000000";
								exposure_factor = "1000000";
								min_gain_val = "16"; /* 1.00x */
								max_gain_val = "356"; /* 22x */
								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 = "30000000"; /* 30.0 fps */
								step_framerate = "1";
								default_framerate = "30000000"; /* 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 = "2";
							};
							ports {
								#address-cells = <1>;
								#size-cells = <0>;
								port@0 {
									reg = <0>;
									oah0428_out1: endpoint {
										status = "okay";
										port-index = <2>;
										bus-width = <2>;
										remote-endpoint = <&oah0428_csi_in1>;
									};
								};
							};
						};
					};
				};

				g
/dts-v1/;
/plugin/;

#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)

#include <dt-bindings/tegra234-p3767-0000-common.h>
#include <dt-bindings/clock/tegra234-clock.h>
/ {
	overlay-name = "Camera IMX477 Dual";
	jetson-header-name = "Jetson 24pin CSI Connector";
	compatible = JETSON_COMPATIBLE_P3768;

	fragment@0 {
		target-path = "/";
		__overlay__ {
			tegra-capture-vi  {
				num-channels = <2>; 
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					port@0 {
						reg = <0>;
						oah0428_vi_in0: endpoint {
							port-index = <2>; // prev 1
							bus-width = <2>;
							remote-endpoint = <&oah0428_csi_out0>;
						};
					};
					port@1 {
						reg = <1>;
						oah0428_vi_in1: endpoint {
							port-index = <2>;
							bus-width = <2>;
							remote-endpoint = <&oah0428_csi_out1>;
						};
					};
				};
			};
			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 = <7500000>;
				isp_peak_byte_per_pixel = <5>;
				isp_bw_margin_pct = <25>;

				modules {
					module0 {
						badge = "jakku_front_RBPCV3";
						position = "front";
						orientation = "1";
						drivernode0 {
							pcl_id = "v4l2_sensor";
							sysfs-device-tree = "/sys/firmware/devicetree/base/bus@0/cam_i2cmux/i2c@0/oah0428_a@36";
						};
					};
					module1 {
						badge = "jakku_rear_RBPCV3";
						position = "rear";
						orientation = "1";
						drivernode0 {
							pcl_id = "v4l2_sensor";
							sysfs-device-tree = "/sys/firmware/devicetree/base/bus@0/cam_i2cmux/i2c@1/oah0428_c@36";
						};
					};
				};
			};
			bus@0 {
				host1x@13e00000 {
					nvcsi@15a00000 {
						num-channels = <2>; 
						#address-cells = <1>;
						#size-cells = <0>;
						channel@0 {
							reg = <0>;
							ports {
								#address-cells = <1>;
								#size-cells = <0>;
								port@0 {
									reg = <0>;
									oah0428_csi_in0: endpoint@0 {
										port-index = <2>; // prev 2
										bus-width = <2>;
										remote-endpoint = <&oah0428_out0>;
									};
								};
								port@1 {
									reg = <1>;
									oah0428_csi_out0: endpoint@1 {
										remote-endpoint = <&oah0428_vi_in0>;
									};
								};
							};
						};
						channel@1 {
							reg = <1>;
							ports {
								#address-cells = <1>;
								#size-cells = <0>;
								port@0 {
									reg = <0>;
									oah0428_csi_in1: endpoint@2 {
										port-index = <2>;
										bus-width = <2>;
										remote-endpoint = <&oah0428_out1>;
									};
								};
								port@1 {
									reg = <1>;
									oah0428_csi_out1: endpoint@3 {
										remote-endpoint = <&oah0428_vi_in1>;
									};
								};
							};
						};
					};
				};
				cam_i2cmux {
					status = "okay";
					compatible = "i2c-mux-gpio";
					#address-cells = <1>;
					#size-cells = <0>;
					mux-gpios = <&gpio_aon CAM_I2C_MUX GPIO_ACTIVE_HIGH>;
					i2c-parent = <&cam_i2c>;
					i2c@0 {
						status = "okay";
						reg = <0>;
						#address-cells = <1>;
						#size-cells = <0>;
						rbpcv2_imx219_a@10 {
							status = "disabled";
						};
						oah0428_a@36 {
							reset-gpios = <&gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;
							compatible = "steris,oah0428";
							/* I2C device address */
							reg = <0x36>;
							/* V4L2 device node location */
							devnode = "video0";
							/* Physical dimensions of sensor */
							physical_w = "3.680";
							physical_h = "2.760";
							sensor_model = "ov6946";
							use_sensor_mode_id = "true";

							clocks = <&bpmp TEGRA234_CLK_EXTPERIPH1>,
									 <&bpmp TEGRA234_CLK_PLLP_OUT0>;
							clock-names = "extperiph1", "pllp_grtba";
							mclk = "extperiph1"; // testing
							avdd-reg = "vana";
							iovdd-reg = "vif";

							mode0 { /* 	mode0 { /* OV6946_MODE_400X400 */
								mclk_khz = "24000";
								num_lanes = "2";
								tegra_sinterface = "serial_c"; // previously b
								phy_mode = "DPHY";
								discontinuous_clk = "no";
								dpcm_enable = "false";
								cil_settletime = "0";
								lane_polarity = "0"; // previously 6
								active_w = "400";
								active_h = "400";
								mode_type = "bayer";
								pixel_phase = "rggb";
								csi_pixel_bit_depth = "10";
								readout_orientation = "90";
								line_length = "11200";
								inherent_gain = "1";
								mclk_multiplier = "80";
								pix_clk_hz = "12000000"; //300000000
								gain_factor = "16";
								framerate_factor = "1000000";
								exposure_factor = "1000000";
								min_gain_val = "16"; /* 1.00x */
								max_gain_val = "356"; /* 22x */
								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 = "30000000"; /* 30.0 fps */
								step_framerate = "1";
								default_framerate = "30000000"; /* 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 = "2";
							};
							ports {
								#address-cells = <1>;
								#size-cells = <0>;
								port@0 {
									reg = <0>;
									oah0428_out0: endpoint {
										status = "okay";
										port-index = <2>; // prev 1
										bus-width = <2>;
										remote-endpoint = <&oah0428_csi_in0>;
									};
								};
							};
						};
					};
					i2c@1 {
						status = "okay";
						reg = <1>;
						#address-cells = <1>;
						#size-cells = <0>;
						rbpcv2_imx219_c@10 {
							status = "disabled";
						};
						oah0428_c@36 {
							reset-gpios = <&gpio CAM1_PWDN GPIO_ACTIVE_HIGH>;
							compatible = "steris,oah0428";
							/* I2C device address */
							reg = <0x36>;
							/* V4L2 device node location */
							devnode = "video1";
							/* Physical dimensions of sensor */
							physical_w = "3.680";
							physical_h = "2.760";
							sensor_model = "ov6946";
							use_sensor_mode_id = "true";

							clocks = <&bpmp TEGRA234_CLK_EXTPERIPH1>,
									 <&bpmp TEGRA234_CLK_PLLP_OUT0>;
							clock-names = "extperiph1", "pllp_grtba";
							mclk = "extperiph1"; // testing
							avdd-reg = "vana";
							iovdd-reg = "vif";

							mode0 { /* OV6946_MODE_400X400 */
								mclk_khz = "24000";
								num_lanes = "2";
								tegra_sinterface = "serial_c";
								phy_mode = "DPHY";
								discontinuous_clk = "no";
								dpcm_enable = "false";
								cil_settletime = "0";
								lane_polarity = "0";
								active_w = "400";
								active_h = "400";
								mode_type = "bayer";
								pixel_phase = "rggb";
								csi_pixel_bit_depth = "10";
								readout_orientation = "90";
								line_length = "11200";
								inherent_gain = "1";
								mclk_multiplier = "80";
								pix_clk_hz = "12000000"; // 300000000
								gain_factor = "16";
								framerate_factor = "1000000";
								exposure_factor = "1000000";
								min_gain_val = "16"; /* 1.00x */
								max_gain_val = "356"; /* 22x */
								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 = "30000000"; /* 30.0 fps */
								step_framerate = "1";
								default_framerate = "30000000"; /* 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 = "2";
							};
							ports {
								#address-cells = <1>;
								#size-cells = <0>;
								port@0 {
									reg = <0>;
									oah0428_out1: endpoint {
										status = "okay";
										port-index = <2>;
										bus-width = <2>;
										remote-endpoint = <&oah0428_csi_in1>;
									};
								};
							};
						};
					};
				};

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

I have been fidgeting with some values all of which produces the same error on dmesg.

Hi @richardcusolito1

Did you copy the device tree twice? Or why is there more than one overlay in the attached device tree?

Please, create your custom overlay only for your sensor and only load that overlay!

Also, keep the port-index to <1> for the sensor connected to the channel, port and i2c 0.

Regards!

Sorry I mistakenly copied the tree twice in this forum.

Are you saying I should only define one i2c@X instead of doing i2c@0 and i2c@1?
I was just mimicking the example driver.

Thank you @EduardoSalazar96 !

No. What I am saying is to revert those port-indexes that you changed. Those port-indexes are associated with i2c@0. Let me know if this is clear enough.

Regards!

Yes I have reverted them but again still the same dmesg error that repeats as long as I let the command run for. I probed the CSI data lines going to the CAM#1 port and there is data on them so I am trying to figure out why it times out.

@richardcusolito1

By checking the device tree, some changes need to be applied.

  • for bus@0i2c@0oah0428_a@36 change the tegra_sinterface value from serial_b to serial_a in both modes: mode0 and mode1. Also, for the i2c@0 change the port-index to <0>.
  • Also do the same for port-index to in the following node: oah0428_vi_in0 in tegra-capture-vi and oah0428_csi_in0 in nvcsi@15a00000.

I am assuming that you have two sensors connected to the board. Is this correct?

Share the device tree after applying the above changes so we can check.

Regards!