NixOS on ARM/Raspberry Pi 4: Difference between revisions

Pulkits (talk | contribs)
Added instructions for getting bluetooth atleast usable
Adjust to correct SPI device tree options
Line 186: Line 186:
After applying the overlay, we add an <code>spi</code> group and change the owner of the <code>spidev</code> device to it, similarly to [[#Using GPIO pins as non root |GPIO]].
After applying the overlay, we add an <code>spi</code> group and change the owner of the <code>spidev</code> device to it, similarly to [[#Using GPIO pins as non root |GPIO]].


<syntaxHighlight lang="nix">
<syntaxhighlight lang="nix">
hardware.raspberry-pi."4".apply-overlays-dtmerge.enable = true;
hardware.raspberry-pi."4".apply-overlays-dtmerge.enable = true;
hardware.deviceTree = {
hardware.deviceTree = {
Line 194: Line 194:
     {
     {
       name = "spi";
       name = "spi";
       dtsoFile = ./spi0-0cd.dtso;
       dtboFile = ./spi0-0cs.dtbo;
     }
     }
   ];
   ];
Line 204: Line 204:
   SUBSYSTEM=="spidev", KERNEL=="spidev0.0", GROUP="spi", MODE="0660"
   SUBSYSTEM=="spidev", KERNEL=="spidev0.0", GROUP="spi", MODE="0660"
'';
'';
</syntaxHighlight>
</syntaxhighlight>


The the <code>spi0-0cd.dtso</code> file can be downloaded [https://github.com/raspberrypi/firmware/blob/master/boot/overlays/spi0-0cs.dtbo here].
The the <code>spi0-0cd.dtso</code> file can be downloaded [https://github.com/raspberrypi/firmware/blob/master/boot/overlays/spi0-0cs.dtbo here].