nvcamera-daemon - unhandled level 2 translation fault (11)

Hello,
I am trying to get video data from IMX274 with using CSI2. But when I execute gstreamer command, nvcamera-daemon stopped working.

Here is dmesg about the error:

[  208.677281] nvcamera-daemon[2496]: unhandled level 2 translation fault (11) at 0x00000000, esr 0x92000006
[  208.687073] pgd = ffffffc05b047000
[  208.690502] [00000000] *pgd=0000000153af0003, *pud=0000000153af0003, *pmd=0000000000000000

[  208.700575] CPU: 2 PID: 2496 Comm: nvcamera-daemon Not tainted 4.4.38-tegra #29
[  208.707975] Hardware name: jetson_tx1 (DT)
[  208.712075] task: ffffffc0f2d10000 ti: ffffffc0d4094000 task.ti: ffffffc0d4094000
[  208.719698] PC is at 0x403038
[  208.722746] LR is at 0x403034
[  208.725785] pc : [<0000000000403038>] lr : [<0000000000403034>] pstate: 60000000
[  208.733243] sp : 0000007f885d7290
[  208.736627] x29: 0000007f885db9d0 x28: 0000000000000000 
[  208.741964] x27: 0000000000000001 x26: 0000007f885db300 
[  208.747423] x25: 0000000000404000 x24: 0000000000000334 
[  208.752828] x23: 0000007f885d9300 x22: 0000007f885d8300 
[  208.758231] x21: 0000007f885d9244 x20: 0000007f885d7310 
[  208.763623] x19: 0000007f885d9930 x18: 0000000000000014 
[  208.769050] x17: 0000007f89e0efb0 x16: 0000007f89b61540 
[  208.774439] x15: 0000007f8a7f6000 x14: 7265766972446172 
[  208.779831] x13: 656d61432f697061 x12: 2f637273206d6f72 
[  208.785236] x11: 6620676e69746167 x10: 61706f7270282020 
[  208.790630] x9 : 3a726574656d6172 x8 : 0000000000000040 
[  208.796051] x7 : 0000007f80d2bc60 x6 : 0000000000000001 
[  208.801441] x5 : 0000000000000000 x4 : 0000007f80000b10 
[  208.806895] x3 : 0000000000000000 x2 : 0000000000000001 
[  208.812222] x1 : 0000000000000000 x0 : 0000000000000000 

[  208.819033] Library at 0x403038: 0x400000 /usr/sbin/nvcamera-daemon
[  208.825294] Library at 0x403034: 0x400000 /usr/sbin/nvcamera-daemon
[  208.831552] vdso base = 0x7f8a7f5000

Here is my device tree sources:

tegra210-camera-imx274-a00.dtsi:

/*
 * Copyright (c) 2016-2017, NVIDIA CORPORATION.  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>
#include <dt-bindings/platform/t210/t210.h>

/ {
	host1x {
		vi {
			num-channels = <1>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					liimx274_vi_in0: endpoint {
						csi-port = <2>;
						bus-width = <4>;
						remote-endpoint = <&liimx274_csi_out0>;
					};
				};
			};
		};

		nvcsi {
			num-channels = <1>;
			#address-cells = <1>;
			#size-cells = <0>;
			channel@0 {
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					port@0 {
						reg = <0>;
						liimx274_csi_in0: endpoint@0 {
							csi-port = <2>;
							bus-width = <4>;
							remote-endpoint = <&liimx274_imx274_out0>;
						};
					};
					port@1 {
						reg = <1>;
						liimx274_csi_out0: endpoint@1 {
							remote-endpoint = <&liimx274_vi_in0>;
						};
					};
				};
			};
		};

		i2c@546c0000 {
			tca9546@70 {
				i2c@1 {
					imx274_a@1a {
						compatible = "nvidia,imx274";
						/* I2C device address */
						reg = <0x1a>;

						/* Physical dimensions of sensor */
						physical_w = "3.674";
						physical_h = "2.738";

						/* Define any required hw resources needed by driver */
						/* ie. clocks, io pins, power sources */
						avdd-reg = "vana";
						iovdd-reg = "vif";
						dvdd-reg = "vdig";

						/* Defines number of frames to be dropped by driver internally after applying */
						/* sensor crop settings. Some sensors send corrupt frames after applying */
						/* crop co-ordinates */
						/*post_crop_frame_drop = "0";*/

						/* if true, delay gain setting by one frame to be in sync with exposure */
						delayed_gain = "true";

						/**
						* A modeX node is required to support v4l2 driver
						* implementation with NVIDIA camera software stack
						*
						* mclk_khz = "";
						* Standard MIPI driving clock, typically 24MHz
						*
						* num_lanes = "";
						* Number of lane channels sensor is programmed to output
						*
						* tegra_sinterface = "";
						* The base tegra serial interface lanes are connected to
						*
						* discontinuous_clk = "";
						* The sensor is programmed to use a discontinuous clock on MIPI lanes
						*
						* dpcm_enable = "true";
						* The sensor is programmed to use a DPCM modes
						*
						* cil_settletime = "";
						* MIPI lane settle time value.
						* A "0" value attempts to autocalibrate based on mclk_multiplier
						*
						* active_w = "";
						* Pixel active region width
						*
						* active_h = "";
						* Pixel active region height
						*
						* pixel_t = "";
						* The sensor readout pixel pattern
						*
						* readout_orientation = "0";
						* Based on camera module orientation.
						* Only change readout_orientation if you specifically
						* Program a different readout order for this mode
						*
						* line_length = "";
						* Pixel line length (width) for sensor mode.
						* This is used to calibrate features in our camera stack.
						*
						* mclk_multiplier = "";
						* Multiplier to MCLK to help time hardware capture sequence
						* TODO: Assign to PLL_Multiplier as well until fixed in core
						*
						* pix_clk_hz = "";
						* Sensor pixel clock used for calculations like exposure and framerate
						*
						* inherent_gain = "";
						* Gain obtained inherently from mode (ie. pixel binning)
						*
						* min_gain_val = ""; (floor to 6 decimal places)
						* max_gain_val = ""; (floor to 6 decimal places)
						* Gain limits for mode
						*
						* min_exp_time = ""; (ceil to integer)
						* max_exp_time = ""; (ceil to integer)
						* Exposure Time limits for mode (us)
						*
						* min_hdr_ratio = "";
						* max_hdr_ratio = "";
						* HDR Ratio limits for mode
						*
						* min_framerate = "";
						* max_framerate = "";
						* Framerate limits for mode (fps)
						*
						* embedded_metadata_height = "";
						* Sensor embedded metadata height in units of rows.
						* If sensor does not support embedded metadata value should be 0.
						*/
						mode0 { // IMX274_MODE_3840X2160
							mclk_khz = "24000";
							num_lanes = "4";
							tegra_sinterface = "serial_c";
							discontinuous_clk = "yes";
							dpcm_enable = "false";
							cil_settletime = "0";

							active_w = "3840";
							active_h = "2160";
							pixel_t = "bayer_rggb";
							readout_orientation = "90";
							line_length = "4208";
							inherent_gain = "1";
							mclk_multiplier = "24";
							pix_clk_hz = "576000000";

							min_gain_val = "1.0";
							max_gain_val = "22.2";
							min_hdr_ratio = "1";
							max_hdr_ratio = "1";
							min_framerate = "1.5";
							max_framerate = "30";
							min_exp_time = "44";
							max_exp_time = "666637";
						};
						mode1 { // IMX274_MODE_1920X1080
							mclk_khz = "24000";
							num_lanes = "4";
							tegra_sinterface = "serial_c";
							discontinuous_clk = "yes";
							dpcm_enable = "false";
							cil_settletime = "0";

							active_w = "1920";
							active_h = "1080";
							pixel_t = "bayer_rggb";
							readout_orientation = "90";
							line_length = "4160";
							inherent_gain = "1";
							mclk_multiplier = "24";
							pix_clk_hz = "576000000";

							min_gain_val = "1.0";
							max_gain_val = "22.2";
							min_hdr_ratio = "1";
							max_hdr_ratio = "1";
							min_framerate = "1.5";
							max_framerate = "60";
							min_exp_time = "58";
							max_exp_time = "184611";
							embedded_metadata_height = "1";
						};
						ports {
							#address-cells = <1>;
							#size-cells = <0>;
							port@0 {
								reg = <0>;
								liimx274_imx274_out0: endpoint {
									status = "okay";
									csi-port = <2>;
									bus-width = <4>;
									remote-endpoint = <&liimx274_csi_in0>;
								};
							};
						};
					};
				};
			};
		};
	};
	lens_imx274@A6V26 {
		min_focus_distance = "0.0";
		hyper_focal = "0.0";
		focal_length = "5.00";
		f_number = "2.0";
		aperture = "2.2";
	};
};

/ {

	tegra-camera-platform {
		compatible = "nvidia, tegra-camera-platform";
		/**
		* Physical settings to calculate max ISO BW
		*
		* num_csi_lanes = <>;
		* Total number of CSI lanes when all cameras are active
		*
		* max_lane_speed = <>;
		* Max lane speed in Kbit/s
		*
		* min_bits_per_pixel = <>;
		* Min bits per pixel
		*
		* vi_peak_byte_per_pixel = <>;
		* Max byte per pixel for the VI ISO case
		*
		* vi_bw_margin_pct = <>;
		* Vi bandwidth margin in percentage
		*
		* max_pixel_rate = <>;
		* Max pixel rate in Kpixel/s for the ISP ISO case
		*
		* isp_peak_byte_per_pixel = <>;
		* Max byte per pixel for the ISP ISO case
		*
		* isp_bw_margin_pct = <>;
		* Isp bandwidth margin in percentage
		*/
		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 = <750000>;
		isp_peak_byte_per_pixel = <5>;
		isp_bw_margin_pct = <25>;

		/**
		 * The general guideline for naming badge_info contains 3 parts, and is as follows,
		 * The first part is the camera_board_id for the module; if the module is in a FFD
		 * platform, then use the platform name for this part.
		 * The second part contains the position of the module, ex. "rear" or "front".
		 * The third part contains the last 6 characters of a part number which is found
		 * in the module's specsheet from the vender.
		 */
		modules {
			module0 {
				badge = "imx274_bottom_A6V26";
				position = "bottom";
				orientation = "1";
				drivernode0 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_sensor";
					/* Driver v4l2 device name */
					devname = "imx274 30-001a";
					/* Declare the device-tree hierarchy to driver instance */
					proc-device-tree = "/proc/device-tree/host1x/i2c@546c0000/tca9546@70/i2c@0/imx274_a@1a";
				};
				drivernode1 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_lens";
					proc-device-tree = "/proc/device-tree/lens_imx274@A6V26/";
				};
			};
		};
	};
};

tegra210-jetson-cv-camera-imx274-a00.dtsi:

/*
 * Copyright (c) 2017, NVIDIA CORPORATION.  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 "tegra210-camera-imx274-a00.dtsi"

//#define CAM0_RST_L	TEGRA_GPIO(S, 4)
#define CAM0_PWDN	TEGRA_GPIO(S, 7)
#define CAMERA_I2C_MUX_BUS(x) (0x1E + x)

/* camera control gpio definitions */

/ {
	host1x {
		i2c@546c0000 {
			tca9546@70 {
				compatible = "nxp,pca9546";
				reg = <0x70>;
				#address-cells = <1>;
				#size-cells = <0>;
				skip_mux_detect = "yes";
				vcc-supply = <&en_vdd_cam>;
				vcc_lp = "vcc";
				force_bus_start = <CAMERA_I2C_MUX_BUS(0)>;

				i2c@1 {
					reg = <1>;
					i2c-mux,deselect-on-exit;
					#address-cells = <1>;
					#size-cells = <0>;
					pca9570_a@24 {
						compatible = "nvidia,pca9570";
						reg = <0x24>;
						channel = "a";
						drive_ic = "DRV8838";
					};

					imx274_a@1a {
						/* Define any required hw resources needed by driver */
						/* ie. clocks, io pins, power sources */
						clocks = <&tegra_car TEGRA210_CLK_CLK_OUT_3>;
						clock-names = "clk_out_3";
						clock-frequency = <24000000>;
						mclk = "clk_out_3";
						reset-gpios = <&gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;
						vana-supply = <&en_vdd_cam_hv_2v8>;
						vif-supply = <&en_vdd_cam>;
						vdig-supply = <&en_vdd_cam_1v2>;
					};
				};
			};
		};
	};
};

tegra210-jetson-cv-camera-modules.dtsi:

/*
 * Copyright (c) 2016-2017, NVIDIA CORPORATION.  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; version 2 of the License.
 *
 * 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.
 *
 */

#include "tegra210-jetson-cv-camera-imx274-a00.dtsi"

/*
#include "tegra210-jetson-cv-camera-imx185-a00.dtsi"
#include "tegra210-jetson-cv-camera-e3333-a00.dtsi"
#include "tegra210-jetson-cv-camera-e3326-a00.dtsi"
#include "tegra210-jetson-cv-camera-e3323-a00.dtsi"
*/

#define CAM0_RST_L	TEGRA_GPIO(S, 4)
#define CAM0_PWDN	TEGRA_GPIO(S, 7)
#define CAM1_RST_L	TEGRA_GPIO(S, 5)
#define CAM1_PWDN	TEGRA_GPIO(T, 0)

/ {
	/* set camera gpio direction to output */
	gpio: gpio@6000d000 {
		camera-control-output-low {
			gpio-hog;
			output-low;
			gpios = <CAM0_RST_L 0 CAM0_PWDN 0
				CAM1_RST_L 0 CAM1_PWDN 0>;
			label = "cam0-rst", "cam0-pwdn",
				"cam1-rst", "cam1-pwdn";
        };
	};

	/* all cameras are disabled by default */
	host1x {
		vi_base: vi {
			ports {
				vi_port0: port@0 {
					reg = <0>;
					status = "okay";
					vi_in0: endpoint {
						status = "okay";
					};
				};
				vi_port1: port@1 {
					reg = <1>;
					status = "disabled";
					vi_in1: endpoint {
						status = "disabled";
					};
				};
				vi_port2: port@2 {
					reg = <2>;
					status = "disabled";
					vi_in2: endpoint {
						status = "disabled";
					};
				};
				vi_port3: port@3 {
					reg = <3>;
					status = "disabled";
					vi_in3: endpoint {
						status = "disabled";
					};
				};
				vi_port4: port@4 {
					reg = <4>;
					status = "disabled";
					vi_in4: endpoint {
						status = "disabled";
					};
				};
				vi_port5: port@5 {
					reg = <5>;
					status = "disabled";
					vi_in5: endpoint {
						status = "disabled";
					};
				};
			};
		};
		csi_base: nvcsi {
			csi_chan0: channel@0 {
				reg = <0>;
				status = "okay";
				ports {
					csi_chan0_port0: port@0 {
						status = "okay";
						csi_in0: endpoint@0 {
							status = "okay";
						};
					};
					csi_chan0_port1: port@1 {
						status = "okay";
						csi_out0: endpoint@1 {
							status = "okay";
						};
					};
				};
			};
			csi_chan1: channel@1 {
				reg = <1>;
				status = "disabled";
				ports {
					csi_chan1_port0: port@0 {
						status = "disabled";
						csi_in1: endpoint@2 {
							status = "disabled";
						};
					};
					csi_chan1_port1: port@1 {
						status = "disabled";
						csi_out1: endpoint@3 {
							status = "disabled";
						};
					};
				};
			};
			csi_chan2: channel@2 {
				reg = <2>;
				status = "disabled";
				ports {
					csi_chan2_port0: port@0 {
						status = "disabled";
						csi_in2: endpoint@4 {
							status = "disabled";
						};
					};
					csi_chan2_port1: port@1 {
						status = "disabled";
						csi_out2: endpoint@5 {
							status = "disabled";
						};
					};
				};
			};
			csi_chan3: channel@3 {
				reg = <3>;
				status = "disabled";
				ports {
					csi_chan3_port0: port@0 {
						status = "disabled";
						csi_in3: endpoint@6 {
							status = "disabled";
						};
					};
					csi_chan3_port1: port@1 {
						status = "disabled";
						csi_out3: endpoint@7 {
							status = "disabled";
						};
					};
				};
			};
			csi_chan4: channel@4 {
				reg = <4>;
				status = "disabled";
				ports {
					csi_chan4_port0: port@0 {
						status = "disabled";
						csi_in4: endpoint@8 {
							status = "disabled";
						};
					};
					csi_chan4_port1: port@1 {
						status = "disabled";
						csi_out4: endpoint@9 {
							status = "disabled";
						};
					};
				};
			};
			csi_chan5: channel@5 {
				reg = <5>;
				status = "disabled";
				ports {
					csi_chan5_port0: port@0 {
						status = "disabled";
						csi_in5: endpoint@10 {
							status = "disabled";
						};
					};
					csi_chan5_port1: port@1 {
						status = "disabled";
						csi_out5: endpoint@11 {
							status = "disabled";
						};
					};
				};
			};
		};

		i2c@546c0000 {
			e3326_cam0: ov5693_c@36 {
				status = "disabled";
			};
			e3323_cam0: ov23850_a@10 {
				status = "disabled";
			};
			e3323_vcm0: lc898212@72 {
				status = "disabled";
			};
			cam_tca6408_21: tca6408@21 {
				status = "disabled";
			};
			cam_tca9548_77: tca9548@77 {
				status = "disabled";
				i2c@0 {
					e3333_cam0: ov5693_a@36 {
						status = "disabled";
					};
				};
				i2c@1 {
					e3333_cam1: ov5693_b@36 {
						status = "disabled";
					};
				};
				i2c@2 {
					e3333_cam2: ov5693_c@36 {
						status = "disabled";
					};
				};
				i2c@3 {
					e3333_cam3: ov5693_d@36 {
						status = "disabled";
					};
				};
				i2c@4 {
					e3333_cam4: ov5693_e@36 {
						status = "disabled";
					};
				};
				i2c@5 {
					e3333_cam5: ov5693_f@36 {
						status = "disabled";
					};
				};
			};
			tca6408_21: tca6408@21 {
				default {
					gpio-output-low = <0 1 2 3 4 5 6 7>;
				};
			};
			tca9546_70: tca9546@70 {
				status = "okay";
				i2c@1 {
					imx185_cam0: imx185_a@1a {
						status = "disabled";
					};
					imx274_cam0: imx274_a@1a {
						status = "okay";
					};
				};
			};
		};
	};
	i2c@7000c000 {
		e3323_cam1: ov23850_c@36 {
			status = "disabled";
		};
		e3323_vcm1: lc898212@72 {
			status = "disabled";
		};
	};

	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 = <750000>;
		isp_peak_byte_per_pixel = <2>;
		isp_bw_margin_pct = <25>;
		modules {
			cam_module0: module0 {
				status = "okay";
				cam_module0_drivernode0: drivernode0 {
					status = "okay";
				};
				cam_module0_drivernode1: drivernode1 {
					status = "okay";
					pcl_id = "v4l2_lens";
				};
			};
			cam_module1: module1 {
				status = "disabled";
				cam_module1_drivernode0: drivernode0 {
					status = "disabled";
				};
				cam_module1_drivernode1: drivernode1 {
					status = "disabled";
					pcl_id = "v4l2_lens";
				};
			};
			cam_module2: module2 {
				status = "disabled";
				cam_module2_drivernode0: drivernode0 {
					status = "disabled";
				};
				cam_module2_drivernode1: drivernode1 {
					status = "disabled";
					pcl_id = "v4l2_lens";
				};
			};
			cam_module3: module3 {
				status = "disabled";
				cam_module3_drivernode0: drivernode0 {
					status = "disabled";
				};
				cam_module3_drivernode1: drivernode1 {
					status = "disabled";
					pcl_id = "v4l2_lens";
				};
			};
			cam_module4: module4 {
				status = "disabled";
				cam_module4_drivernode0: drivernode0 {
					status = "disabled";
				};
				cam_module4_drivernode1: drivernode1 {
					status = "disabled";
					pcl_id = "v4l2_lens";
				};
			};
			cam_module5: module5 {
				status = "disabled";
				cam_module5_drivernode0: drivernode0 {
					status = "disabled";
				};
				cam_module5_drivernode1: drivernode1 {
					status = "disabled";
					pcl_id = "v4l2_lens";
				};
			};
		};
	};
};

Note:
I changed i2c settings as you can see in the device tree, and after that I checked the i2c lines and this configuration seems correct. And imx274 probe and vi probe finished successfully, so I can see video0 in /dev directory.

So, Do you have any idea what is the problem ?
What does nvcamera-daemon say in the error code?

Thanks,
Şükrü.

hello sukrubahadirarslan,

may I know which JetPack release you’re working with.
it seems you’re not working with the latest release, since nvcamera-daemon is already deprecated in the JetPack-4.x release.

in addition, it seems you did not use the i2c-mux correctly.
for example

# <i>Serial-C</i>
	liimx274_imx274_out0: endpoint {
				status = "okay";
				csi-port = <2>;
				bus-width = <4>;
# <i>Channel-A</i>
	pca9570_a@24 {
			compatible = "nvidia,pca9570";
			reg = <0x24>;
			channel = "a";

please revise pca9570 to enable channel_c for correct port bindings.
for example

pca9570_c@24 {
		compatible = "nvidia,pca9570";
		reg = <0x24>;
		channel = "c";
		drive_ic = "DRV8838";
	};

Hello JerryChang,

Thank you for your answer.
Yes I am not using the latest version of JetPack. I am using JetPack 2.8.
I changed device tree source with your suggestion and nothing changed.
Do you have any other suggestions ?
Thanks,
Şükrü

hello sukrubahadirarslan,

there’s no JetPack-2.8
may I have your confirmation of the JetPack release, https://developer.nvidia.com/embedded/jetpack-archive

BTW,
is there any chance moving to the latest JetPack release for better support?

Hello JerryChang,
I applied your suggestion, after that I changed imx274_a to imx274_c. And also I changed endpoint’s name to …_in0 to …in1. ( for example I changed liimx274_csi_in0 to liimx274_csi_in1 ). Also I changed devname from imx274_30-001a to imx274_31-001a (in modules node.)
After all of this changes, I can get video data from camera successfully.
Thanks for your helps.

Hello JerryChang,

Sorry for wrong information, I am using JetPack3.3. I will try to move latest JetPack release.
Thanks.