Got a Radxa ? Let s make it fit our needs !

Radxa ZERO 3W

Resources

The doc can be found here. The resources. The Radxa ZERO 3 GitHub.

The GitHub release page.

radxa-zero3_debian_bullseye_xfce_b6.img.xz is tested and boots ok. Using the sd card

radxa-zero3_debian_bullseye_cli_b6.img.xz download fine.

From the community we get that page about using Arch on it. The Arch release page.

The installation

on the host

yay -S sshpass python-passlib
# and ansible

on SD

On this first test, I used radxa-zero3_debian_bullseye_xfce_b6.img.xz image.

unxz radxa-zero3_debian_bullseye_xfce_b6.img.xz
dd bs=4M if=/home/cristal/Downloads/radxa-zero3_debian_bullseye_xfce_b6.img of=/dev/sda conv=fsync oflag=direct status=progress

After these steps you should have that on your SD card : SCREENSHOT

Perfect ! It boots and it works ! Material is ok.

on eMMC

First of we need a tool that let us flash Rockchip firmwares.

Doc here

yay -S rkdeveloptool-git

I chose this firmware from their website. It is called an SPL (Secondary Program Loader) and it is used to start your OS, that we will install just after that.

Séquence de boot simplifiée sur un RK356x (Radxa Zero 3W)

    Boot ROM (hardcodée dans le SoC)

        C’est le premier code qui s’exécute au démarrage.

        Elle cherche un SPL (sur eMMC, SD, ou via USB Maskrom).

        Si elle ne trouve rien, elle entre en mode Maskrom (attente d’un rkdeveloptool db).

    SPL (Secondary Program Loader)

        Petit programme (quelques Ko à quelques centaines de Ko) chargé en RAM par rkdeveloptool db.

        Son job :

            Initialiser la RAM

            Charger un bootloader complet (comme U-Boot)

            Passer la main

    Bootloader principal (souvent U-Boot)

        Charge le noyau Linux ou Android

        Monte les partitions rootfs

        Configure le device tree, etc.

    Kernel Linux / Android

Once you are all set, while pressing the “Maskrom Button”, plug in the USB-C cable (from your computer) to the OTG Type C port on the board. Then run the following commands :

# list devices. you should see yours. (ld = list devices)
rkdeveloptool ld
# flash the SPL (db = device boot)
rkdeveloptool db rk356x_spl_loader_ddr1056_v1.12.109_no_check_todly.bin
# flash your OS .img file (wl = write Logical Block Addressing)
rkdeveloptool wl 0 radxa-zero3_debian_bullseye_xfce_b6.img
# reboot your device
rkdeveloptool rd

That s it ! Your OS is now installed on the eMMC

Sometimes you might have conflicts with previously written images on the eMMC, if that is the case, just erase the flash :

rkdeveloptool ef

Configuring the OS

So far, I only managed to boot on debian bullseye with XFCE, so we ll start with that.

What do we want / need on our OS :

  • WiFi AP
  • ZSH
  • Neovim
  • GO/Rust/Python
  • Orca

My zsh and vim config are stored in a repo, so we need git. And we ll use ansible to do that once and for all (as if…). More precisions about the wifi. We need the device to spawn an AP on boot, making it easy to reach from other devices. Ideally it would be able to connect to an external AP in order to share the connection with devices connected to it (it being the Radxa).

Fixing the repos

At the time of this writting, I am using a radxa provided img using Debian Bullseye. It comes with a few problems. Some radxa signing keys are deprecated. Let s fix this

keyring="$(mktemp)"
version="$(curl -L https://github.com/radxa-pkg/radxa-archive-keyring/releases/latest/download/VERSION)"
curl -L --output "$keyring" "https://github.com/radxa-pkg/radxa-archive-keyring/releases/latest/download/radxa-archive-keyring_${version}_all.deb"
sudo dpkg -i "$keyring"
rm -f "$keyring"

The distro now being “old-stable” backports are not happy and we can fix that by switching “deb” to “archive” in the repo URL

[ -f /etc/apt/sources.list.d/bullseye-backports.list ] && \
sudo sed -i 's|http://deb.debian.org/debian|http://archive.debian.org/debian|' /etc/apt/sources.list.d/bullseye-backports.list