I have a problem about controlling the GPIO in user space.
I found that I could not control the GPIO in JP6.1 but I can control the same GPIO in JP5.1.x.
For JP5.1.x, I can control the CAM_PWDN(GPIO_PH.06)
$ gpioinfo
gpiochip0 - 164 lines:
...
line 43: "PH.00" unused input active-high
line 44: "PH.01" unused input active-high
line 45: "PH.02" unused input active-high
line 46: "PH.03" "camera-control-output-low" output active-high [used]
line 47: "PH.04" unused input active-high
line 48: "PH.05" unused input active-high
line 49: "PH.06" unused output active-high
line 50: "PH.07" unused input active-high
...
there’s camera device-tree overlay to define PH.06 by default.
as you can see… from jetson-orin-nano-devkit.conf. OVERLAY_DTB_FILE+=**",tegra234-p3768-0000+p3767-0000-dynamic.dtbo"**
here’s the sources of the dtbo file. $public_sources/r36.4.0/Linux_for_Tegra/source/kernel_src/hardware/nvidia/t23x/nv-public/overlay/tegra234-p3768-0000+p3767-0000-dynamic.dts
you’ll see it include IMX219 device tree by default, such as… #include "tegra234-p3768-camera-rbpcv2-imx219.dtsi"
and…
according to IMX219’s device tree, there’s definition for PH.06.
for instance, $public_sources/r36.4.0/Linux_for_Tegra/source/kernel_src/hardware/nvidia/t23x/nv-public/overlay/tegra234-p3768-camera-rbpcv2-imx219.dtsi #define CAM0_PWDN TEGRA234_MAIN_GPIO(H, 6)
do you have camera use-case to enable IMX219?
otherwise, please give it a try to exclude IMX219 device tree from dynamic.dts
I have already disabled the imx219 in device tree.
I can ensure there is not any driver using PH.06.
But I still cannot control the GPIO by gpioset for JP6.1.
$ sudo dmesg | grep imx219 # do not show any messages because I disabled imx219 driver
Then check GPIOs status
$ gpioinfo
gpiochip0 - 164 lines:
...
line 43: "PH.00" unused input active-high
line 44: "PH.01" unused input active-high
line 45: "PH.02" unused input active-high
line 46: "PH.03" "camera-control-output-low" output active-high [used]
line 47: "PH.04" unused input active-high
line 48: "PH.05" unused input active-high
line 49: "PH.06" unused output active-high
line 50: "PH.07" unused input active-high
...
is it due to this pin does not keep high after gpioset command?
please try adding --mode=wait for keeping the pin state, i.e. $ sudo gpioset --mode=wait gpiochip0 49=1
you may also arrange hardware resources to probe the pin state for checking.
I updated the kernel and it still did not work, so it is missing something much deeper. Just made the decision to use jp5.1.4 the pwm and cam will work when set with jetson-io.py. I need to make an ovelay but have not had much luck.
Used the pinmux spreadsheet and it broke and will not boot. I assumed the sheet as downloaded was the default dtb config, it must not be. Going de-compile some of them and see if the base has any gpio configured, if that is the case a simple overlay should work without doing a major .dtb revision.
Since pwm is broken in 6.x it might be a waste of time. Many are in the same position as you and I and nothing official is being posted by the mods…or a clear path to turning on some pins.