NixOS on ARM/Firefly AIO-3399C

From NixOS Wiki
Jump to: navigation, search
Firefly AIO-3399C
A Firefly AIO-3399C attached to LVDS
Manufacturer Firefly
Architecture AArch64
Bootloader u-boot with ARM trusted boot and Rockchip Miniloader
Boot order official: eMMC
Maintainer makefu


It can boot the image provided by firefly on the chinese download page, click on Ubuntu (GPT). The image has also been uploaded to

The official documentation, which is a pretty good state, can be found at the wiki of firefly. However as of right now i was unable to:

  • build an nixos image which can be booted as root image from the emmc (root image must be build as "android" boot)
  • build an sd-image with a kernel which detects the card at stage one with NixOS (cannot find rootfs)
  • build the the bootloader with NixOS (blobs and trustedboot comes from rockchip)

Board-specific installation notes

Serial console

On the board there are 3 pins which have a 2.54mm pitch, this is the debug console with the text DEBUG on it. Starting from the middle to the side of the board:

  • GND (Black Wire)
  • RX (White Wire)
  • TX (Green Wire)
  • VCC, only the silver trace point and not a pin

Baud rate is 1500000 Connect to it via:

nix-shell -p picocom --run "picocom -b 1500000 /dev/ttyUSB0"

When you build your own image, you need the following extra kernel command-line parameters to get serial output:

  boot.kernelParams = ["console=ttyS2,1500000n8" "earlycon=uart8250,mmio32,0xff1a0000" "earlyprintk"];

Compatibility notes

See the Rockchip compatibility matrix. Uboot requires the Rockchip Miniloader and an arm trusted boot image.

Downstream kernel

The downstream kernel sources can be found on github at [1]. The stable kernel branch they are maintaining is 4.4, however mainline 4.19 should already work according to the Rockchip compatibility matrix.


Firefly maintains an own u-boot fork at [2]

Flashing via Rockchip Loader Mode

The board can easily be flashed by booting the device into the Rockchip loader mode.

To bring the device in the loader mode:

  1. Disconnect from power
  2. Connect USB-C from the board to your computer
  3. Hold 'Recovery' button pressed
  4. Connect power, wait for 2 (or more) seconds
  5. Short press the 'reset' button and release the 'Recovery' button afterwards

Firefly upgrade_tool

Firefly provides an upgrade_tool which is a modified rock-chip upgrade tool. Using the upstream tool however may result in weird errors like being unable to flash the image or being unable to erase the flash. To be sure use the mirror.

However, because the software is essentially a blob, you will need to either patchelf the thing or use steam-run:

nix-shell -p steam-run --run "steam-run ./upgrade_tool"

Rockchip MaskROM Mode

Maskrom mode is a way to get extended privileges when flashing but you need to shorten two trace points on the board. Follow the official documentation. However the loader mode should be enough for most things.