Ubuntu System Compilation

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 with LPB3399Pro-SDK-Linux-V3.0.tar.gz.md5sum:

$ md5sum LPB3399Pro-SDK-Linux-V3.0-split.tar.gz*
********************************  LPB3399Pro-SDK-Linux-V3.0-split.tar.gzaa
********************************  LPB3399Pro-SDK-Linux-V3.0-split.tar.gzab
********************************  LPB3399Pro-SDK-Linux-V3.0-split.tar.gzac
********************************  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 Ubuntu

./build.sh focal

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