Before trying to make my changes permanent, I had used config-pin and /sys/class/gpio/gpio60/value to test the GPIO. Now, however, when I go to /sys/class/gpio there isnāt a single pin listed there.
Is there some other way to control the GPIO? If not, what information am I missing in my overlay?
I have found the child node names in fragment@2 must be P8_26_pinmux and P9_12_pinmux in order for config-pin to work with them. When I use these names and have the universal cape enabled, the corresponding gpio folders (gpio60 and gpio61) are present within /sys/class/gpio. If I donāt enable the universal cape, I have to export them manually.
Iām still left with a couple of nagging problems:
During the boot sequence the pin is high, and I suspect it is operating as an input until Linux processes the overlays. Is this unavoidable, or is there some other configuration I can do to make the pin initialize as an output as the board comes online?
The direction file in sysfs always reads in after reboot despite the fact the pin is correctly muxed as an output. Is this just a bug in sysfs?
debian@beaglebone:~$ /opt/scripts/device/bone/show-pins.pl | grep P9.12
P9.12 30 U18 fast down 7 gpio 1.28 ocp/P9_12_pinmux (pinmux_tot_acp_P9_12)
debian@beaglebone:~$ cat /sys/class/gpio/gpio60/direction
in
I still havenāt resolved either of the 2 known issues. I did publish my article, regardless, so if anyone is inclined to purse a solution to the boot sequence pinmux or the sysfs direction mismatch my steps are fully documented as below.
Sadly, the reset state of the AM335x GPIO is in affect at power-on⦠You could also set the pin in u-boot to ensure itās default state longer during boot⦠But sadly during linux initialization itāll also return to reset. There is a devie-tree option to bypass this on boot, āgpio-hogā but sadly itās not designed to be used as a toggle pin, itās more of I āforgotā a resistor pull-up, on a special pin.
For your example, i usually recommend user to use āgpio-ledā it supports startup states, and a single command to output high or lowā¦
I definitely get more answers from this forum than I provide, so Iām happy to share what I can! Thanks for checking out the blog post, and please do let me know if you spot anything that can be improved.