HOME
  • GM-3568JHF
  • M4-R1
  • M5-R1
  • SC-3568HA
  • M-K1HSE
  • CF-NRS1
  • CF-CRA2
  • 1684XB-32T
  • 1684X-416T
  • C-3568BQ
  • C-3588LQ
  • GC-3568JBAF
  • C-K1BA
Shop
  • English
  • 简体中文
HOME
  • GM-3568JHF
  • M4-R1
  • M5-R1
  • SC-3568HA
  • M-K1HSE
  • CF-NRS1
  • CF-CRA2
  • 1684XB-32T
  • 1684X-416T
  • C-3568BQ
  • C-3588LQ
  • GC-3568JBAF
  • C-K1BA
Shop
  • English
  • 简体中文
  • GM-3568JHF

    • 1. Introduction

      • GM-3568JHF Introduction
    • 2. Quick Start

      • 01 Environment Construction
      • 02 Compilation Instructions
      • 03 Burning Guide
      • 04 Debugging Tools
      • 05 Software Update
      • 06 View information
      • 07 Test Command
      • 08 Application Compilation
      • 09 Source code acquisition
    • 3. Peripherals and Interfaces

      • USB
      • Display and touch
      • Ethernet
      • WIFI
      • Bluetooth
      • TF-Card
      • Audio
      • Serial Port
      • CAN
      • RTC
    • 4. Application Development

      • 01 UART read and write case
      • 02 Key detection case
      • 03 LED light flashing case
      • 04 MIPI screen detection case
      • 05 Read USB device information example
      • 06 FAN Detection Case
      • 07 FPGA FSPI Communication Case
      • 08 FPGA DMA read and write case
      • 09 GPS debugging case
      • 10 Ethernet Test Cases
      • 11 RS485 reading and writing examples
      • 12 FPGA IIC read and write examples
      • 13 PN532 NFC card reader case
      • 14 TF card reading and writing case
    • 5. QT Development

      • 01 ARM64 cross compiler environment construction
      • 02 QT program added automatic startup service
    • 6. Others

      • 01 Modification of the root directory file system
      • 02 System auto-start service

01 Environment Construction

To help developers quickly build a development environment, we provide two methods: development environment building and cross-compiler Docker image environment building. Developers can choose one of them.

Tips

Note: We recommend that developers build a Docker image environment to shorten the build time of the compilation environment.

1 Development environment construction

1.1 Prepare the development environment

We recommend using Ubuntu 22.04 or higher for compilation. Other Linux versions may require adjustments to the packages. In addition to the system requirements, there are other hardware and software requirements.

  • Hardware requirements: 64-bit system, at least 8GB of RAM, 100GB of hard disk space. If you do multiple builds, you will need more hard disk space.
  • Software requirements: Ubuntu 22.04 or later.

1.2 Installing libraries and toolsets

When using the command line for device development, you can install the libraries and tools required to compile the SDK by following the steps below. Use the following apt-get command to install the libraries and tools required for subsequent operations:

sudo apt-get update && sudo apt-get install git ssh make gcc libssl-dev \
liblz4-tool expect expect-dev 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 ncurses-dev \
libgucharmap-2-90-dev bzip2 expat gpgv2 cpp-aarch64-linux-gnu libgmp-dev \
libmpc-dev bc python-is-python3 python2

Tips

Note: The installation command is applicable to Ubuntu 22.04. For other versions, please use the corresponding installation command according to the installation package name. If the compilation encounters an error, you can install the corresponding software package according to the error message. Among them:

  • Python requires Python 3.6 or above to be installed. Python 3.6 is used as an example here.
  • Make requires that make 4.0 or later be installed. Here, make 4.2 is used as an example.
  • lz4 requires lz4 1.7.3 or above to be installed.
  • A VPN network is required to compile Yocto.

i Check and upgrade the Python version of the host

Check and upgrade the Python version of the host as follows:

  • Check the host python version
$ python3 --version
Python 3.10.6

If the python version requirement is not met, you can upgrade it as follows:

  • Upgrade Python 3.6.15 new version
PYTHON3_VER=3.6.15
echo "wget
https://www.python.org/ftp/python/${PYTHON3_VER}/Python-${PYTHON3_VER}.tgz"
echo "tar xf Python-${PYTHON3_VER}.tgz"
echo "cd Python-${PYTHON3_VER}"
echo "sudo apt-get install libsqlite3-dev"
echo "./configure --enable-optimizations"
echo "sudo make install -j8"

ii Check and upgrade the host's make version

The methods for checking and upgrading the host's make version are as follows:

  • Check the host make version
$ make -v
GNU Make 4.2
Built for x86_64-pc-linux-gnu
  • Upgrade to the new version of make 4.2
$ sudo apt update && sudo apt install -y autoconf autopoint
git clone https://gitee.com/mirrors/make.git
cd make
git checkout 4.2
git am $BUILDROOT_DIR/package/make/*.patch
autoreconf -f -i
./configure
make make -j8
sudo install -m 0755 make /usr/bin/make

iii Check and upgrade the host's lz4 version

The method to check and upgrade the host's lz4 version is as follows:

  • Check the host lz4 version
$ lz4 -v
*** LZ4 command line interface 64-bits v1.9.3, by Yann Collet ***
  • Upgrade to the new version of lz4
git clone https://gitee.com/mirrors/LZ4_old1.git
cd LZ4_old1
make
sudo make install
sudo install -m 0755 lz4 /usr/bin/lz4

2 Docker image environment construction

To help developers quickly complete the complex development environment preparation work above, we provide a second way to build a cross-compiler Docker image environment, so that developers can quickly verify and shorten the construction time of the compilation environment.

Docker is an open source application container engine that can more efficiently utilize system resources, ensure a consistent operating environment, achieve continuous delivery and deployment, and make subsequent migration, maintenance, and expansion easier.

2.1 Install Docker

Install Debian-based distributions, such as Debian, Ubuntu

#安装Debian系发行版本
sudo apt-get install docker.io

#验证Docker是否安装成功
sudo docker -v

2.2 Build Docker Image

Docker image can use the provided ShiMetaPi_RKLinux_SDK_Build_Environment_Docker_V1.0.tar image package

Docker_Image

Copy the image file to the server and load the Docker image in the image file directory

#加载镜像文件(需在镜像文件所在目录下)
sudo docker load < ShiMetaPi_RKLinux_SDK_Build_Environment_Docker_V1.0.tar

#查询镜像是否加载成功
sudo docker image ls

2.3 Create and start a container

Create and start a container, specify the user running in the container as root, and run a Bash terminal in interactive mode in the container

#创建并启动容器,指定容器内运行用户为root
sudo docker run --privileged -it -u root -v $Host_contents:$Docker_contents $ImageID /bin/bash
# $Host_contents:主机目录
# $Docker_contents :映射到 Docker 内的目录
# $ImageID:映射ID

#示例
sudo docker run --privileged -it -u root -v /home/ubuntu/SDK:/home/hjf/SDK docker_h:latest /bin/bash

2.4 Supplementary Installation

Before compiling the SDK, you need to update the system package index, install the required tools binfmt-support and qemu-user-static, enable support for the ARM64 architecture, and install live-build. The specific instructions are as follows:

#编译前操作指令,需联网操作
sudo apt-get update
sudo apt-get remove live-build
sudo apt-get install binfmt-support qemu-user-static --reinstall
sudo update-binfmts --enable qemu-aarch64
git clone https://salsa.debian.org/live-team/live-build.git --depth 1 -b debian/1%20230131
cd live-build
rm -rf manpages/po/
sudo make install -j8
cd ..
Edit this page on GitHub
Last Updated:
Contributors: zsl, zwhuang
Next
02 Compilation Instructions