Source Compilation

“Peripheral Development” mainly targets two kinds of users. (1) An external device is used to perform some physical control after identifying success and failure. At this time, it may be necessary to add corresponding peripheral drivers or modify the kernel source code. (2) Customize the root file system or kernel. The user may not need some of the functions on the official firmware or need to add additional functions. In this case, the user can tailor the source code or re-development by himself.

Download Source Code

PS

If you need to develop Facial_Gate type applications, please download the rv1126_rv1109_linux_release REPO_SDK package. If you need to develop AI_UVC applications, please download the rv1126_rv1109_linux_ai_camera_release REPO_SDK package. The methods are the same, and only one of them will be described below.

Method 1

repo init  --no-clone-bundle --repo-url https://gitlab.com/firefly-linux/git-repo.git -u https://gitlab.com/firefly-linux/manifests.git -b master -m rv1126_rv1109_linux_release.xml

repo sync -c
# It may be necessary to execute it repeatedly until the code is successfully downloaded

Method 2

  • Download the REPO_SDK package from the download page

  • Compare the MD5 code of the REPO_SDK package to verify the integrity, and then decompress it.

md5sum rv1126_rv1109_linux_release_20211022.tgz
596c6bc6bb3095aea97d54c9df4cf333  rv1126_rv1109_linux_release_20211022.tgz
tar xvf rv1126_rv1109_linux_release_20211022.tgz
  • After decompression, enter the folder to complete the synchronization work.

# This compressed package contains a ".repo" directory, after decompression, perform the following operations in the current directory
.repo/repo/repo sync -l
.repo/repo/repo sync -c --no-tags
.repo/repo/repo start firefly --all

# You can use the following command to update the SDK later
.repo/repo/repo sync -c --no-tags
# It may be necessary to execute it repeatedly until the code is successfully downloaded

Compilation

Environment

Ubuntu 16.04 x86 PC host:

sudo apt-get install repo git-core gitk git-gui gcc-arm-linux-gnueabihf u-boot-
tools device-tree-compiler gcc-aarch64-linux-gnu mtools parted libudev-dev
libusb-1.0-0-dev python-linaro-image-tools linaro-image-tools autoconf autotools-
dev libsigsegv2 m4 intltool libdrm-dev curl sed make binutils build-essential gcc
g++ bash patch gzip gawk bzip2 perl tar cpio python unzip rsync file bc wget
libncurses5 libqt4-dev libglib2.0-dev libgtk2.0-dev libglade2-dev cvs git
mercurial rsync openssh-client subversion asciidoc w3m dblatex graphviz python-
matplotlib libc6:i386 libssl-dev expect fakeroot cmake flex bison liblz4-tool
libtool keychain

In addition to the above packages, Ubuntu 17.04 needs to install the following dependencies:

sudo apt-get install lib32gcc-7-dev g++-7 libstdc++-7-dev

Configuration

The SDK includes a full set of source code such as uboot, kernel, recovery, buildroot, spl, etc. Before compiling, you need to select a configuration file to configure the configuration items that each warehouse needs to use when compiling.

# File is stored in sdk/device/rockchip/rv1126_rv1109/XXXXX.mk

# RV1109: Facial Gate. The adapted screen is DM-M10R800 V2 screen module
./build.sh device/rockchip/rv1126_rv1109/cam-crv1109s2u-facial_gate-BE-45.mk

# RV1126: Facial Gate. The adapted screen is DM-M10R800 V2 screen module
./build.sh device/rockchip/rv1126_rv1109/cam-crv1126s2u-facial_gate-BE-45.mk

# RV1109: AI-UVC-CAMERA. The adapted screen is DM-M10R800 V2 screen module
./build.sh device/rockchip/rv1126_rv1109/cam-crv1109s2u-uvcc-BE-45.mk

# RV1126: AI-UVC-CAMERA. The adapted screen is DM-M10R800 V2 screen module
./build.sh device/rockchip/rv1126_rv1109/cam-crv1126s2u-uvcc-BE-45.mk

Compilation

After the compilation is complete, the firmware output path rockdev/update.img, this directory also contains the compilation output of all separately compiled projects. After the compilation is complete, please refer to “Firmware Upgrade” for the upgrade operation. For the introduction of the source code SDK, you can also directly refer to the doc folder of the SDK.

# Global compilation command
./build.sh

# If you need to compile one item separately, do the following
# uboot
./build.sh uboot

# kernel
./build.sh kernel

# rootfs 
./build.sh rootfs