Jetson Orin NX

• Hardware Platform (Jetson / GPU) Jetson Orin NX
• JetPack Version (valid for Jetson only) 5.1 Developer’s Preview

Hi,
I’m developing a camera driver and I need to configure the reset GPIO for the sensor. Even though I’ve already set the correct GPIOs configuration in the driver and device tree I’m still unable to set the GPIO output to high . Whenever I set an output pin to high nothing happens “electrically” and if I check the output of cat /sys/kernel/debug/gpio the GPIOs are not set to high.

gpio-397 (PH.06               |cam_reset_gpio      ) out lo
gpio-486 (PAC.00              |cam_reset_gpio      ) out lo

I’ve only been able to activate the GPIOs by manually exporting and setting the value of the GPIO required

echo 397 > /sys/class/gpio/export                                                                                                                                          
echo out > /sys/class/gpio/PH.06/direction                                                                                                                                         
echo 1 > /sys/class/gpio/PH.06/value                                                                                                                                               
echo 486 > /sys/class/gpio/export
echo out > /sys/class/gpio/PAC.00/direction
echo 1 > /sys/class/gpio/PAC.00/value

nvidia@nvidia-desktop:~$ sudo cat /sys/kernel/debug/gpio
gpio-397 (PH.06               |sysfs               ) out hi 
gpio-486 (PAC.00              |sysfs               ) out hi

Is it a known bug on the Jetson Orin NX? Or in JetPack 5.1?
Also, is there a known method to install the quality release version JetPack 5.0.2 on the Orin NX? (I’ve seen that it is not available in the SDKmanager)

hello frander.diaz,

no, this is not supported.


since you’re able to activate the GPIOs by manually,
may I know how you toggle the pins through kernel driver and device tree?
please share the code snippets for reference, thanks

Hello JerryChang,

Sure

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

/ {
	cam_i2cmux {
		compatible = "i2c-mux-gpio";
		#address-cells = <1>;
		#size-cells = <0>;
		mux-gpios = <&tegra_aon_gpio CAM_I2C_MUX GPIO_ACTIVE_HIGH>;
		i2c-parent = <&cam_i2c>;
		i2c@0 {
			reg = <0>;
			#address-cells = <1>;
			#size-cells = <0>;
			device_a@61 {
				status = "disabled";
				reset-gpios = <&tegra_main_gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;
			};
		};
		i2c@1 {
			reg = <1>;
			#address-cells = <1>;
			#size-cells = <0>;
			device_c@61 {
				status = "disabled";
				reset-gpios = <&tegra_main_gpio CAM1_PWDN GPIO_ACTIVE_HIGH>;
			};
		};
	};

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

And in the driver

if (pw->reset_gpio) {
		if (gpio_cansleep(pw->reset_gpio))
			gpio_set_value_cansleep(pw->reset_gpio, 1);
		else
			gpio_set_value(pw->reset_gpio, 1);
	}

hello frander.diaz,

I’ve experience some issue with this GPIO marco. i.e. reset-gpios = <&tegra_main_gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;
this is TEGRA234_MAIN_GPIO(H, 6), the GPIO number can be obtain as below…
$ sudo cat /sys/kernel/debug/gpio | grep H.6
gpio-397 (PH.06 |camera-control-outpu) out lo

please replace the marco with GPIO number directly.
such as … reset-gpios = <&tegra_main_gpio 397 GPIO_ACTIVE_HIGH>;

Hello JerryChang

I just tried using the GPIO number directly but it didn’t work.

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

/ {
	cam_i2cmux {
		compatible = "i2c-mux-gpio";
		#address-cells = <1>;
		#size-cells = <0>;
		mux-gpios = <&tegra_aon_gpio CAM_I2C_MUX GPIO_ACTIVE_HIGH>;
		i2c-parent = <&cam_i2c>;
		i2c@0 {
			reg = <0>;
			#address-cells = <1>;
			#size-cells = <0>;
			device_a@61 {
				status = "disabled";
				reset-gpios = <&tegra_main_gpio 397 GPIO_ACTIVE_HIGH>;
			};
		};
		i2c@1 {
			reg = <1>;
			#address-cells = <1>;
			#size-cells = <0>;
			device_c@61 {
				status = "disabled";
				reset-gpios = <&tegra_main_gpio 486 GPIO_ACTIVE_HIGH>;
			};
		};
	};

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

And that configuration fails to find the reset-gpios.

[   91.427682] tegra186-gpio 2200000.gpio: invalid port number: 60
[   91.433774] device 10-0061: reset-gpios not found
[   91.438705] device 10-0061: tegra camera driver registration failed

this doesn’t look right. you’re working with Orin series, right? it should be t234.

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