apu

motivation

a few months back i’ve replaced the odroid XU4 with this APU 2c4 board.

installing nixos

first have a look into the apu2 manual.

since there is no VGA/DVI output but only a RS232 serial interface we need to use that:

serial cable out of simplicity i soldered one myself, the pins are: pin 2 to pin 3 pin 3 to pin 2 pin 5 to pin 5 (GND) i’ve been using this with a USB 2 RS232 converter # lsusb Bus 003 Device 003: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port connecting via serial console: picocom /dev/ttyUSB0 -b 115200 nixos boot cd download the nixos-minimal-16.03.714.69420c5-x86_64-linux.iso and use unetbootin to deploy it to an USB stick. afterwards mount the first partition of the USB-stick and append this to the syslinux.cfg file’s kernel command line: console=ttyS0,115200n8 info: using the serial console you can see the GRUB output, see the kernel’s output after boot and finally get a shell. booting from the USB stick the apu 2c4 features corebios and the process is straight forward, just hit F10 and select the USB stick nixos installation basically follow the nixos manual info: but don’t forget to include this line in configuration.nix : boot.kernelParams = [ "console=ttyS0,115200n8" ];

/etc/nixos/configuration.nix

# Edit this configuration file to define what should be installed on # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). { config, pkgs, ... }: let = import . / passwords.nix ; pwpasswords.nix in # setfacl -R -m u:joachim:rwx /backup { = imports [ # Include the results of the hardware scan. . / hardware - configuration.nix hardwareconfiguration.nix ] ; # Use the GRUB 2 boot loader. = true ; boot.loader.grub.enabletrue = 2 ; boot.loader.grub.version # Define on which hard drive you want to install Grub. = "/dev/sda" ; boot.loader.grub.device = [ "console=ttyS0,115200n8" ] ; boot.kernelParams = { networking = "apu-nixi" ; # Define your hostname. hostName = [ "enp1s0" "wlp4s0" ] ; bridges.br0.interfaces = { firewall = true ; enabletrue = true ; allowPingtrue = [ 22 ] ; allowedTCPPorts #allowedUDPPorts = [ 5353 ]; } ; } ; # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. #Select internationalisation properties. = { i18n = "Lat2-Terminus16" ; consoleFont = "us" ; consoleKeyMap = "en_US.UTF-8" ; defaultLocale } ; = true ; security.sudo.enabletrue = true ; programs.zsh.enabletrue = "/run/current-system/sw/bin/zsh" ; users.defaultUserShell = { services = true ; nscd.enabletrue = true ; ntp.enabletrue = true ; klogd.enabletrue = false ; # slows down nixos-rebuilds, also requires nixpkgs.config.allowUnfree here..? nixosManual.enablefalse = false ; xserver.enablefalse = { cron = true ; enabletrue = "js@lastlog.de" ; mailto = [ systemCronJobs "0 0,8,16 * * * joachim cd /backup/; ./run_backup.sh" #* * * * * command to be executed #- - - - - #| | | | | #| | | | +----- day of week (0 - 6) (Sunday=0) #| | | +------- month (1 - 12) #| | +--------- day of month (1 - 31) #| +----------- hour (0 - 23) #+------------- min (0 - 59) ] ; } ; } ; # Set your time zone. # time.timeZone = "Europe/Amsterdam"; # List packages installed in system profile. To search by name, run: = with pkgs ; [ environment.systemPackagespkgs borgbackup - utils bridgeutils pciutils openssl ethtool #borg iotop cryptsetup parted pv tmux htop git dfc vim wget linuxPackages.cpupower powertop usbutils ethtool smartmontools - repl nixrepl manpages ntfs3g lsof iptraf mc hdparm sdparm file dcfldd dhex inotifyTools nmap tcpdump - searcher silversearcher #emacs ] ; = "Europe/Berlin" ; time.timeZone # Enable the OpenSSH daemon. = { services.openssh = true ; enabletrue = "without-password" ; permitRootLogin } ; = [ "sys-subsystem-net-devices-wlp4s0.device" ] ; systemd.services.hostapd.after = { services.hostapd = true ; enabletrue = pw.wpaPassphrase ; wpaPassphrasepw.wpaPassphrase = "wlp4s0" ; interface = "flux" ; ssid } ; # Define a user account. Don't forget to set a password with ‘passwd’. = { users.extraUsers.joachim = true ; isNormalUsertrue = 1000 ; uid } ; # The NixOS release to be compatible with for stateful data such as databases. = "16.09" ; system.stateVersion }

WD passport USB 3.0 bug

with a WD passport USB 3.0 disk i can’t boot the system since i hit this bug.

- 20160311 _005214 - 0c3a223c2ee6) SeaBIOS (version ?_0052140c3a223c2ee6) 00 : 10.0 : regs @ 0xfea22000 , 4 ports, 32 slots, 32 byte contexts XHCI init on dev: regsports,slots,byte contexts 0x1 @ fea22500 XHCI extcapfea22500 3.00 , 2 ports (offset 1 ), def 0 XHCI protocol USBports (offset), 2.00 , 2 ports (offset 3 ), def 10 XHCI protocol USBports (offset), 0xa @ fea22540 XHCI extcapfea22540 2 serial ports Foundserial ports 1 at 4010 / 4020 / 0 (irq 0 dev 88 ) ATA controllerat(irqdev 00 : 13.0 (regs = 0xfea25420 ) EHCI init on dev(regs 2 at 4018 / 4024 / 0 (irq 0 dev 88 ) ATA controllerat(irqdev for : / pci @ i0cf8 /*@ 14 , 7 Searching bootorderpcii0cf8 for : / rom @ img / memtest Searching bootorderromimgmemtest for : / rom @ img / setup Searching bootorderromimgsetup -0 : KINGSTON SMS200S360G ATA -8 Hard - Disk ( 57241 MiBytes) ata0: KINGSTON SMS200S360G ATAHardDisk (MiBytes) for : / pci @ i0cf8 /*@ 11 / drive @ 0 / disk @ 0 Searching bootorderpcii0cf8drivedisk #3: 0x002202a0, powered, pls 5, speed 0 [ - ] XHCI port #1: 0x00021203, powered, enabled, pls 0, speed 4 [Super] XHCI port for : / pci @ i0cf8 / usb @ 10 / storage @ 1 /*@ 0 /*@ 0 , 0 Searching bootorderpcii0cf8usbstorage for : / pci @ i0cf8 / usb @ 10 / usb -*@ 1 Searching bootorderpcii0cf8usbusb = 'WD' product = 'My Passport 0827' rev = '1012' type = 0 removable = 0 USB MSC vendorproductrevremovable with invalid stack call16invalid stack PCEngines apu2 20160311 coreboot build 4080 MB ECC DRAM MB ECC DRAM

documentation

how to recover a bricked BIOS (after flashing)? on APU1 it was SPI, and there’s a header, so like wires + a ch341a should do it.

wireless

the APU i’m using also has a Mini-PCIe wireless card built and you can choose from these two cards:

the access point works nicely with my android devices as well as my linux laptops.

buy the APU

if you want to buy an APU, buy the APU bundle.

summary

the APU is runnig NixOS and is very stable and fast while using little energy. would use/buy again!