DEV Community

Cover image for Programming in Rockchip Linux-Based Devices
Leonard Liao
Leonard Liao

Posted on

Programming in Rockchip Linux-Based Devices

Rockchip-based devices have been quietly powering a wide range of products — from tablets and single-board computers to AI edge devices and multimedia players. If you’ve used a Pine64, Radxa Rock, or certain Android TV boxes, you’ve likely encountered a Rockchip SoC (System on Chip) without even realizing it.

While many developers are familiar with Raspberry Pi, the Rockchip Linux ecosystem is often overlooked — despite offering powerful hardware, robust multimedia capabilities, and excellent Linux support for both hobbyists and professionals.

In this post, we’ll explore how to get started programming on Rockchip Linux-based devices, the available development tools, and tips for working effectively in this environment.

1. Why Choose Rockchip Linux Devices?

Rockchip SoCs (such as the RK3399, RK3566, RK3588, and others) bring several advantages:

High Performance – Many models feature ARM big.LITTLE cores for power efficiency plus strong GPU performance (Mali or newer GPUs like Mali-G610).

AI & Multimedia – NPU (Neural Processing Units) for AI acceleration and support for 4K/8K video decoding/encoding.

Flexible I/O – PCIe, USB 3.0, MIPI-DSI/CSI, HDMI, Gigabit Ethernet.

Good Linux Support – Many single-board computers offer mainline Linux kernels and open-source drivers, making them a strong option for embedded projects.

2. Setting Up Your Development Environment

To program a Rockchip Linux device, you need:

A Rockchip SBC (e.g., Radxa Rock 5, Pine64 Quartz64, or similar).

A Linux image – Many vendors provide Debian, Ubuntu, or Yocto-based builds.

Serial console access – A USB-to-UART adapter helps in debugging boot issues.

Cross-compilation toolchain – If building from a PC instead of directly on the device.

Flashing the OS is typically done with:

rkdeveloptool (Rockchip’s USB boot and flash tool)

dd on Linux for SD cards or eMMC

Vendor-specific utilities

3. Programming Options

You can program Rockchip Linux devices just like any other ARM-based Linux board.

A. Native Development
You can install compilers and SDKs directly on the board:

bash
Copy
Edit
sudo apt update
sudo apt install build-essential git cmake

This works for lightweight projects or scripts but can be slower for large builds.

B. Cross-Compilation
For more complex applications, use an ARM cross-toolchain on your PC:

bash
Copy
Edit
sudo apt install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
This lets you compile binaries for ARM64 on a much faster x86 machine.

C. Using Yocto or Buildroot
For embedded projects, Yocto or Buildroot let you create custom Linux images with your app pre-installed. Rockchip provides BSP (Board Support Package) layers for integration.

4. Working with Peripherals

Rockchip boards expose plenty of interfaces for hardware hacking:

GPIO – Use /sys/class/gpio or libraries like libgpiod.

I2C/SPI – Communicate with sensors and displays.

MIPI-CSI/DSI – Connect cameras and displays.

USB OTG – Build USB gadgets or debug via USB.

Example: blinking an LED via GPIO

bash
Copy
Edit
Export pin
echo 17 > /sys/class/gpio/export
Set as output
echo out > /sys/class/gpio/gpio17/direction
Turn LED on
echo 1 > /sys/class/gpio/gpio17/value

5. AI and Multimedia Development

On boards with NPUs (e.g., RK3588), you can leverage Rockchip’s RKNN Toolkit for AI inference:

Supports TensorFlow Lite, ONNX, PyTorch (with model conversion).

Runs inference on NPU for massive speed gains.

For multimedia, GStreamer and FFmpeg work well with Rockchip hardware-accelerated decoding:

bash
Copy
Edit
gst-launch-1.0 filesrc location=video.mp4 ! decodebin ! autovideosink

6. Debugging and Performance Tuning

dmesg and journalctl for kernel logs.

htop, top, and glances for monitoring CPU/memory usage.

perf and strace for performance profiling.

Serial console for low-level boot debugging.

7. Tips for Success

Use mainline Linux where possible — it improves portability and long-term support.

Keep your toolchain and kernel sources synced with your board vendor.

Consider Docker for building and packaging apps in a controlled environment.

Backup your working OS image before risky experiments.

Conclusion

Rockchip Linux devices are a hidden gem in the ARM SBC space — offering strong multimedia capabilities, great Linux support, and a rich set of interfaces for hardware projects. Whether you’re building an AI-powered camera, a home server, or a custom embedded system, they provide a cost-effective and powerful platform.

The learning curve is similar to Raspberry Pi development, but with the added bonus of more horsepower and flexibility. Once you get familiar with the toolchains and hardware quirks, programming these boards can be both productive and fun.

Top comments (0)