libpruio (fast and easy D/A - I/O)

Hi guys,

I hope I found the right place to post this question, google groups looks somewhat confusing to me :smiley:

I just tried to install libpruio as described in the wiki downloading and installing the key and adding the repositories. Updating the repositories sadly causes an error:

sudo apt update
Ign:1 http://deb.debian.org/debian stretch InRelease
Hit:2 http://deb.debian.org/debian stretch-updates InRelease
Hit:3 http://deb.debian.org/debian-security stretch/updates InRelease
Ign:4 http://beagle.tuks.nl/debian jessie/ InRelease
Hit:5 http://deb.debian.org/debian stretch Release
Get:6 http://beagle.tuks.nl/debian jessie/ Release [1,586 B]
Get:7 http://beagle.tuks.nl/debian jessie/ Release.gpg [543 B]
Hit:8 http://repos.rcn-ee.com/debian stretch InRelease
Ign:7 http://beagle.tuks.nl/debian jessie/ Release.gpg
Reading package lists… Done
W: GPG error: http://beagle.tuks.nl/debian jessie/ Release: The following signatures were invalid: A76E9815117798B563EC51A7FBA956CCF84E5437
E: The repository ‘http://beagle.tuks.nl/debian jessie/ Release’ is not signed.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

After some searching I found a solution suggesting to put [trusted=yes] in front of the repo-urls which resolves some of the errors but something seems off still:

sudo apt update
Ign:1 http://deb.debian.org/debian stretch InRelease
Ign:2 http://beagle.tuks.nl/debian jessie/ InRelease
Hit:3 http://deb.debian.org/debian stretch-updates InRelease
Hit:4 http://deb.debian.org/debian-security stretch/updates InRelease
Get:5 http://beagle.tuks.nl/debian jessie/ Release [1,586 B]
Hit:6 http://deb.debian.org/debian stretch Release
Get:7 http://beagle.tuks.nl/debian jessie/ Release.gpg [543 B]
Hit:8 http://repos.rcn-ee.com/debian stretch InRelease
Ign:7 http://beagle.tuks.nl/debian jessie/ Release.gpg
Get:10 http://beagle.tuks.nl/debian jessie/ Sources [3,442 B]
Get:11 http://beagle.tuks.nl/debian jessie/ Packages [6,423 B]
Fetched 12.0 kB in 5s (2,232 B/s)
Reading package lists… Done
Building dependency tree
Reading state information… Done
1 package can be upgraded. Run ‘apt list --upgradable’ to see it.
W: GPG error: http://beagle.tuks.nl/debian jessie/ Release: The following signatures were invalid: A76E9815117798B563EC51A7FBA956CCF84E5437

Is there anything off on my end? Wuuld be grateful for any help as I don’t know too much about package signatures, keys etc. …

Grettings
Thomas

Hi!

By any reason the key file signing got lost. I re-signed it. It should be OK now.

Regards

Hi guys, it is me again … :smiley:

I finally got to continue my project and got libpruio running sampling some happy ADC-values. In my use-case it would be optimal to have some kind of continuous sampling with a given sampling rate (something slow, 1KHz…10Hz) that should be timed precise, so in the best case PRU only. Looking at “PruIo::config” I only see an option to sample a fixed amount of samples which means I would have to trigger another run manually from the host ARM-program. Is there a way to implement some kind of continuous sampling? If so, could someone point me in the right direction? Thanks :slight_smile:

Greetings
Thomas

Hi Thomas!

Check out the ring buffer mode. Find example code in rb_file (.c, .py, .bas) or rb_oszi (.bas).

Regards

I’m having an issue running the python examples.

I’m running the bone-debian-9.12-console image.
I’ve installed libpruio, python-pruio, libpruio-lkm, and libpruio-doc.
I copied the python-pruio examples into my home directory and try to run an example:

debian@beaglebone:~/src/pruio_examples$ python3 1.py Traceback (most recent call last): File "1.py", line 18, in <module> from libpruio import * File "/home/debian/src/pruio_examples/libpruio/__init__.py", line 1, in <module> from pruio import * ImportError: No module named 'pruio'

Is there something I’m missing?

I edited /boot/uEnv.txt:

`
###PRUSS OPTIONS
###pru_rproc (4.14.x-ti kernel)
#uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo
###pru_rproc (4.19.x-ti kernel)
#uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-19-TI-00A0.dtbo
###pru_uio (4.14.x-ti, 4.19.x-ti & mainline/bone kernel)
uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo

AFAIR the python interpreter (ctypes) also needs the dev-package to bind the library: libpruio-dev

Regards

I actually already had it installed. I tried running it again in python 2 without the uboot_overlay_pru modification and get this:

`
debian@beaglebone:~$ python src/pruio_examples/1.py
destructor warning: constructor failed
Traceback (most recent call last):
File “src/pruio_examples/1.py”, line 25, in
if IO.Errr: raise AssertionError(“pruio_new failed (%s)” % IO.Errr)
AssertionError: pruio_new failed (cannot open /dev/uio5)

`

Is python 3 not supported?

Is python 3 not supported?

AFAIR I tested on python 2 and 3.

The message

(cannot open /dev/uio5)

is related to the uio_pruss driver. The interupt handler is either not present (command lsmod doesn’t list uio_pruss, or command ls -l /dev/uio* has no output). Or you don’t have write access to that file.

In any case you need to load the adapted uEnv.txt (uboot_overlay_pru modification). And it’s also recommended to remove cape_universal=enable from the cmdline in order to get free pinmux access to all pins from user space.

Regards

I didn’t see cape_universal=enable in cmdline. I set uboot_overlay_pru to the UIO option. I also tried both commenting out enable_uboot_cape_universal=1 and just setting it to 0. I get the same error as before.

`
debian@beaglebone:~$ cat /boot/uEnv.txt
#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0

uname_r=4.14.108-ti-r136
#uuid=
#dtb=

###U-Boot Overlays###
###Documentation: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays
###Master Enable
enable_uboot_overlays=1

google groups has been strange. Looks like it has just updated and I don’t see how to include code tags.

debian@beaglebone:~$ python --version
Python 2.7.13
debian@beaglebone:~$ python3 --version
Python 3.5.3

Hi Andrew!

First, the boot process seems to be OK. The driver uio_pruss as well as the libpruio-lkm are loading.

`
Traceback (most recent call last):
File “src/pruio_examples/1.py”, line 25, in
if IO.Errr: raise AssertionError(“pruio_new failed (%s)” % IO.Errr)
AssertionError: pruio_new failed (parsing kernel claims)

`

This seems to be a kernel issue. Does the command cat /sys/kernel/debug/pinctrl/44e10800.pinmux/pinmux-pins print anything reasonable?

`
debian@beaglebone:~$ python3 src/pruio_examples/1.py
Traceback (most recent call last):
File “src/pruio_examples/1.py”, line 18, in
from libpruio import *
File “/home/debian/src/pruio_examples/libpruio/init.py”, line 1, in
from pruio import *
ImportError: No module named ‘pruio’

`

Here the python interpreter cannot find the file pruio.py in folder /home/debian/src/pruio_examples/libpruio/. But it should be present since python2 did find it. (Is there any difference between python2 and python3 regarding module import? Sorry, I'm not keen on python.)

Regards

PS: Google groups is really strange, it's a desaster!

``

I’m not sure what counts as reasonable.

debian@beaglebone:~$ sudo cat /sys/kernel/debug/pinctrl/44e10800.pinmux/pinmux-p
ins
Pinmux settings per pin
Format: pin (name): mux_owner gpio_owner hog?
pin 0 (PIN0): 481d8000.mmc (GPIO UNCLAIMED) function pinmux_emmc_pins group pinmux_emmc_pins
pin 1 (PIN1): 481d8000.mmc (GPIO UNCLAIMED) function pinmux_emmc_pins group pinmux_emmc_pins
pin 2 (PIN2): 481d8000.mmc (GPIO UNCLAIMED) function pinmux_emmc_pins group pinmux_emmc_pins
pin 3 (PIN3): 481d8000.mmc (GPIO UNCLAIMED) function pinmux_emmc_pins group pinmux_emmc_pins
pin 4 (PIN4): 481d8000.mmc (GPIO UNCLAIMED) function pinmux_emmc_pins group pinmux_emmc_pins
pin 5 (PIN5): 481d8000.mmc (GPIO UNCLAIMED) function pinmux_emmc_pins group pinmux_emmc_pins
pin 6 (PIN6): 481d8000.mmc (GPIO UNCLAIMED) function pinmux_emmc_pins group pinmux_emmc_pins
pin 7 (PIN7): 481d8000.mmc (GPIO UNCLAIMED) function pinmux_emmc_pins group pinmux_emmc_pins
pin 8 (PIN8): ocp:P8_19_pinmux (GPIO UNCLAIMED) function pinmux_P8_19_default_pin group pinmux_P8_19_default_pin
pin 9 (PIN9): ocp:P8_13_pinmux (GPIO UNCLAIMED) function pinmux_P8_13_default_pin group pinmux_P8_13_default_pin
pin 10 (PIN10): ocp:P8_14_pinmux (GPIO UNCLAIMED) function pinmux_P8_14_default_pin group pinmux_P8_14_default_pin
pin 11 (PIN11): ocp:P8_17_pinmux (GPIO UNCLAIMED) function pinmux_P8_17_default_pin group pinmux_P8_17_default_pin
pin 12 (PIN12): ocp:P8_12_pinmux (GPIO UNCLAIMED) function pinmux_P8_12_default_pin group pinmux_P8_12_default_pin
pin 13 (PIN13): ocp:P8_11_pinmux (GPIO UNCLAIMED) function pinmux_P8_11_default_pin group pinmux_P8_11_default_pin
pin 14 (PIN14): ocp:P8_16_pinmux (GPIO UNCLAIMED) function pinmux_P8_16_default_pin group pinmux_P8_16_default_pin
pin 15 (PIN15): ocp:P8_15_pinmux (GPIO UNCLAIMED) function pinmux_P8_15_default_pin group pinmux_P8_15_default_pin
pin 16 (PIN16): ocp:P9_15_pinmux (GPIO UNCLAIMED) function pinmux_P9_15_default_pin group pinmux_P9_15_default_pin
pin 17 (PIN17): ocp:P9_23_pinmux (GPIO UNCLAIMED) function pinmux_P9_23_default_pin group pinmux_P9_23_default_pin
pin 18 (PIN18): ocp:P9_14_pinmux (GPIO UNCLAIMED) function pinmux_P9_14_default_pin group pinmux_P9_14_default_pin
pin 19 (PIN19): ocp:P9_16_pinmux (GPIO UNCLAIMED) function pinmux_P9_16_default_pin group pinmux_P9_16_default_pin
pin 20 (PIN20): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 21 (PIN21): leds (GPIO UNCLAIMED) function user_leds_s0 group user_leds_s0
pin 22 (PIN22): leds (GPIO UNCLAIMED) function user_leds_s0 group user_leds_s0
pin 23 (PIN23): leds (GPIO UNCLAIMED) function user_leds_s0 group user_leds_s0
pin 24 (PIN24): leds (GPIO UNCLAIMED) function user_leds_s0 group user_leds_s0
pin 25 (PIN25): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 26 (PIN26): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 27 (PIN27): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 28 (PIN28): ocp:P9_11_pinmux (GPIO UNCLAIMED) function pinmux_P9_11_default_pin group pinmux_P9_11_default_pin
pin 29 (PIN29): ocp:P9_13_pinmux (GPIO UNCLAIMED) function pinmux_P9_13_default_pin group pinmux_P9_13_default_pin
pin 30 (PIN30): ocp:P9_12_pinmux (GPIO UNCLAIMED) function pinmux_P9_12_default_pin group pinmux_P9_12_default_pin
pin 31 (PIN31): ocp:P8_26_pinmux (GPIO UNCLAIMED) function pinmux_P8_26_default_pin group pinmux_P8_26_default_pin
pin 32 (PIN32): 481d8000.mmc (GPIO UNCLAIMED) function pinmux_emmc_pins group pinmux_emmc_pins
pin 33 (PIN33): 481d8000.mmc (GPIO UNCLAIMED) function pinmux_emmc_pins group pinmux_emmc_pins
pin 34 (PIN34): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 35 (PIN35): ocp:P8_18_pinmux (GPIO UNCLAIMED) function pinmux_P8_18_default_pin group pinmux_P8_18_default_pin
pin 36 (PIN36): ocp:P8_07_pinmux (GPIO UNCLAIMED) function pinmux_P8_07_default_pin group pinmux_P8_07_default_pin
pin 37 (PIN37): ocp:P8_08_pinmux (GPIO UNCLAIMED) function pinmux_P8_08_default_pin group pinmux_P8_08_default_pin
pin 38 (PIN38): ocp:P8_10_pinmux (GPIO UNCLAIMED) function pinmux_P8_10_default_pin group pinmux_P8_10_default_pin
pin 39 (PIN39): ocp:P8_09_pinmux (GPIO UNCLAIMED) function pinmux_P8_09_default_pin group pinmux_P8_09_default_pin
pin 40 (PIN40): ocp:P8_45_pinmux (GPIO UNCLAIMED) function pinmux_P8_45_default_pin group pinmux_P8_45_default_pin
pin 41 (PIN41): ocp:P8_46_pinmux (GPIO UNCLAIMED) function pinmux_P8_46_default_pin group pinmux_P8_46_default_pin
pin 42 (PIN42): ocp:P8_43_pinmux (GPIO UNCLAIMED) function pinmux_P8_43_default_pin group pinmux_P8_43_default_pin
pin 43 (PIN43): ocp:P8_44_pinmux (GPIO UNCLAIMED) function pinmux_P8_44_default_pin group pinmux_P8_44_default_pin
pin 44 (PIN44): ocp:P8_41_pinmux (GPIO UNCLAIMED) function pinmux_P8_41_default_pin group pinmux_P8_41_default_pin
pin 45 (PIN45): ocp:P8_42_pinmux (GPIO UNCLAIMED) function pinmux_P8_42_default_pin group pinmux_P8_42_default_pin
pin 46 (PIN46): ocp:P8_39_pinmux (GPIO UNCLAIMED) function pinmux_P8_39_default_pin group pinmux_P8_39_default_pin
pin 47 (PIN47): ocp:P8_40_pinmux (GPIO UNCLAIMED) function pinmux_P8_40_default_pin group pinmux_P8_40_default_pin
pin 48 (PIN48): ocp:P8_37_pinmux (GPIO UNCLAIMED) function pinmux_P8_37_default_pin group pinmux_P8_37_default_pin
pin 49 (PIN49): ocp:P8_38_pinmux (GPIO UNCLAIMED) function pinmux_P8_38_default_pin group pinmux_P8_38_default_pin
pin 50 (PIN50): ocp:P8_36_pinmux (GPIO UNCLAIMED) function pinmux_P8_36_default_pin group pinmux_P8_36_default_pin
pin 51 (PIN51): ocp:P8_34_pinmux (GPIO UNCLAIMED) function pinmux_P8_34_default_pin group pinmux_P8_34_default_pin
pin 52 (PIN52): ocp:P8_35_pinmux (GPIO UNCLAIMED) function pinmux_P8_35_default_pin group pinmux_P8_35_default_pin
pin 53 (PIN53): ocp:P8_33_pinmux (GPIO UNCLAIMED) function pinmux_P8_33_default_pin group pinmux_P8_33_default_pin
pin 54 (PIN54): ocp:P8_31_pinmux (GPIO UNCLAIMED) function pinmux_P8_31_default_pin group pinmux_P8_31_default_pin
pin 55 (PIN55): ocp:P8_32_pinmux (GPIO UNCLAIMED) function pinmux_P8_32_default_pin group pinmux_P8_32_default_pin
pin 56 (PIN56): ocp:P8_27_pinmux (GPIO UNCLAIMED) function pinmux_P8_27_default_pin group pinmux_P8_27_default_pin
pin 57 (PIN57): ocp:P8_29_pinmux (GPIO UNCLAIMED) function pinmux_P8_29_default_pin group pinmux_P8_29_default_pin
pin 58 (PIN58): ocp:P8_28_pinmux (GPIO UNCLAIMED) function pinmux_P8_28_default_pin group pinmux_P8_28_default_pin
pin 59 (PIN59): ocp:P8_30_pinmux (GPIO UNCLAIMED) function pinmux_P8_30_default_pin group pinmux_P8_30_default_pin
pin 60 (PIN60): 48060000.mmc (GPIO UNCLAIMED) function pinmux_mmc1_pins group pinmux_mmc1_pins
pin 61 (PIN61): 48060000.mmc (GPIO UNCLAIMED) function pinmux_mmc1_pins group pinmux_mmc1_pins
pin 62 (PIN62): 48060000.mmc (GPIO UNCLAIMED) function pinmux_mmc1_pins group pinmux_mmc1_pins
pin 63 (PIN63): 48060000.mmc (GPIO UNCLAIMED) function pinmux_mmc1_pins group pinmux_mmc1_pins
pin 64 (PIN64): 48060000.mmc (GPIO UNCLAIMED) function pinmux_mmc1_pins group pinmux_mmc1_pins
pin 65 (PIN65): 48060000.mmc (GPIO UNCLAIMED) function pinmux_mmc1_pins group pinmux_mmc1_pins
pin 66 (PIN66): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 67 (PIN67): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 68 (PIN68): 4a100000.ethernet (GPIO UNCLAIMED) function cpsw_default group cpsw_default
pin 69 (PIN69): 4a100000.ethernet (GPIO UNCLAIMED) function cpsw_default group cpsw_default
pin 70 (PIN70): 4a100000.ethernet (GPIO UNCLAIMED) function cpsw_default group cpsw_default
pin 71 (PIN71): 4a100000.ethernet (GPIO UNCLAIMED) function cpsw_default group cpsw_default
pin 72 (PIN72): 4a100000.ethernet (GPIO UNCLAIMED) function cpsw_default group cpsw_default
pin 73 (PIN73): 4a100000.ethernet (GPIO UNCLAIMED) function cpsw_default group cpsw_default
pin 74 (PIN74): 4a100000.ethernet (GPIO UNCLAIMED) function cpsw_default group cpsw_default
pin 75 (PIN75): 4a100000.ethernet (GPIO UNCLAIMED) function cpsw_default group cpsw_default
pin 76 (PIN76): 4a100000.ethernet (GPIO UNCLAIMED) function cpsw_default group cpsw_default
pin 77 (PIN77): 4a100000.ethernet (GPIO UNCLAIMED) function cpsw_default group cpsw_default
pin 78 (PIN78): 4a100000.ethernet (GPIO UNCLAIMED) function cpsw_default group cpsw_default
pin 79 (PIN79): 4a100000.ethernet (GPIO UNCLAIMED) function cpsw_default group cpsw_default
pin 80 (PIN80): 4a100000.ethernet (GPIO UNCLAIMED) function cpsw_default group cpsw_default
pin 81 (PIN81): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 82 (PIN82): 4a101000.mdio (GPIO UNCLAIMED) function davinci_mdio_default group davinci_mdio_default
pin 83 (PIN83): 4a101000.mdio (GPIO UNCLAIMED) function davinci_mdio_default group davinci_mdio_default
pin 84 (PIN84): ocp:P9_22_pinmux (GPIO UNCLAIMED) function pinmux_P9_22_default_pin group pinmux_P9_22_default_pin
pin 85 (PIN85): ocp:P9_21_pinmux (GPIO UNCLAIMED) function pinmux_P9_21_default_pin group pinmux_P9_21_default_pin
pin 86 (PIN86): ocp:P9_18_pinmux (GPIO UNCLAIMED) function pinmux_P9_18_default_pin group pinmux_P9_18_default_pin
pin 87 (PIN87): ocp:P9_17_pinmux (GPIO UNCLAIMED) function pinmux_P9_17_default_pin group pinmux_P9_17_default_pin
pin 88 (PIN88): 48060000.mmc (GPIO UNCLAIMED) function pinmux_mmc1_pins group pinmux_mmc1_pins
pin 89 (PIN89): ocp:P9_42_pinmux (GPIO UNCLAIMED) function pinmux_P9_42_default_pin group pinmux_P9_42_default_pin
pin 90 (PIN90): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 91 (PIN91): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 92 (PIN92): 44e09000.serial (GPIO UNCLAIMED) function pinmux_uart0_pins group pinmux_uart0_pins
pin 93 (PIN93): 44e09000.serial (GPIO UNCLAIMED) function pinmux_uart0_pins group pinmux_uart0_pins
pin 94 (PIN94): ocp:P9_20_pinmux (GPIO UNCLAIMED) function pinmux_P9_20_default_pin group pinmux_P9_20_default_pin
pin 95 (PIN95): ocp:P9_19_pinmux (GPIO UNCLAIMED) function pinmux_P9_19_default_pin group pinmux_P9_19_default_pin
pin 96 (PIN96): ocp:P9_26_pinmux (GPIO UNCLAIMED) function pinmux_P9_26_default_pin group pinmux_P9_26_default_pin
pin 97 (PIN97): ocp:P9_24_pinmux (GPIO UNCLAIMED) function pinmux_P9_24_default_pin group pinmux_P9_24_default_pin
pin 98 (PIN98): 44e0b000.i2c (GPIO UNCLAIMED) function pinmux_i2c0_pins group pinmux_i2c0_pins
pin 99 (PIN99): 44e0b000.i2c (GPIO UNCLAIMED) function pinmux_i2c0_pins group pinmux_i2c0_pins
pin 100 (PIN100): ocp:P9_31_pinmux (GPIO UNCLAIMED) function pinmux_P9_31_default_pin group pinmux_P9_31_default_pin
pin 101 (PIN101): ocp:P9_29_pinmux (GPIO UNCLAIMED) function pinmux_P9_29_default_pin group pinmux_P9_29_default_pin
pin 102 (PIN102): ocp:P9_30_pinmux (GPIO UNCLAIMED) function pinmux_P9_30_default_pin group pinmux_P9_30_default_pin
pin 103 (PIN103): ocp:P9_28_pinmux (GPIO UNCLAIMED) function pinmux_P9_28_default_pin group pinmux_P9_28_default_pin
pin 104 (PIN104): ocp:P9_92_pinmux (GPIO UNCLAIMED) function pinmux_P9_92_default_pin group pinmux_P9_92_default_pin
pin 105 (PIN105): ocp:P9_27_pinmux (GPIO UNCLAIMED) function pinmux_P9_27_default_pin group pinmux_P9_27_default_pin
pin 106 (PIN106): ocp:P9_91_pinmux (GPIO UNCLAIMED) function pinmux_P9_91_default_pin group pinmux_P9_91_default_pin
pin 107 (PIN107): ocp:P9_25_pinmux (GPIO UNCLAIMED) function pinmux_P9_25_default_pin group pinmux_P9_25_default_pin
pin 108 (PIN108): ocp:A15_pinmux (GPIO UNCLAIMED) function pinmux_A15_default_pin group pinmux_A15_default_pin
pin 109 (PIN109): ocp:P9_41_pinmux (GPIO UNCLAIMED) function pinmux_P9_41_default_pin group pinmux_P9_41_default_pin
pin 110 (PIN110): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 111 (PIN111): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 112 (PIN112): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 113 (PIN113): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 114 (PIN114): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 115 (PIN115): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 116 (PIN116): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 117 (PIN117): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 118 (PIN118): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 119 (PIN119): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 120 (PIN120): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 121 (PIN121): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 122 (PIN122): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 123 (PIN123): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 124 (PIN124): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 125 (PIN125): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 126 (PIN126): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 127 (PIN127): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 128 (PIN128): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 129 (PIN129): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 130 (PIN130): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 131 (PIN131): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 132 (PIN132): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 133 (PIN133): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 134 (PIN134): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 135 (PIN135): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 136 (PIN136): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 137 (PIN137): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 138 (PIN138): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 139 (PIN139): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 140 (PIN140): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 141 (PIN141): (MUX UNCLAIMED) (GPIO UNCLAIMED)

I’m not sure about the differences between importing in python 2 vs 3. I’ll look into it more. I did try running python3 interactively in the libpruio directory and tried an import directly.

debian@beaglebone:~/src/pruio_examples/libpruio$ ls
init.py pycache ctypesloader.pyc pruio.pyc
init.pyc ctypesloader.py pruio.py
debian@beaglebone:~/src/pruio_examples/libpruio$ python3
Python 3.5.3 (default, Jul 9 2020, 13:00:10)
[GCC 6.3.0 20170516] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

import pruio
Traceback (most recent call last):
File “”, line 1, in
File “/home/debian/src/pruio_examples/libpruio/pruio.py”, line 3, in
from ctypesloader import *
File “/home/debian/src/pruio_examples/libpruio/ctypesloader.py”, line 375
except OSError,e:
^
SyntaxError: invalid syntax

I think that line should read “except OSError as e:” to be valid python 3. I changed that and got another error.

debian@beaglebone:~/src/pruio_examples/libpruio$ vim ctypesloader.py
debian@beaglebone:~/src/pruio_examples/libpruio$ python3
Python 3.5.3 (default, Jul 9 2020, 13:00:10)
[GCC 6.3.0 20170516] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

import pruio
Traceback (most recent call last):
File “”, line 1, in
File “/home/debian/src/pruio_examples/libpruio/pruio.py”, line 3, in
from ctypesloader import *
File “/home/debian/src/pruio_examples/libpruio/ctypesloader.py”, line 48, in
class UserString:
File “/home/debian/src/pruio_examples/libpruio/ctypesloader.py”, line 100, in UserString
def count(self, sub, start=0, end=sys.maxint):
AttributeError: module ‘sys’ has no attribute ‘maxint’

The pinmux-pins output is reasonable. Do you have read access to the file from user space?

Regarding the errors in ctypesloader.py: this isn’t my code. I just reduced code from the ctypes documentation to the bare minimum. Perhaps you can try the original file?

Regards

https://stackoverflow.com/questions/13795758/what-is-sys-maxint-in-python-3

  Short answer: Python 3 unified the logic of native ints vs Python 2
"longints"; they automatically roll over to a longint if incremented far
enough. As a result, there isn't really a "maxint" anymore.

  I'd suggest running the entire library through the 2 to 3 conversion
process.

https://docs.python.org/3.8/library/2to3.html
"""
except
    Converts except X, T to except X as T.

        <SNIP>

renames
    Changes sys.maxint to sys.maxsize.
"""

handle both of the cases you have encountered. There are MANY other changes
that may apply.

I do not.

debian@beaglebone:~$ cat /sys/kernel/debug/pinctrl/44e10800.pinmux/pinmux-pins
cat: /sys/kernel/debug/pinctrl/44e10800.pinmux/pinmux-pins: Permission denied

I did some testing here on a similar system:

$ uname -r
4.14.69-ti-r76
$ python 1.py
F800 E9C0 F3B0 8230 5370 9830 B450 F2B0
F910 EEC0 F540 C600 9BA0 9230 9830 F2F0
F920 EEE0 F500 CC90 ABC0 A190 9FB0 F2E0
F960 EF20 F4B0 CDA0 AEF0 A6D0 A440 F2B0
F960 EEA0 F510 CDB0 B240 ACF0 AAF0 F300
F910 EEF0 F4E0 CDE0 B310 AEC0 AE50 F310
F960 EF00 F4D0 CDE0 B360 AF60 AFF0 F2F0
F980 EEF0 F500 CDC0 B340 B000 B0A0 F2E0
F960 EF20 F550 CE70 B4F0 B1F0 B330 F320
F950 EF00 F4E0 CED0 B530 B280 B480 F310
F980 EEE0 F4F0 CED0 B530 B300 B480 F2F0
F920 EEF0 F500 CE40 B4D0 B250 B410 F310
F940 EF00 F4D0 CE30 B450 B170 B340 F2C0
$ python3 1.py
Traceback (most recent call last):
File “1.py”, line 18, in
from libpruio import *
File “/home/debian/Projekte/libpruio/src/python/libpruio/init.py”, line 1, in
from pruio import *
ImportError: No module named ‘pruio’

$ ls -l /sys/kernel/debug/pinctrl/44e10800.pinmux/pinmux-pins
-rw-rw-r-- 1 root gpio 0 Jan 1 1970 /sys/kernel/debug/pinctrl/44e10800.pinmux/pinmux-pins
$ cat /sys/kernel/debug/pinctrl/44e10800.pinmux/pinmux-pins
Pinmux settings per pin
Format: pin (name): mux_owner gpio_owner hog?
pin 0 (PIN0): 481d8000.mmc (GPIO UNCLAIMED) function pinmux_emmc_pins group pinmux_emmc_pins
pin 1 (PIN1): 481d8000.mmc (GPIO UNCLAIMED) function pinmux_emmc_pins group pinmux_emmc_pins
pin 2 (PIN2): 481d8000.mmc (GPIO UNCLAIMED) function pinmux_emmc_pins group pinmux_emmc_pins
pin 3 (PIN3): 481d8000.mmc (GPIO UNCLAIMED) function pinmux_emmc_pins group pinmux_emmc_pins
…

python2 works, python3 doesn’t.

The file pinmux-pins is acessable for users of group gpio on my system. In your output the lines containing ocp:Px_xx_pinmux indicate that the cape-universal device-tree blob is loaded and claims the pins. Try enable_uboot_cape_universal=0 in uEnv.txt.

Regards

I forgot:

I set enable_uboot_cape_universal=0 and I have the same result. My permissions for pinmux-pins looks much different than yours.

debian@beaglebone:~$ ls -l /sys/kernel/debug/pinctrl/44e10800.pinmux/pinmux-pins
ls: cannot access ‘/sys/kernel/debug/pinctrl/44e10800.pinmux/pinmux-pins’: Permission denied
debian@beaglebone:~$ sudo ls -l /sys/kernel/debug/pinctrl/44e10800.pinmux/pinmux-pins
-r–r--r-- 1 root root 0 Jan 1 1970 /sys/kernel/debug/pinctrl/44e10800.pinmux/pinmux-pins

I’ll try a different kernel.