P9_12 not available for cape universal with DLP cape mounted

151 views
Skip to first unread message

Jacek Radzikowski

unread,
Feb 28, 2018, 9:46:20 PM2/28/18
to beagleboard
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/ocp*P9_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.


--
Given a choice between two theories, take the one which is funnier

Jacek Radzikowski

unread,
Mar 2, 2018, 1:28:38 PM3/2/18
to beagleboard
Posting for future reference: libgpiod and python bindings work great, and do not rely on the problematic sysfs support.

Jacek.

Robert Nelson

unread,
Mar 2, 2018, 2:45:16 PM3/2/18
to Beagle Board


On Mar 1, 2018 3:46 AM, "Jacek Radzikowski" <jacek.ra...@gmail.com> wrote:
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/ocp*P9_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.

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,



--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CAA2oDvbL58hGEDVft_FFTQ79haidCn3viqXzTi4%2BsXB5%2BOvUsA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Jacek Radzikowski

unread,
Mar 2, 2018, 2:53:21 PM3/2/18
to beagleboard
On Fri, Mar 2, 2018 at 2:45 PM, Robert Nelson <robert...@gmail.com> wrote:
On Mar 1, 2018 3:46 AM, "Jacek Radzikowski" <jacek.ra...@gmail.com> wrote:
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/ocp*P9_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.

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.


Thanks for taking care of it!

Jacek.

pierric...@gadz.org

unread,
Mar 9, 2018, 4:43:58 PM3/9/18
to BeagleBoard
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
###
###Overide capes with eeprom
#uboot_overlay_addr0=/lib/firmware//<file1>.dtbo
uboot_overlay_addr1=/lib/firmware/BB-UART2-00A0.dtbo
#uboot_overlay_addr2=/lib/firmware//<file2>.dtbo
#uboot_overlay_addr3=/lib/firmware/<file3>.dtbo
###

After rebooting the beaglebone black I can not use config-pin anymore.

When I run dmesg after booting I have this :
[    2.324713] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
[    2.328142] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle

instead of this (when I am not loading the dtbo) :

[    2.430145] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
[    2.440648] gpio-of-helper ocp:cape-universal: ready  
[    2.453905] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle

The execution of version.sh gives:

root@beaglebone:/opt/scripts/tools# sh version.sh
git:/opt/scripts/:[2ce750d881941c5189db9e189af90517e11c079f]
eeprom:[A335BNLTBWA51650BBWG3616]
dogtag:[BeagleBoard.org Debian Image 2017-08-31]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2018.01-00002-ge9ff418fb8]
kernel:[4.9.45-ti-r57]
nodejs:[v6.11.2]
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_addr2=/lib/firmware/BB-UART4-00A0.dtbo]
uboot_overlay_options:[disable_uboot_overlay_video=1]
uboot_overlay_options:[disable_uboot_overlay_audio=1]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg:[bb-cape-overlays]:[4.4.20170728.0-0rcnee1~stretch+20170728]
pkg:[bb-wl18xx-firmware]:[1.20170829-0rcnee1~stretch+20170829]
pkg:[firmware-ti-connectivity]:[20170823-1rcnee0~stretch+20170830]


Could you let met know if I can give you more information that can be usefull?

Thanks,


Pierrick

Robert Nelson

unread,
Mar 9, 2018, 4:48:18 PM3/9/18
to Beagle Board, pierric...@gadz.org
On Fri, Mar 9, 2018 at 3:43 PM, <pierric...@gadz.org> wrote:
> 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 :

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,

--
Robert Nelson
https://rcn-ee.com/

pierric...@gadz.org

unread,
Mar 9, 2018, 5:03:47 PM3/9/18
to BeagleBoard
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

Robert Nelson

unread,
Mar 9, 2018, 5:26:14 PM3/9/18
to Beagle Board
On Fri, Mar 9, 2018 at 4:03 PM, <pierric...@gadz.org> wrote:
> 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

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..
Reply all
Reply to author
Forward
0 new messages