Buildroot Compilation

Buildroot is a framework for building embedded Linux systems on the Linux platform. The entire Buildroot consists of Makefile (*.mk) scripts and Kconfig (Config.in) configuration files. Similar to compiling the Linux kernel, you can configure and modify Buildroot using menuconfig, and compile a complete Linux system software that can be directly flashed onto a machine for execution (including boot, kernel, rootfs, and various libraries and applications within rootfs). For more information on Buildroot development, please refer to the official 《Development Manual》

Hardware Configuration

Recommended hardware configuration for compiling Ubuntu development environment:

  • 64-bit CPU

  • Ubuntu 20.04 system

  • 16GB memory

  • 250GB free space for compilation

  • Compile as a regular user, do not compile as root

Software Configuration

Install environment packages

sudo apt update
sudo apt-get install repo git ssh make gcc libssl-dev liblz4-tool \
expect g++ patchelf chrpath gawk texinfo chrpath diffstat binfmt-support \
qemu-user-static live-build bison flex fakeroot cmake gcc-multilib g++-multilib \
unzip device-tree-compiler python-pip ncurses-dev pyelftools

SDK Acquisition

Send an email to support@neardi.com to obtain related development materials.

Before unzipping after downloading, check whether the MD5 code matches LPB3399Pro-SDK-Linux-V3.0.tar.gz.md5sum:

$ md5sum LPB3399Pro-SDK-Linux-V3.0-split.tar.gz*
a5c8909413d4755ec0c064ed8ddab85c  LPB3399Pro-SDK-Linux-V3.0-split.tar.gzaa
bd884d53eef0248fec828c3271526dbe  LPB3399Pro-SDK-Linux-V3.0-split.tar.gzab
978ce072fdb8244f3347df752a49df45  LPB3399Pro-SDK-Linux-V3.0-split.tar.gzac
df8ceb3406e304c9d2394231b8f6a0dc  LPB3399Pro-SDK-Linux-V3.0-split.tar.gzad

Unzip:

$ cat LPB3399Pro-SDK-Linux-V3.0-split.tar.gz* > LPB3399Pro-SDK-Linux-V3.0.tar.gz
$ tar -zxf LPB3399Pro-SDK-Linux-V3.0.tar.gz

Extract:

cd LPB3399Pro-SDK-Linux-V3.0
git reset --hard

Switch branches:

branch explain
lz11000001 Neardi master branch
git checkout lz11000001

Compile SDK

Select Configuration

./build.sh ./device/rockchip/rk3399pro/BoardConfig_rk3399pro-neardi-linux-lz11000001.mk

Compile NPU

./build.sh npu

Fully Automatic Compilation

Fully automatic compilation will execute all compilations, generating u-boot, kernel, and buildroot.

./build.sh

Partial Compilation

  • Compile u-boot

./build.sh uboot
  • Compile kernel

./build.sh kernel
  • Compile recovery

./build.sh recovery

Compile Buildroot

./build.sh rootfs

Packaging Firmware

RK firmware is packaged in a proprietary format by Rockchip, and can be flashed onto eMMC or SD card using tools provided by Rockchip (Note: Unless specified otherwise, the firmware mentioned on the WIKI by default refers to RK firmware).

# Package RK firmware
./build.sh updateimg

The complete firmware will be saved to  rockdev/update.img