Compile Source Code

Firefly provides a complete software SDK for easy software development.

Source Code Access

Important:

Please update the SDK to the latest according to the Wiki, especially for CS-R1 cluster server users (for CS-R1 users, if the code version is too old, software configuration and hardware mismatch may cause hardware damage).

Notice

For CORE-1126-JD4/CORE-1109-JD4 series, please download the rv1126_rv1109_linux_release REPO_SDK package.

Method 1

repo init  --no-clone-bundle --repo-url https://gitlab.com/firefly-linux/git-repo.git --no-repo-verify -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

Source Code Compilation

Build The 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

Ubuntu 17.04 requires the following dependencies in addition to the above packages:

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

Compile The Configuration

SDK contains a complete set of source code such as uboot, kernel, recovery, buildroot, spl, etc. Before compilation, configuration files need to be selected to configure configuration items needed during compilation of each warehouse.

# The configuration file is bound to the device CORE-1126-JD4/CORE-1109-JD4 and officially uses aio-rv1126-jd4.mk/aio-rv1109-jd4
# files stored in the sdk/device/rockchip/rv1126_rv1109/

# Compile CORE-1126-JD4 firmware, the adapted screen is DM-M10R800 V2 screen module
./build.sh device/rockchip/rv1126_rv1109/aio-rv1126-jd4-BE-45.mk

# Compile CORE-1126-JD4 firmware, the adapted screen is DM-M10R800 V2 screen module
./build.sh device/rockchip/rv1126_rv1109/aio-rv1109-jd4-BE-45.mk

# Compile CORE-1126-JD4 V1.1 Quick Start Firmware. The adapted screen is the DM-M10R800 V2 screen module
./build.sh device/rockchip/rv1126_rv1109/aio-rv1126-jd4-BE-45-tb-v11.mk

Begin Compiling

After compilation, the firmware output path isrockdev/update.img. This directory also contains the compiled output of all separately compiled projects. Refer to Firmware Upgrade for the burn upgrade operation after compilation. Source SDK introduction can also be directly referred to the SDK doc folder.

# Global compile command
./build.sh

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

# kernel
./build.sh kernel

# rootfs 
./build.sh rootfs