PINE64
Python GPIOs - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PINE A64(+) (https://forum.pine64.org/forumdisplay.php?fid=4)
+--- Forum: Pine A64 Hardware, Accessories and POT (https://forum.pine64.org/forumdisplay.php?fid=32)
+---- Forum: Pi2, Euler and Exp GPIO Ports (https://forum.pine64.org/forumdisplay.php?fid=34)
+---- Thread: Python GPIOs (/showthread.php?tid=647)



Python GPIOs - martinayotte - 04-14-2016

I wished to control GPIO with python !
I've tried to use the same library I'm used to on A20, so, I've copied pyA20-0.2.1 from my Olimex board into my PinA64.
Compile it and try it out ... Segmentation fault !
Digging with GDB, I've figured it out : some pointers were 32bits while we are now on 64bits plateform !

Here are the changes to achieve :


Code:
root@pineA64:~# diff pyA20-0.2.1/pyA20/gpio/gpio_lib.c~ pyA20-0.2.1/pyA20/gpio/gpio_lib.c
67c67
<     SUNXI_PIO_BASE = (unsigned int) pc;
---
>     SUNXI_PIO_BASE = (unsigned long) pc;
root@pineA64:~# diff pyA20-0.2.1/pyA20/gpio/gpio_lib.h~ pyA20-0.2.1/pyA20/gpio/gpio_lib.h
123c123
< extern unsigned int SUNXI_PIO_BASE;
---
> extern unsigned long SUNXI_PIO_BASE;



RE: Python GPIOs - tkaiser - 04-15-2016

Please consider opening an account over at linux-sunxi, collect these valuable information there -- eg. using http://linux-sunxi.org/User:Martinayotte -- and link from here to there. Forum posts get lost so fast.


RE: Python GPIOs - martinayotte - 04-15-2016

(04-15-2016, 09:12 AM)tkaiser Wrote: Please consider opening an account over at linux-sunxi, collect these valuable information there -- eg. using http://linux-sunxi.org/User:Martinayotte -- and link from here to there. Forum posts get lost so fast.

Done ! Tongue

(I'm member of so many forums now ...)


RE: Python GPIOs - peterz - 04-15-2016

(04-15-2016, 02:22 PM)martinayotte Wrote:
(04-15-2016, 09:12 AM)tkaiser Wrote: Please consider opening an account over at linux-sunxi, collect these valuable information there -- eg. using http://linux-sunxi.org/User:Martinayotte -- and link from here to there. Forum posts get lost so fast.

Done ! Tongue

(I'm member of so many forums now ...)
Thanks for raising this up. I'm also interested in controlling variable sensors and devices with PINE but mine will arrive in MAY. Sad
Also thanks to raising the request for UARTs. I'm going to use all 6 UARTs (if I succeed) on PINE.