Skip to content

Yocto build guide

Carl Kittelberger edited this page Jul 11, 2026 · 1 revision

Yocto/OpenEmbedded Build Guide for Denon PRIME 4

This guide explains how to set up an OpenEmbedded/Yocto build environment to create software for the Denon PRIME 4 (and compatible devices).

Overview

The Denon PRIME 4 uses:

  • SoC: Rockchip RK3288 (Cortex-A17 quad-core @ 1.8 GHz)
  • Build System: OpenEmbedded/Yocto (confirmed by BUILD_TAG)
  • Qt Version: Qt 6.7.2
  • Kernel: Linux 6.6.119-az01-2025-12-17-rt67 (real-time)
  • Build Tag: jenkins-Planck-Embedded_Yocto_Branch-472

Prerequisites

Host System

  • Ubuntu 20.04/22.04 LTS (recommended)
  • 50+ GB disk space for build environment
  • 16+ GB RAM
  • Multi-core CPU (8+ cores recommended)

Install Dependencies

sudo apt-get update
sudo apt-get install -y \
  build-essential \
  chrpath \
  cpio \
  curl \
  diffstat \
  flex \
  gawk \
  git \
  libssl-dev \
  python3 \
  python3-pip \
  python3-setuptools \
  python3-yaml \
  texinfo \
  wget \
  zip

Step 1: Clone Yocto Layers

Get Poky (Yocto Project Reference Distribution)

mkdir ~/yocto-prime4
cd ~/yocto-prime4

# Clone Poky (Yocto 4.0/Kirkstone recommended for Qt 6)
git clone -b kirkstone https://git.yoctoproject.org/poky.git
cd poky

Get meta-openembedded

cd ..
git clone -b kirkstone https://git.openembedded.org/meta-openembedded
cd meta-openembedded
git clone -b kirkstone https://git.openembedded.org/meta-oe
git clone -b kirkstone https://git.openembedded.org/meta-python
git clone -b kirkstone https://git.openembedded.org/meta-networking

Get meta-rockchip (Rockchip BSP Layer)

cd ..
git clone https://github.com/JeffyCN/meta-rockchip.git
cd meta-rockchip

Note: The meta-rockchip layer may not have explicit RK3288 support. You may need to:

  1. Use a similar Rockchip machine configuration
  2. Override kernel and U-Boot sources
  3. Create a custom machine configuration

Step 2: Configure Build Environment

Initialize Build Environment

cd ~/yocto-prime4/poky
source oe-init-build-env build-prime4

Edit conf/local.conf

nano conf/local.conf

Add/modify these settings:

# Machine configuration (adjust as needed)
MACHINE = "rk3288-evb"  # or your specific RK3288 board

# Layers
CONF_VERSION = "2"
BBPATH = "${TOPDIR}"
BBFILES ?= ""
BBFILES += "${HOME}/yocto-prime4/meta-openembedded/meta-oe/recipes-*/*/*.bb \
             ${HOME}/yocto-prime4/meta-openembedded/meta-python/recipes-*/*/*.bb \
             ${HOME}/yocto-prime4/meta-openembedded/meta-networking/recipes-*/*/*.bb \
             ${HOME}/yocto-prime4/meta-rockchip/recipes-*/*/*.bb"

# Skip patch checks (common for embedded)
WARN_QA:remove = "patch-fuzz"
ERROR_QA:remove = "patch-status"

# Inherit Rockchip image class
INHERIT:append = " rockchip-image"

# Package management
PACKAGE_CLASSES = "package_ipk"
PACKAGECONFIG:pn-qtmultimedia = "gst-plugins-base"

# Enable Qt 6
DISTRO_FEATURES:append = " systemd"
VIRTUAL-RUNTIME_init_manager = "systemd"
VIRTUAL-RUNTIME_initscripts = "systemd-compat-units"

# Compression
IMAGE_FSTYPES:append = " xz"

# Parallelism
BB_NUMBER_THREADS = "8"
PARALLEL_MAKE = "-j 8"

Create Custom Machine Configuration (Optional)

If RK3288-evb doesn't match your hardware, create a custom machine:

mkdir -p conf/machine
cat > conf/machine/az01.conf << 'EOF'
# Denon DJ PRIME 4 (AZ01)

MACHINEARCH = "armv7a-vfpv4"
TARGET_ARCH = "arm"
TARGET_OS = "linux-gnueabi"

# Kernel
KERNEL_CLASSES = "kernel-fitimage"
KERNEL_IMAGETYPE = "fitImage"
KERNEL_DEVICETREE = "rk3288-az01-jc11.dtb"

# U-Boot
UBOOT_MACHINE = "rk3288-evb_defconfig"
UBOOT_ENTRYPOINT = "0x60010000"

# Bootloader
BOOT_SPACE = "16384"
FIT_IMAGES_CONF = "fit-images.conf"

# Root filesystem
ROOTFS_POSTPROCESS_COMMAND += "create_bootfs;"
create_bootfs() {
    install -d ${IMAGE_ROOTFS}/boot
}

# Package management
PACKAGE_CLASSES = "package_ipk"
EOF

Step 3: Build the Image

Build Core Image

cd ~/yocto-prime4/poky/build-prime4
bitbake core-image-minimal

Build with Qt 6

bitbake core-image-minimal -c devshell
# Or build a custom image with Qt 6
bitbake qt6-base qt6-declarative qt6-multimedia

Build Rockchip Firmware Image

bitbake core-image-minimal
# This should produce update.img in tmp/deploy/images/

Step 4: Extract and Modify Firmware

Extract Current Firmware

# From the denon-prime4 repo
cd /path/to/denon-prime4
binwalk -e PRIME4-5.0.0-Update.img
cd extractions/PRIME4-5.0.0-Update.img/7D0194
xz -d decompressed.bin
# Now you have firmware.ext2 (515 MB)

Mount and Modify

sudo mkdir /mnt/firmware
sudo mount -o loop,ro firmware.ext2 /mnt/firmware

# Make changes (e.g., add custom app)
sudo cp /path/to/your/app /mnt/firmware/usr/Engine/

# Unmount
sudo umount /mnt/firmware

Create New XZ Stream

# Compress with proper XZ footer
xz -9e firmware.ext2
# This creates firmware.ext2.xz with proper footer

# Extract XZ data
dd if=firmware.ext2.xz bs=1 skip=$((0x7D0194)) of=firmware.xz

Step 5: Repack Firmware Image

Create New Container

You'll need to modify the AZ01/AZ0x container header to include:

  1. Updated partition table with new XZ offset/size
  2. Updated SHA1/SHA256 hashes
  3. Proper signatures (requires InMusic's private key)

Note: Without the signing key, you cannot create a valid update image for the device.

Alternative: Use Debugfs

# Mount read-write (backup first!)
sudo mount -o loop,rw firmware.ext2 /mnt/firmware

# Make modifications
sudo cp custom-app /mnt/firmware/usr/Engine/
sudo cp custom-service /mnt/firmware/lib/systemd/system/

# Unmount
sudo umount /mnt/firmware

Step 6: Deploy to Device

Via USB Update

  1. Rename firmware to PRIME4-5.0.0-Update.img
  2. Copy to FAT32 USB drive
  3. Insert into PRIME 4 and update

Via SSH (if enabled)

# Upload modified filesystem
scp firmware.ext2 user@prime4:/tmp/

# On device
sudo umount /mnt
sudo mount -o loop,rw /tmp/firmware.ext2 /mnt
# Or use overlayfs for persistence

Custom Application Example

Create a Simple Qt 6 Application

# Create project
mkdir -p ~/prime4-app
cd ~/prime4-app
qmake -project
qmake
make

Create Yocto Recipe

# recipes-apps/my-app/my-app_1.0.bb
SUMMARY = "My Custom App"
LICENSE = "CLOSED"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

SRC_URI = "file://my-app"

do_install() {
    install -d ${D}${bindir}
    install -m 0755 my-app ${D}${bindir}/
}

FILES:${PN} = "${bindir}/*"

Add to Image

# In conf/local.conf
IMAGE_INSTALL:append = " my-app"

Troubleshooting

Qt 6 Not Building

  • Ensure you're using Yocto 4.0/Kirkstone or newer
  • Check that qt6-base recipe exists in your layers
  • May need to add qt6-base to DISTRO_FEATURES

RK3288 Not Supported

  • Use a similar Rockchip machine (rk3288-evb, px3-evb)
  • Override kernel and U-Boot sources in local.conf
  • Create custom machine configuration

XZ Stream Issues

  • Use xz --single-stream for incomplete streams
  • Always create proper XZ footer with xz -9e
  • Verify with xz -t firmware.ext2.xz

Resources

Limitations

  1. Signing Key: Cannot create valid update images without InMusic's private key
  2. Kernel/U-Boot: Modifying boot components requires matching signatures
  3. Hardware Specifics: RK3288 support may be limited in public layers
  4. Qt Version: Must match Qt 6.7.2 used in official firmware

Next Steps

  1. Set up build environment
  2. Test with core-image-minimal
  3. Add Qt 6 support
  4. Create custom application recipe
  5. Test on hardware (if available)
  6. Document any RK3288-specific patches needed

Clone this wiki locally