Closed lbernstone closed 5 years ago
Yes if you use WiringPi for the mainline kernel that has support for m2z. WiringPi from Rpi check for hardware compatibility and you need to disable this "check" in the code. There may be other changes needed. Check the differences here: https://github.com/BPI-SINOVOIP/BPI-WiringPi2
Hi @lbernstone,
You can just compile it from source then append these line to /etc/environment
BOARD=bpi-m2z
BOARD_AUTO=bpi-m2z
BOARD_OLD=bpi-m64
And the next problem is I can't compile it properly using
gcc -Wall -o blink blink.c -lwiringPi
ubuntu@bpi-m2z:~/test$ gcc blink.c -o blink -lwiringPi
/usr/lib/gcc/arm-linux-gnueabihf/5/../../../../lib/libwiringPi.so: undefined reference to `crypt'
/usr/lib/gcc/arm-linux-gnueabihf/5/../../../../lib/libwiringPi.so: undefined reference to `rint'
/usr/lib/gcc/arm-linux-gnueabihf/5/../../../../lib/libwiringPi.so: undefined reference to `pthread_join'
/usr/lib/gcc/arm-linux-gnueabihf/5/../../../../lib/libwiringPi.so: undefined reference to `pthread_create'
/usr/lib/gcc/arm-linux-gnueabihf/5/../../../../lib/libwiringPi.so: undefined reference to `pow'
/usr/lib/gcc/arm-linux-gnueabihf/5/../../../../lib/libwiringPi.so: undefined reference to `shm_open'
/usr/lib/gcc/arm-linux-gnueabihf/5/../../../../lib/libwiringPi.so: undefined reference to `pthread_cancel'
collect2: error: ld returned 1 exit status
I have to link few header manually like this:
gcc blink.c -o blink -lwiringPi -lpthread -lcrypt -lm -lrt -lcrypt
Cheers!
I am able to compile wiringPi (and don't get the linker error), but it does not actually change the pin states. I run gpio readall
, and it shows me all the pins set as INPUTs. I try to set a pin to OUTPUT as root (I did a for x in {1..277} just to be thorough), and then when I read the state again, nothing has changed.
@xqdzn You were on the right track, but wrong location. It looks in /var/lib/bananapi/board.sh for the info:
BOARD=bpi-m2z
BOARD_AUTO=bpi-m2z
BOARD_OLD=bpi-m64
Now to figure out how to get rpi.gpio to work for a user :smile:
Is it possible to use WiringPi or RPi.GPIO with your images?