You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using this module on a Pi running a 64-bit Linux distro (eg Ubuntu 18.04 arm64) errors out when you call setup().
Error: Unable to match Revision in /proc/cpuinfo: processor : 0
BogoMIPS : 38.40
Features : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 1
BogoMIPS : 38.40
Features : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 2
BogoMIPS : 38.40
Features : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 3
BogoMIPS : 38.40
Features : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
This happens because /proc/cpuinfo does not contain the expected Revision: … line under 64-bit Linux.
To test, I followed this advice, bind-mounting a fake cpuinfo file on /proc/cpuinfo and adding Revision: a02082. With this, the rpi-gpio library started working.
It appears the correct place to look on a 64-bit system is /proc/device-tree/system/linux,revision.
It looks like at the very least, it's a bug that it assumes the value of /proc/cpuinfo. It shouldn't break. At the moment I'm thinking that a patch to ensure it doesn't break, and to default to the v2 schema when it couldn't find the info, would be a good basic fix.
Reading /proc/device-tree could then be a second phase enhancement. I'm just wondering if it's worth doing given that it looks like that version of Ubuntu only supports Pi 2 and above anyway, which would all use the v2 schema. I'm not very familiar with these alternative OS's for the Pi, so am a bit unsure whether this functionality would be useful, and whether Device Tree would always be available anyway.
Using this module on a Pi running a 64-bit Linux distro (eg Ubuntu 18.04 arm64) errors out when you call
setup()
.(thrown here)
This happens because
/proc/cpuinfo
does not contain the expectedRevision: …
line under 64-bit Linux.To test, I followed this advice, bind-mounting a fake cpuinfo file on
/proc/cpuinfo
and addingRevision: a02082
. With this, the rpi-gpio library started working.It appears the correct place to look on a 64-bit system is
/proc/device-tree/system/linux,revision
.(unsure if 32-bit systems have the same thing)
The text was updated successfully, but these errors were encountered: