NixOS on ARM/ODROID-HC4: Difference between revisions

imported>Artemislena
Updated the U-Boot build, which means SATA is working, also added information on the fan
imported>Erdnaxe
Link to nixos-hardware
 
(5 intermediate revisions by 2 users not shown)
Line 8: Line 8:
|-
|-
!Architecture
!Architecture
|ARMv7
|AArch64
|-
|-
!Bootloader
!Bootloader
Line 14: Line 14:
|-
|-
!Boot options
!Boot options
|SD (SATA?)
|microSD (SATA?)
|}
|}
</div>
</div>
Line 45: Line 45:
=== NixOS installation ===
=== NixOS installation ===


# First follow the [[NixOS_on_ARM#Installation|generic installation steps]] to get the '''21.05 (Latest kernel)''' installer image.
# First follow the [[NixOS_on_ARM#Installation|generic installation steps]] to get the latest stable installer image.
# Uncompress the .zst file. One may use the <code>unzstd</code> command (equivalent to <code>zstd -d</code>) on supported machines. The zstd commands can be accessed from the <code>zstd</code> package.
# Uncompress the .zst file. One may use the <code>unzstd</code> command (equivalent to <code>zstd -d</code>) on supported machines. The zstd commands can be accessed from the <code>zstd</code> package.
# Patch this image (.img file) with U-Boot for Odroid HC4. <syntaxhighlight lang="bash">
# Patch this image (.img file) with U-Boot for Odroid HC4. <syntaxhighlight lang="bash">
Line 57: Line 57:


== Known issues ==
== Known issues ==
=== Fan doesn't work by default ===
=== Fan doesn't work by default ===
You need to use software fan control (via <syntaxhighlight>fancontrol</syntaxhighlight>) for this. Add the following to your <syntaxhighlight>configuration.nix</syntaxhighlight>:
You need to use software fan control (via <code>fancontrol</code>) for this.
<syntaxhighlight>
You may refer to [[https://github.com/NixOS/nixos-hardware/blob/master/hardkernel/odroid-hc4/default.nix nixos-hardware Odroid HC4 module]] for <code>fancontrol</code> configuration.
# Based on the config from https://www.armbian.com/odroid-hc4/. Made MINTEMP and MAXTEMP a bit more relaxed so the fan doesn't run on idle.
 
hardware.fancontrol = {
== No HDMI audio by default ==
    enable = true;
 
    config = ''
After enabling ALSA you should see a sound card named "ODROID-HC4". Audio is not correctly routed by default so you might need to open alsa-mixer and change:
    INTERVAL=10
* <code>FRDDR_A SINK 1 SEL</code> to <code>OUT 1</code>
    DEVPATH=hwmon0=devices/virtual/thermal/thermal_zone0 hwmon2=devices/platform/pwm-fan
* <code>FRDDR_A SRC 1 EN</code> to on
    DEVNAME=hwmon0=cpu_thermal hwmon2=pwmfan
* <code>TDMOUT_B SRC SEL</code> to <code>IN 0</code>
    FCTEMPS=hwmon2/pwm1=hwmon0/temp1_input
* <code>TOHDMITX</code> to on
    MINTEMP=hwmon2/pwm1=55
* <code>TOHDMITX I2S SRC</code> to <code>I2S B</code>
    MAXTEMP=hwmon2/pwm1=65
 
    MINSTART=hwmon2/pwm1=20
After these changes, <code>speaker-test -c 2</code> should output white noise.
    MINSTOP=hwmon2/pwm1=28
    MINPWM=hwmon2/pwm1=0
    MAXPWM=hwmon2/pwm1=255
    '';
};
</syntaxhighlight>


== Resources ==
== Resources ==