I wrote a program in C which uses the gpio pins on a Raspberry Pi. When I wrote the program, it ran fine on Ubuntu 18.04 armhf (32 bit). Now, however, on my Raspberry pi 4, running Ubuntu 20.04 arm64, I get the following error when running with sudo:
initPeripherals: mmap gpio failed (Operation not permitted)
As I understand it, this error is a result of the kernel being compiled with the option
How can I fix this problem, without recompiling my kernel? I have tried setting iomem=relaxed and strict-devmem=0 to no avail. I have also tried adding rules to /etc/udev/rules.d/ which doesn’t seem to work either. Also, I have tried changing group membership around, but again, I’m running this as root with sudo.
Edit: 18.04 arm64 kernel works just fine. I guess I’ll be content with that.