P9_12 not available for cape universal with DLP cape mounted

Hello,

I try to access GPIO on pin P9_12 from python script using Adafruit_GPIO package, the pin is not available for use. Python script complains about missing file:

ValueError: Set gpio mode failed, missing file or invalid permissions.

config-pin does not see it either:

$ sudo config-pin P9_12 gpio
P9_12 pinmux file not found!
bash: /sys/devices/platform/ocp/ocpP9_12_pinmux/state: No such file or directory
Cannot write pinmux file: /sys/devices/platform/ocp/ocp
P9_12_pinmux/state

What works is exporting GPIO 60 through sys fs, and reading its value from /sys/class/gpio/gpio60/value

With cape removed python script and config-pin work as expected. According to the documentation, the cape does not use this GPIO, so it should not be reserved.

Here’s output from version.sh:
$ sudo /opt/scripts/tools/version.sh
git:/opt/scripts/:[e307a944e0be0610ff5296e0abe4ad31a6e70daa]
eeprom:[A335BNLTBWA51645BBWG0580]
model:[TI_AM335x_BeagleBone_Black_Wireless]
dogtag:[BeagleBoard.org Debian Image 2017-08-01]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2017.07-00002-g61c3ee0fb5]:[location: dd MBR]
kernel:[4.14.21-bone-rt-r13]
nodejs:[v4.8.7]
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-4-TI-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg:[bb-cape-overlays]:[4.4.20180223.0-0rcnee0~jessie+20180223]
pkg:[bb-wl18xx-firmware]:[1.20170829-0rcnee2~jessie+20180104]
pkg:[firmware-ti-connectivity]:[20170823-1rcnee0~jessie+20170830]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal netdev i2c bluetooth cloud9ide gpio pwm admin spi tisdk weston-launch xenomai]
cmdline:[console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk1p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 quiet]
dmesg | grep pinctrl-single
[ 0.889759] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
dmesg | grep gpio-of-helper
[ 0.890749] gpio-of-helper ocp:cape-universal: ready
END

Regards,

Jacek.

Posting for future reference: libgpiod and python bindings work great, and do not rely on the problematic sysfs support.

Jacek.

I’ve been working on this issue these last few weeks, but with embedded world conference this week I haven’t worked on it. I should have more things lined up starting right before elc portand.

Regards,

Thanks for taking care of it!

Jacek.

Hello,

I just wanted to tell you that I am encountering a similar issue, maybe the description of it can help.
I wanted to use UART4 to send information to an Xbee radio, I am enabling it by loading the 3BB-UART2-00A0.dtbo3 in uEnv.txt :

###Master Enable
enable_uboot_overlays=1

uart2 or uart4?

config-pin P9_21 uart
config-pin P9_22 uart

uart4:
config-pin P9_13 uart
config-pin P9_11 uart

Regards,

UART4 sorry for the typo, I am loading BB-UART4-00A0.dtbo not the UART2 one.
The config-pin solution is working thanks a lot!!
However, do you know why it is not working with the device tree? I would like to understand the problem

It seems that when I load a device tree it prevents somehow the execution of “gpio-of-helper ocp:cape-universal”, preventing the “ocp:PIN_pinmux” folders to be created in /sys/devices/platform/ocp; am I right?

Thanks,

Pierrick

Oh, i've been working on a solution over the last few weeks..

It's just not 100% tested/ready yet..

https://github.com/beagleboard/bb.org-overlays/commits/master

"universal rewrite".

Lots of capes still to test and fix..

Regards,