If you are using an image from beagleboard.org, please let me know the output of these commands:
a. uname -a
b. cat /etc/dogtag
I will try to duplicate this idea soon when you reply w/ the info. and questioning. I say that b/c some kernels and images are different.
By different, there could be specific GPIOs listed and available or other defaults made when booted.
The /etc/udev/rules.d/ directory should have some files in it to handle using sysfs on the command line w/out having to change file permissions to debian or whatever user you have currently. This way, the root account is not in control of the GPIO in question.
Seth
P.S. @Mrigendra_Chaubey1 , if you have a normal kernel and image, I can duplicate this error you are receiving. I turned on my board, booted it, and performed the commands I have listed.
I see you used cat out > direction instead of echo out > direction. Is this a fact or did you make a typo?
1. https://github.com/beagleboard/bb.org-overlays # too old for kernel 5.10.x.
Also…I am not being of too much help so far. I understand. Frustrating. Trying to figure out this idea is not easy for me…
Have you tried other .dtb files yet? For instance, in the kernel and in u-boot, there are definitions already allocated towards the BBB and other boards from beagleboard.org.
I did not keep up w/ the DTS files for a long time. Maybe someone else can pitch in a bit here?
At one point, /dev/gpio/ or /sys/class/gpio/gpio* changed into /dev/bone/. I think it is still that way w/ the newer images and kernels.
During that process, the process of changing things to handle the Cape Compatibility Layer and /bone/ files, there was a lot of work dedicated to making that idea relevant for the BBB boards and other am335x boards.
But, there is some background and ideas on what to look out for currently. I hope that helps a bit.
One thing is I have previously successfully bring up lcd overlay for 4 inch waveshare lcd so pinmux definetly works via overlay, so trying to create an overlay for this gpio.
lcd 4 inch overlay,
You have been helpful dude .
Its 5.xx kernel so older methods may not work. I am confident I should be able to dig things up and post solution here, it may take some time though.
P.S.
building full image with below link will take 3 to 4 hours of time.
No issue. I am not quite sure how to go about handling GPIO in the kernel build. For instance, do you need CONFIG_GPIO_WHATEVER?
In the kernel build, depending on your kernel, there may be a need to make additional entries in the build process. If you are building the kernel, use / to type in during your picks and choices.
Then, type something like CONFIG_GPIO and hit enter. I am not sure exactly what may pop up but there are also other routes outside of menuconfig to handle the build options in the kernel.
Either way, I may find some time later to handle the GPIO/CONFIG look up in the kernel. I am sure it has to be documented somewhere. I just do not know where right now. My Documentation but I doubt it. It might be in another portion of the kernel. Who knows?
If you get bored, reply again. I will take time out soon to look over the kernel CONFIG_ options soon.
Hey sir, I think you may need the headers. Is that possible? Is it possible that these headers are not installed when building the CROSS_COMPILATION kernel and tools?
The link above shows the many drivers, the GPIO drivers, that one can use to handle the CONFIG_GPIO_WHATEVER Kconfig options when building. Right now, I am not sure which exact GPIO one needs to build in the Kconfig/menuconfig options.
gpio-sysfs.c but I am sure there are more that are needed for the am335x. Be patient. I will keep researching. It is really too bad I do not know the answer offhand.
I’ll continue doing experiments to learn more about this new gpio library.
This answer is just suggestive,I can’t say sysfs gpio userspace is completely removed or stopped working altogether.
P.S.
Doubts remaining,
Its a little strange to me that I have all the nodes for sysfs userspace and still echo 1 > value is not working, maybe I need to see what happened inside gpio-sysfs.c