Building an Embedded Linux Development Environment for RK3588: Practical Experience from Professional Developers
Introduction
The RK3588, as the latest flagship SoC from Rockchip, has garnered significant attention in fields such as AI edge computing and machine vision due to its 8-core ARM v8.2 architecture processor, high-performance NPU, and rich multimedia processing capabilities. This article will detail the professional setup process for the RK3588 development environment, helping developers quickly embark on their application development journey based on RK3588.
Hardware and Software Requirements
Hardware Requirements:
- RK3588 development board (featuring quad-core A76 + quad-core A55)
- Power adapter (12V/2A)
- eMMC storage module (32GB or more)
- USB Type-C data cable
- HDMI display
- Gigabit Ethernet cable
Software Requirements:
- Host operating system: Ubuntu 20.04/22.04 LTS
- RK Linux SDK (Linux-5.10)
- Buildroot 2023.02
- rkbin (Rockchip proprietary firmware)
- RK tools (upgrade_tool, SDDiskTool)
Overview of the Development Environment
Building the development environment for RK3588 requires special attention to Rockchip’s proprietary tools and SDK. The development environment includes components such as U-Boot bootloader, Linux kernel, root filesystem, and Rockchip proprietary toolchain. We will use the official Rockchip SDK as a foundation, combined with open-source tools to build a complete development environment.
Preparing the Host Development Environment
# Install basic development dependencies
sudo apt-get update
sudo apt-get install -y git-core gitk git-gui gcc-aarch64-linux-gnu \
device-tree-compiler lzop libncurses5-dev libglib2.0-dev \
libpixman-1-dev libjpeg-dev libpng-dev u-boot-tools \
mtools parted libudev-dev libusb-1.0-0-dev python-linaro-image-tools
# Install repo tool
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
Cross-Compilation Toolchain Configuration
# Set environment variables
export ARCH=arm64
export CROSS_COMPILE=aarch64-linux-gnu-
export PATH=/usr/bin:$PATH
# Verify toolchain
aarch64-linux-gnu-gcc --version
Kernel Source Acquisition and Configuration
# Initialize repository
mkdir rk3588-linux
cd rk3588-linux
repo init -u https://github.com/rockchip-linux/manifests -b master
repo sync
# Compile kernel
cd kernel
make ARCH=arm64 rockchip_linux_defconfig
make ARCH=arm64 rk3588-evb.img -j8
Building the Root Filesystem
Use Buildroot to build a custom root filesystem:
# Get Buildroot
git clone https://git.buildroot.net/buildroot
cd buildroot
# Configure and compile
make rockchip_rk3588_defconfig
make menuconfig # Customize as needed
make -j8
System Boot Configuration
# Compile U-Boot
cd u-boot
make rk3588_defconfig
make ARCH=arm64 -j8
# Generate boot image
./mkimage -n rk3588 -T rksd -d tpl/u-boot-tpl.bin:spl/u-boot-spl.bin u-boot.img
Deploying the System on the Development Board
Use the official Rockchip flashing tool for system flashing:
# Enter flashing mode
sudo upgrade_tool db rk3588_loader.bin
# Flash system image
sudo upgrade_tool wl 0 boot.img
sudo upgrade_tool wl 0x40 rootfs.img
Environment Testing and Validation
Perform basic functionality validation after booting:
# View system information
cat /proc/device-tree/model
cat /proc/cpuinfo
# GPU status
cat /sys/class/devfreq/ff9a0000.gpu/cur_freq
# NPU test
rknn_demo
Common Issues and Solutions
-
Stuck at U-Boot:
- Check partition table configuration
- Verify boot.img integrity
- Confirm DDR timing parameters
NPU functionality issues:
- Update rknn_toolkit version
- Check firmware version compatibility
- Verify kernel NPU driver loading status
Display output issues:
- Check HDMI configuration parameters
- Update display driver
- Confirm resolution settings
Development Environment Optimization
- Configure development tools:
# Install debugging tools
sudo apt-get install -y trace-cmd perf kernel-shark
sudo apt-get install -y valgrind strace
# Configure VSCode remote development
code --install-extension ms-vscode-remote.remote-ssh
- Performance optimization configuration:
# CPU performance mode
echo performance > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
# GPU frequency adjustment
echo 800000000 > /sys/class/devfreq/ff9a0000.gpu/userspace/set_freq
Conclusion
Building the RK3588 development environment requires attention to the chip’s specific configurations and optimizations. After completing the basic environment setup, it is recommended to delve into the unique features of RK3588, such as NPU application development and multimedia codec acceleration. Additionally, exploring advanced topics like Docker container deployment and AIPU development can fully leverage the performance advantages of RK3588.