[A64] Access of all GPIO with pyA64 (extension connector)

Started by oli_sbr, January 18, 2021, 07:42:40 PM

Previous topic - Next topic

oli_sbr

Hello,

Using https://pypi.org/project/pyA64/ project, I am able to drive some GPIO (PE port)

The problem is I can't drive PB0 to PB4. The pins are not listed in the lib.
If I use the manual adress for PB0 to PB4, I still can not drive this ports.

Side note: PL port is said to not be accessible in user space. If I still want to access this port, what is the method ?

Thanks.

LubOlimex

What Linux image are you using? Is it the latest Olimage image?

What does:

uname -a

returns.
Technical support and documentation manager at Olimex

oli_sbr

Hi Lub,

Olimage version A64-OLinuXino-bionic-base-20201217-194545.img

Kernel:
Linux a64-olinuxino 5.8.18-olimex #122632 SMP Wed Dec 16 12:28:30 UTC 2020 aarch64 aarch64 aarch64 GNU/Linux

My script to trigger PB3 (note it works with PE17 attached to the LED):

from pyA64.gpio import gpio
from pyA64.gpio import port

#led = port.PE17

#try to set PB3
#pin = (ord('B')-ord('A'))*32+3
pin = (2-1)*32+3

gpio.init()

gpio.setcfg(pin, gpio.OUTPUT)
gpio.output(pin, 1)

pyA64 version 0.1.0

Tested with a scope on pin PB3

thanks

kalata23

Quote from: oli_sbr on January 19, 2021, 11:40:31 AMHi Lub,

Olimage version A64-OLinuXino-bionic-base-20201217-194545.img

Kernel:
Linux a64-olinuxino 5.8.18-olimex #122632 SMP Wed Dec 16 12:28:30 UTC 2020 aarch64 aarch64 aarch64 GNU/Linux

My script to trigger PB3 (note it works with PE17 attached to the LED):

from pyA64.gpio import gpio
from pyA64.gpio import port

#led = port.PE17

#try to set PB3
#pin = (ord('B')-ord('A'))*32+3
pin = (2-1)*32+3

gpio.init()

gpio.setcfg(pin, gpio.OUTPUT)
gpio.output(pin, 1)

pyA64 version 0.1.0

Tested with a scope on pin PB3

thanks

Can you execute "olinuxino-overlays" command and tell us, if uart2 overlay is enabled?
 

oli_sbr

uart2 is disabled.
I also disabled LCD and I2C0 overlay, it changes nothing.

oli_sbr

Update:

Using A64-OLinuXino-bionic-base-20201217-194545.img

I was able to drive the pins I wanted, using sysfs (read / write in /sys/class/gpio*).

So I think the issue is in the pyA64 project, and not in the kernel config or overlays.

LubOlimex

Thanks for the update I was going to test with the sysfs today. The pyA64 project was made for Armbian images and I don't think it was recently updated, probably it is not compatible with latest Olimage images.
Technical support and documentation manager at Olimex

oli_sbr

OK.

More info that might help other people.

I am using Buildroot as final tool to generate the system.
Since sysfs is deprecated, I am using libgpiod that is available for buildroot.

https://github.com/brgl/libgpiod


Works like a charm  :)