树莓派3使用openSUSE Ports 42.3 驱动GPIO注意事项

安装好opensuse 42.3之后,安装wiringPi库。php

因为/proc/cpuinfo文件缺乏“Hardware”信息,致使出现以下错误:linux

Oops: Unable to determine board revision from /proc/cpuinfo
 -> No "Hardware" line
 ->  You'd best google the error to find out why.

所以,咱们须要自制一个cpuinfo文件,替换wiringPi/wiringPi.c和wiringPi/build 两个文件中全部“/proc/cpuinfo"。(/proc/cpuinfo替换为/root/Downloads/wiringPi/cpuinfo)centos

自制cpuinfo文件内容以下:ui

linux:~ # cat /root/Downloads/wiringPi/cpuinfo processor : 0 model name : ARMv7 Processor rev 4 (v7l) BogoMIPS : 38.40 Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x0 CPU part : 0xd03 CPU revision : 4 processor : 1 model name : ARMv7 Processor rev 4 (v7l) BogoMIPS : 38.40 Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x0 CPU part : 0xd03 CPU revision : 4 processor : 2 model name : ARMv7 Processor rev 4 (v7l) BogoMIPS : 38.40 Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x0 CPU part : 0xd03 CPU revision : 4 processor : 3 model name : ARMv7 Processor rev 4 (v7l) BogoMIPS : 38.40 Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x0 CPU part : 0xd03 CPU revision : 4 Hardware : BCM2709 Revision : a22082 Serial : 00000000fcc1f2f9

经过此次的折腾,发现另一个问题,openSUSE 15中GPIO不能正常工做。参考以下google

https://bugs.centos.org/view.php?id=13734spa

暂时不知道怎么解决这个问题,目前只能在4.4内核使用GPIO,不然会出现以下错误:code

wiringPiSetup: mmap (GPIO) failed: Operation not permittedit

相关文章
相关标签/搜索