How to access GPIO using derek molloy's GPIO Library

Hello Community

I have started using GPIOs on pocketbeagle in my application. I need 24 of them. However, using the GPIO library on github (exploring BB), i am able to access only 18 of them. How can i access more GPIOs on the P1 header say for instance, gpio110 (P1_36).

Help is greatly appreciated

Regards

You have to reconfigure the pin-mux for those pins. config-pin might be
capable of that (note: there are two config-pin executables; the one on the
path is a compiled version that lacks some capability over the older shell
script version [searching the file system should find it]).

  At worse, it may require modifying one or more device tree files.

Take the following with a grain of salt in that it’s probably outdated, but it may also be something to consider if you’re not planning on using capes:

A few year’s back on BBB, we ran across an issue where config-pin gave an error when attempting to reconfigure pins that were already in use by the cape manager/cape universal. At the time, I THINK, there was a way to disable the cape manager/cape universal via changing a variable/flag setting in uEnv.txt. I think that was on an image around the time the transition to U-boot overlays was going on…

The following post shows a line in uEnv.txt for enabling, and I assuming disabling cape universal:

https://github.com/beagleboard/bb.org-overlays/issues/79

enable_uboot_cape_universal=1

So, not sure if this means that if you change to 0 in uEnv.txt, that it would free up pins so that pin-config no longer gives an error.

I seem to recall that disabling cape_universal ALSO disables any use of
config-pin. More likely is that one needs to disable /other/ overlays that
are claiming the desired pins. From my BBB:

###Disable auto loading of virtual capes (emmc/video/wireless/adc)
#disable_uboot_overlay_emmc=1
#disable_uboot_overlay_video=1
#disable_uboot_overlay_audio=1
#disable_uboot_overlay_wireless=1
#disable_uboot_overlay_adc=1

Thanks for replying Dennis

I tried changing the uBoot.env as suggested by you. Results weren’t as expected. However I was able to find a work around method which I would like to share with the community.

I was able to access gpio on P1 headers (almost all of them) using the bonescript library. Since my application is cpp based , I had to find a way to use these gpios on P1 header.
Here’s what I did:
1)Created a service which runs a javascript bonescript application with P1 pins configured in bonescript.
2)allowed this service to run in background and then ran my main.cpp application using these additional pins on P1 as gpios.

Results:

Got access to 30 pins total, as gpio

Assessment:

Bonescript is doing the configuration of pins for me. Although I haven’t deep dived into bonescript, someone who already has knowledge of it can better explain how is bonescript able to configure gpio.

Regards

Piyush

Since you are using a PocketBeagle, isn’t P1_32 mapped to gpio1.10 and not P1_36 which is mapped to gpio3.14?
https://github.com/beagleboard/linux/blob/4.14/arch/arm/boot/dts/am335x-pocketbeagle.dts

https://docs.google.com/spreadsheets/d/1fE-AsDZvJ-bBwzNBj1_sPDrutvEvsmARqFwvbw_HkrE/edit#gid=1518010293

Jon