04-14-2016, 07:23 PM
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 :
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;