NixOS on ARM/Raspberry Pi 3: Difference between revisions

imported>Fuu0
No edit summary
imported>Justinas
No edit summary
Line 94: Line 94:


If the Raspberry Pi downstream kernel is used the serial interface is named <code>serial0</code> instead.
If the Raspberry Pi downstream kernel is used the serial interface is named <code>serial0</code> instead.
=== Early boot ===
Raspberry Pi 3's UART rate is tied to the GPU core frequency, set by default to 400MHz on Raspberry Pi 3 and later. This results in garbled serial output in bootloaders. Setting <code>core_freq=250</code> in <code>config.txt</code> solves this issue (as per [https://forums.raspberrypi.com/viewtopic.php?p=942203#p942203 thread on the Raspberry Pi forum]).
It can be done declaratively as such:
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{ config, pkgs, lib, ... }:
{
  boot.loader.raspberryPi = {
    enable = true;
    version = 3;
    firmwareConfig = ''
      core_freq=250
    '';
  };
}
</nowiki>}}
Note that this [https://github.com/RealVNC/raspi-documentation/blob/fc6b4711f91791db7acd19ae743fcfddc9c89546/configuration/config-txt/overclocking.md#overclocking-options may have a negative impact on performance]:
<blockquote>Frequency of the GPU processor core in MHz. It has an impact on CPU performance because it drives the L2 cache and memory bus.</blockquote>


== Bluetooth ==
== Bluetooth ==