I could not access the GPIO in the latest L4T kernel 35.3.1. I was getting permission denied through the command line. The below command results in a permission denied error. It is still working in L4T 35.1. Can anybody let me know if the GPIO backend/access mechanism has been changed?
$ sudo echo 488 > /sys/class/gpio/export
Note: I used Xavier NX board
kayccc
July 14, 2023, 8:17am
2
Jetson Nano or Orin Nano?
Are you using Orin Nano module on Xavier NX board?
Hi Kay,
No, I am using the Xavier NX dev kit from NVIDIA. The same I can reproduce on AGX Xavier devkit as well.
kayccc
July 14, 2023, 8:28am
4
Due to you are posting at Jetson Nano forum, so need to confirm the device first.
I’m moving this issue into Xavier NX forum for better support.
Hi rmandala,
Could you try the following command to export GPIO?
$ sudo su
# echo 488 > /sys/class/gpio/export
Hi Kevin,
Yes, I could access it as a root user, but I wanted it to be available for all users. How can I enable it?
Ramakrishna
You could use the following commands to add the permission for specific group (e.g gpio).
$ sudo chown root:gpio /sys/class/gpio/unexport /sys/class/gpio/export
$ sudo chmod 220 /sys/class/gpio/unexport /sys/class/gpio/export
1 Like
Hi Kevin,
Thanks for the quick help. I can do it manually, but did something change in the latest kernel, forcing the GPIO to be owned by the root?
Ramakrishna
It seems the kernel version the same for these 2 releases.
Could you help to share the result of the following command on both releases?
$ sudo ls -l /sys/class/gpio/export
Hi Kevin,
Sorry for the late response. Here’s the result of the above command.
--w------- 1 root root 4096 Jul 14 08:39 /sys/class/gpio/export
-Ramakrishna
I would like to know the difference of above command between these two releases(R35.1 and R35.3.1).
It is the same for both releases (older invalid response)
--w------- 1 root root 4096 Jul 13 18:40 /sys/class/gpio/export
Corrected response:
L4T 35.3.1
--w------- 1 root root 4096 Jul 13 18:40 /sys/class/gpio/export
L4T 35.1
--w--w---- 1 root gpio 4096 Jul 14 13:41 /sys/class/gpio/export
Could you also help to compare if there’s the different results with the following command for both releases?
$ sudo busybox devmem 0x0243d028
Should I install busybox
? it is not available by default
L4T 35.3.1
0x00001055
L4T 35.1
0x00001055
Sorry, I just provide the wrong address for this pin.
Please check with the following command for both release.
$ sudo busybox devmem 0x0243d810
and also
$ sudo busybox devmem 0x0243d020
Hi Kevin,
Sorry for the confusion. I am working with multiple boards because of this, I gave the output for both L4T 35.3.1.
Here is the correct output
L4T 35.3.1
--w------- 1 root root 4096 Jul 13 18:40 /sys/class/gpio/export
L4T 35.1
--w--w---- 1 root gpio 4096 Jul 14 13:41 /sys/class/gpio/export
Ramakrishna
Hi Kevin,
Any update on this issue? in the latest L4T release, the permissions for GPIO file sys is changed and only root has the access.
Ramakrishna
I’m checking if there’s any change for this with internal.
Are you sure this would work in R35.1 w/o permission denied issue?