Hi,
I would like to use my Raspberry Pi 4 for some GPIO hardware experiments. I am using the pigpio C library and have an otherwise well working NixOS installed on the Raspberry. Trying to execute any pigpio stuff fails with initPeripherals: mmap gpio failed (Operation not permitted)
. There was an issue with the pigpio library on 64 bit linux kernels (see here), but using a recent version and setting iomem=relaxed
and strict-devmem=0
in cmdline.txt
seems to do the trick for the people there. I have a configuration.nix
with
boot = {
loader = {
# Use the extlinux bootloader instead of Grub.
grub.enable = false;
generic-extlinux-compatible.enable = true;
raspberryPi = {
enable = true;
version = 4;
# Stuff that goes into /boot/config.txt
firmwareConfig = ''
iomem=relaxed
strict-devmem=0
'';
};
};
boot.initrd.availableKernelModules = [ "usbhid" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems = {
"/" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
};
};
but unfortunately firmwareConfig
does not seem to help. Was anyone able to get the GPIO ports on the Raspberry Pi 4 working or could give me any hint how to solve this problem?
Best wishes
Phillip