Rockchip Developer Guide Linux Software en
Rockchip Developer Guide Linux Software en
ID: RK-KF-YF-902
DISCLAIMER
Trademark Statement
"Rockchip", "瑞芯微", "瑞芯" shall be Rockchip’s registered trademarks and owned by Rockchip. All the other
trademarks or registered trademarks mentioned in this document shall be owned by their respective owners.
Beyond the scope of fair use, neither any entity nor individual shall extract, copy, or distribute this document in
any form in whole or in part without the written approval of Rockchip.
Website: [Link]
Overview
This document is a guide for Rockchip Buildroot/Debian/Yocto Linux system software and is designed to help
software development engineers and technical support engineers get started with the development and debugging
of the Rockchip Linux platform faster.
Intended Audience
Revision History
Date Author Version Change Description
2021- Caesar
V1.0.0 Initial version
04-10 Wang
2021- Caesar
V1.1.0 Added support for rk3399, rk3288,rk3326/px30
05-20 Wang
2021- Caesar
V1.2.0 Updated support for Linux4.4 and Linux4.19
09-30 Wang
2022- Caesar
V1.4.1 Updated chip support list and 2022 roadmap
05-20 Wang
2022- Caesar
V1.4.2 Update SDK version and support
06-20 Wang
2022- Caesar
V1.5.0 Updated support for Linux 5.10
09-20 Wang
2023- Caesar
V1.9.1 Updated RK3566/RK3568/RK3399 Linux4.19 SDK version
07-20 Wang
2023- Caesar
V2.0.0 Update the contents of each chapter
09-20 Wang
2023- Ruby
V2.0.1 Fix some description
12-05 Zhang
Date Author Version Change Description
Linux6.1SDK
linux-
6.1-
RK3588 2024.02 12 5.0 6.1 V1.1.0_20240620
stan-
rkr3
linux-
6.1-
RK3576 2024.02 12 5.0 6.1 V1.0.0_20240620
stan-
rkr3
linux-
6.1-
RK3568 2024.02 12 5.0 6.1 V1.0.0_20240620
stan-
rkr3
linux-
6.1-
RK3566 2024.02 12 5.0 6.1 V1.0.0_20240620
stan-
rkr3
Linux5.10 SDK
Buildroot Yocto Kernel TAG
Chipset DebianVersion SDK Version
Version Version Version Version
linux-
5.10-
RK3588 2021.11 11 4.0 5.10 V1.5.0_20240620
gen-
rkr8
linux-
5.10-
RK3562 2021.11 11 4.0 5.10 V1.2.0_20240620
stan-
rkr3
linux-
5.10-
RK3566 2021.11 11 4.0 5.10 V1.5.0_20240620
gen-
rkr8
linux-
5.10-
RK3568 2021.11 11 4.0 5.10 V1.5.0_20240620
gen-
rkr8
linux-
5.10-
RK3399 2021.11 11 4.0 5.10 V1.5.0_20240620
gen-
rkr8
linux-
5.10-
RK3358 2021.11 N/A N/A 5.10 V1.4.0_20240620
gen-
rkr8
linux-
5.10-
RK3328 2021.11 N/A 4.0 5.10 V1.1.0_20240620
gen-
rkr8
linux-
5.10-
RK3326 2021.11 N/A N/A 5.10 V1.5.0_20240620
gen-
rkr8
linux-
5.10-
PX30 2021.11 11 4.0 5.10 V1.5.0_20240620
gen-
rkr8
linux-
5.10-
RK3308 2021.11 N/A N/A 5.10 V1.5.0_20240620
gen-
rkr8
linux-
5.10-
RK3288 2021.11 11 4.0 5.10 V1.2.0_20240620
gen-
rkr8
Buildroot Yocto Kernel TAG
Chipset DebianVersion SDK Version
Version Version Version Version
linux-
5.10-
RK312X 2021.11 N/A N/A 5.10 V1.4.0_20240620
gen-
rkr8
linux-
5.10-
RK3036 2021.11 N/A N/A 5.10 V1.4.0_20240620
gen-
rkr8
Linux 6.1 2023-12-20 Future - Long Term Support (until April 2028)
The Linux Kernel's last stable release each year is designated as the LTS version. However, the exact number of
versions released annually varies, usually around 5 to 6, making it difficult to predict the specific version number
of the next LTS. The maintenance duration for LTS versions also varies, based on their usage extent. Typically, it
starts with 2 years and may extend to 4 or 6 years (not guaranteed).
Kernel Release
The currently released SDKs for Kernel versions 4.4, 4.19, 5.10, and 6.1 are long-term supported versions by
Rockchip.
Regarding the next kernel LTS version: Rockchip's kernel update strategy involves releasing an LTS (Long-Term
Support) version every two years, which is offset by one year compared to the mainline kernel's strategy of
releasing an LTS version every year. For example, if the mainline releases one LTS version annually, Rockchip
releases one every two years. Therefore, the subsequent LTS version for Rockchip will be released in 2024,
followed by another in 2026, and so on.
1.3 Buildroot Roadmap
The current officially supported Buildroot versions by RK are 2018.02 and 2021.11 .
2024.02 Mar 2024 Q4 2024 Future - Long Term Support (until April 2028)
The Buildroot community releases a new version every three months, and one stable version is released annually.
Buildroot Release
The current officially supported Yocto versions by RK range from Dunfell (3.1) to Kirkstone (4.0), with the main
maintenance version being Kirkstone (4.0).
Yocto SDK
Version Support Level
Released Released
Kirkstone (4.0) May 2022 2022-12-20 Long Term Support (Apr 2026¹)
The Yocto community typically releases two major versions each year, usually in the spring and autumn seasons.
Yocto Release
The current officially supported Debian versions by RK range from Stretch (9) to Bookworm (12), with the main
maintenance version being Bullseye (11).
Debian Release
2. SDK
2.1 Overview
Rockchip Linux SDK supports Buildroot, Yocto and Debian systems. Kernel is based on Kernel 4.4, Kernel 4.19
or Kernel5.10, and boot is based on U-boot v2017.09. It is suitable for all Linux products developed or secondary
developed based on Rockchip EVB development board.
The development kit is suitable for but not limited to industrial applications, smart homes, consumer electronics,
office and conference and other AIoT products, and provides flexible data path combination interfaces to meet
the customized requirement of customers for free combination. For specific function debugging and interface
description, please read the documents under the project directory docs/.
To get Rockchip Linux SDK, customers need an account to access the source code repository provided by
Rockchip. In order to get code synchronization permission, please provide SSH public key for server
authentication and authorization when apply for SDK from Rockchip technical window. About Rockchip server
SSH public key authorization, please refer to SSH Public Key Operation Introduction.
Repo, a tool built on Python script by Google to help manage git repositories, is mainly used to download and
manage software repository of projects. The download address is as follows:
For quick access to SDK source code, Rockchip Technical Window usually provides corresponding version of
SDK initial compression package. In this way, developers can get SDK source code through decompressing the
initial compression package, which is the same as the one downloaded by repo.
Take RK3588_LINUX6.1_SDK_RELEASE_V1.0.0_20231220.tgz for example, After getting a initialization
package, you can get source code by running the following command:
mkdir rk3588
tar xvf RK3588_LINUX6.1_SDK_RELEASE_V1.0.0_20231220.tgz -C rk3588
cd rk3588
.repo/repo/repo sync -l
.repo/repo/repo sync -c
Developers can update via .repo/repo/repo sync -c command according to update introductions that are
regularly released by FAE window.
Note:
The software release version can be checked through the project xml file. The detailed way is as follows:
The initial compressed SDK packages currently released for Linux6.2 are as follows:
Chipset Compressed Package Version
The initial compressed SDK packages currently released for Linux5.10 are as follows:
Notice:
The initial compressed package may be replaced and updated with a new version!
make ARCH=arm64
./[Link] rockchip_linux_defconfig ./[Link]
./[Link]
RK3588S EVB RK3588S EVB1 lunch:rockchip_rk3588s_evb1_lp4x_v10_defconfig rk3588_linux.config; rk3588 --spl-
rootfs
&& ./[Link] make ARCH=arm64 rk3588s-evb1- new
[Link] -j24
make ARCH=arm64
./[Link] rockchip_linux_defconfig ./[Link]
./[Link]
RK3588 EVB RK3588 EVB1 lunch:rockchip_rk3588_evb1_lp4_v10_defconfig && rk3588_linux.config; rk3588 --spl-
rootfs
./[Link] make ARCH=arm64 rk3588-evb1- new
[Link] -j24
make ARCH=arm64
./[Link] rockchip_linux_defconfig ./[Link]
./[Link]
RK3588 EVB RK3588 EVB7 lunch:rockchip_rk3588_evb7_lp4_v10_defconfig && rk3588_linux.config; rk3588 --spl-
rootfs
./[Link] make ARCH=arm64 rk3588-evb7- new
[Link] -j24
make ARCH=arm64
./[Link] ./[Link]
./[Link] rockchip_linux_defconfig;
RK3576 EVB RK3576 EVB1 lunch:rockchip_rk3576_evb1_v10_defconfig && rk3576 --spl-
rootfs make ARCH=arm64 rk3576-evb1-
./[Link] new
[Link] -j24
make ARCH=arm64
./[Link] ./[Link]
./[Link] rockchip_linux_defconfig;
RK3568 EVB RK3568 EVB1 lunch:rockchip_rk3568_evb1_ddr4_v10_defconfig rk3568 --spl-
rootfs make ARCH=arm64 rk3568-evb1-
&& ./[Link] new
[Link] -j24
make ARCH=arm64
./[Link] ./[Link]
./[Link] rockchip_linux_defconfig;
RK3568 EVB RK3568 EVB8 lunch:rockchip_rk3568_evb8_lp4_v10_defconfig && rk3568 --spl-
rootfs make ARCH=arm64 rk3568-evb8-
./[Link] new
[Link] -j24
make ARCH=arm64
./[Link] ./[Link]
./[Link] rockchip_linux_defconfig;
RK3566 EVB RK3566 EVB2 lunch:rockchip_rk3566_evb2_lp4x_v10_defconfig rk3566 --spl-
rootfs make ARCH=arm64 rk3566-evb2-
&& ./[Link] new
[Link] -j24
make ARCH=arm64
./[Link] ./[Link]
./[Link] rk3562_linux_dictpen_defconfig;
RK3562 Porduct Dictionary pen lunch:rockchip_rk3562_dictpen_test3_v20_defconfig rk3562 --spl-
rootfs make ARCH=arm64 rk3562-
&& ./[Link] new
[Link] -j24
make ARCH=arm64
Robot ./[Link] rockchip_linux_defconfig ./[Link]
./[Link]
RK3562 Vacuum RK3562 EVB1 lunch:rockchip_rk3562_evb1_lp4x_v10_defconfig rk3562_robot.config; rk3562 --spl-
rootfs
Cleaner && ./[Link] make ARCH=arm64 rk3562-evb1- new
[Link] -j24
make ARCH=arm64
Robot ./[Link] rockchip_linux_defconfig ./[Link]
./[Link]
RK3562 Vacuum RK3562 EVB2 lunch:rockchip_rk3562_evb2_ddr4_v10_defconfig rk3562_robot.config; rk3562 --spl-
rootfs
Cleaner && ./[Link] make ARCH=arm64 rk3562-evb2- new
[Link] -j24
make ARCH=arm64
./[Link] ./[Link]
./[Link] rockchip_linux_defconfig;
RK3562 EVB RK3562 EVB1 lunch:rockchip_rk3562_evb1_lp4x_v10_defconfig rk3562 --spl-
rootfs make ARCH=arm64 rk3562-evb1-
&& ./[Link] new
[Link] -j24
make ARCH=arm64
./[Link] ./[Link]
./[Link] rockchip_linux_defconfig;
RK3562 EVB RK3562 EVB2 lunch:rockchip_rk3562_evb2_ddr4_v10_defconfig rk3562 --spl-
rootfs make ARCH=arm64 rk3562-evb2-
&& ./[Link] new
[Link] -j24
make ARCH=arm64
./[Link]
Industry ./[Link] rockchip_linux_defconfig; ./[Link]
RK3399 RK3399 EVB IND lunch:rockchip_rk3399_evb_ind_lpddr4_defconfig
board rootfs make ARCH=arm64 rk3399-evb- rk3399
&& ./[Link]
[Link] -j24
make ARCH=arm64
./[Link]
RK3399 SAPPHIRE ./[Link] rockchip_linux_defconfig; ./[Link]
RK3399 excavator lunch:rockchip_rk3399_sapphire_excavator_defconfig
EXCAVATOR rootfs make ARCH=arm64 rk3399- rk3399
&& ./[Link]
[Link] -j24
make ARCH=arm64
./[Link]
./[Link] rockchip_linux_defconfig; ./[Link]
RK3326 EVB RK3326 EVB lunch:rockchip_rk3326_evb_lp3_v12_defconfig &&
rootfs make ARCH=arm64 rk3399- rk3399
./[Link]
[Link] -j24
make ARCH=arm
./[Link]
RK3288 EVB ./[Link] rockchip_linux_defconfig; ./[Link]
RK3288 EVB lunch:rockchip_rk3288w_evb_rk808_defconfig &&
RK808 rootfs make ARCH=arm rk3288-evb- rk3288
./[Link]
[Link] -j24
Note:
Rootfs Building:
The SDK build Buildroot system by default. If you need other systems, you can set environment
variables. for example:
Build Buildroot system: RK_ROOTFS_SYSTEM=buildroot ./[Link]
Build Debian system: RK_ROOTFS_SYSTEM=debian ./[Link]
Build Yocto system: RK_ROOTFS_SYSTEM=yocto ./[Link]
Build Kernel, U-boot: a tool chain needs to be specified.
SDK has a built-in 32-bit tool chain, for example:
export CROSS_COMPILE=../prebuilts/gcc/linux-x86/aarch64/gcc-arm-10.3-2021.07-x86_64-aarch64-
none-linux-gnu/bin/aarch64-none-linux-gnu-
3. Documents Introduction
Documents released with Rockchip Linux SDK are designed to help developers quickly get started with
development and debugging. The content involved in the documents does not cover all development information
and issues. The document list will also be constantly updated. If you have any questions or requirements about
documents, please contact our FAE window fae@[Link].
The docs directory in Rockchip Linux SDK is divided into two parts: Chinese (cn) and English (en) The Chinese
directory comes with Common (general development guidance documents), Socs (chip platform related
documents), Linux (Linux system development related documents), Others (other reference documents),
docs_list_en.txt (docs file directory structure), and the detailed introduction as follows:
For details, see the <SDK>/docs/en/Common/AMP directory. The AMP system is a general-purpose multicore
heterogeneous system solution provided by Rockchip, which has been widely used in industrial applications such
as power and industrial control, as well as consumer products like vacuum cleaners.
It includes audio algorithms for microphones and relevant development documents for audio/Pulseaudio
modules. The reference documents are as follows:
docs/en/Common/AUDIO/
├── Algorithms
├── Rockchip_Developer_Guide_Audio_EN.pdf
└── Rockchip_Developer_Guide_PulseAudio_EN.pdf
3.1.3 Peripheral Components Support List (AVL)
Please refer to <SDK>/docs/en/Common/AVL directory for details, which contains the support list for
DDR/eMMC/NAND FLASH/WIFI-BT/CAMERA. The support list is updated in real time on the redmine. The
link is as follows:
[Link]
For the Rockchip platform DDR chip support list, please refer to "Rockchip_Support_List_DDR_Ver2.[Link]" in
the <SDK>/docs/en/Common/AVL directory. The following table shows the support level of DDR. It is only
recommended to use chips marked with √ and T/A.
Table 1‑1 Rockchip DDR Support Symbol
Symbol Description
The eMMC chip support list for Rockchip platform can be found in the <SDK>/docs/en/Common/AVL
directory in the document titled 'RKeMMCSupportList_Ver1.81_20240329.pdff'. It is recommended to choose
chips marked with √ or T/A in the support level table below.
Table 1‑2 Rockchip eMMC Support Symbol
Symbol Description
To enhance system performance, it is necessary to choose high-performance eMMC chips. Before selecting an
eMMC chip, please refer to the models in the support list provided by Rockchip and pay close attention to the
performance section in the manufacturer's datasheet.
Please select eMMC chips based on the manufacturer's size specifications and the read/write speeds. It is
recommended to choose chips with sequential read speeds >200MB/s and sequential write speeds >40MB/s.
If there are any doubts about selection, you can also directly contact the Rockchip FAE team fae@rock-
[Link].
Figure 1‑1 eMMC Performance Example
The SPI NOR and SLC NAND Flash support list for Rockchip platform, can be found in the document titled
"RK_SpiNor_and_SLC_Nand_SupportList_V1.47_20240326.pdf" in the <SDK>/docs/en/Common/AVL
directory, the document also indicates the models of SPI NAND that can be selected. It is recommended to
choose chips marked with √ or T/A in the support level table below.
Table 1‑3 Rockchip SPI NOR and SLC NAND Support Symbol
Symbol Description
Nand Flash support list for Rockchip platform, can be found in the /docs/Common/AVL` directory in the
document titled “RKNandFlashSupportList Ver2.73_20180615.pdf”.the document also indicates the models of
Nand Flash that can be selected. It is recommended to choose chips marked with √ or T/A in the support level
table below.
Symbol Description
WIFI/BT Support List for Rockchip Platform can be found in the document titled
'Rockchip_Support_List_Linux_WiFi_BT_Ver1.9_20240329.pdf' in the <SDK>/docs/en/Common/AVL
directory. This document contains a comprehensive list of WIFI/BT chips tested extensively on the Rockchip
platform. It is advisable to select models based on the list. For the testing of other WIFI/BT chips, corresponding
kernel drivers should be provided from the original manufacturers of the WIFI/BT chips.
For any questions about chip selection, it is recommended to contact the Rockchip FAE team at fae@rock-chips.c
om.
Camera Support List for Rockchip Platform can be found in the Camera Module Support List. This online list
contains a comprehensive collection of Camera Modules extensively tested on the Rockchip platform. It is
advisable to select models based on the list.
For any questions about module selection, it is recommended to contact the Rockchip FAE team at fae@rock-chi
[Link].
CAN bus, also known as Controller Area Network, is an efficient serial communication network used for
distributed control or real-time control. The following documents mainly cover CAN driver development,
communication testing tools, common command interfaces, and frequently asked questions.
docs/en/Common/CAN/
├── Rockchip_Developer_Guide_CAN_FD_EN.pdf
└── Rockchip_Developer_Guide_Can_EN.pdf
This document primarily covers clock development on the Rockchip platform, including Clock, GPIO, PLL
spreading, etc.
docs/en/Common/CLK/
├── Rockchip_Developer_Guide_Clock_EN.pdf
├── Rockchip_Developer_Guide_Gpio_Output_Clocks_EN.pdf
└── Rockchip_Developer_Guide_Pll_Ssmod_Clock_EN.pdf
The following documents primarily focus on the development of Rockchip Crypto and HWRNG (TRNG),
including driver development and upper-layer application development.
docs/en/Common/CRYPTO/
└── Rockchip_Developer_Guide_Crypto_HWRNG_EN.pdf
3.1.7 DDR Module Document (DDR)
This module document mainly includes DDR development guide, DDR issue troubleshooting, DDR chip
validation process, DDR board layout instructions, DDR bandwidth tool usage, and DDR DQ eye diagram tool,
etc. for Rockchip platform.
docs/en/Common/DDR/
├── [Link]
This module document mainly includes introduction to the use of debugging tools such as DS5,
FT232H_USB2JTAG, GDB_ADB, Eclipse_OpenOCD, etc. for Rockchip platform.
docs/en/Common/DEBUG/
├── Rockchip_Developer_Guide_DS5_EN.pdf
├── Rockchip_Developer_Guide_FT232H_USB2JTAG.pdf
├── Rockchip_Developer_Guide_GDB_Over_ADB_EN.pdf
└── Rockchip_Developer_Guide_GNU_MCU_Eclipse_OpenOCD_EN.pdf
This module document mainly includes development documents about DRM, DP, HDMI, MIPI, RK628 and
other display modules for Rockchip platform.
docs/en/Common/DISPLAY/
├── DP
├── HDMI
├── MIPI
├── RK628
├── Rockchip_BT656_TX_AND_BT1120_TX_Developer_Guide_EN.pdf
├── Rockchip_Developer_Guide_Baseparameter_Format_Define_And_Use_EN.pdf
├── Rockchip_Developer_Guide_DRM_Display_Driver_EN.pdf
├── Rockchip_Developer_Guide_RGB_MCU_EN.pdf
├── Rockchip_Develop_Guide_DRM_Direct_Show_EN.pdf
├── Rockchip_DRM_Panel_Porting_Guide_V1.6_20190228.pdf
└── Rockchip_RK3588_Developer_Guide_MIPI_DSI2_EN.pdf
This module document primarily covers CPU/GPU/DDR and other dynamic frequency and voltage adjustment
modules for Rockchip platform.
Cpufreq and Devfreq are a set of framework models defined by kernel developers that support dynamic
frequency and voltage adjustment based on specified governors. It effectively reduces power consumption while
balancing performance.
docs/en/Common/DVFS/
├── Rockchip_Developer_Guide_CPUFreq_EN.pdf
└── Rockchip_Developer_Guide_Devfreq_EN.pdf
This module document primarily includes the development documentation related to the file system on the
Rockchip platform.
docs/en/Common/FS/
└── Rockchip_Developer_FAQ_FileSystem_EN.pdf
This module document primarily includes the development documentation related to the Ethernet GMAC
interface on the Rockchip platform.
docs/en/Common/GMAC/
├── Rockchip_Developer_Guide_Linux_GMAC_EN.pdf
├── Rockchip_Developer_Guide_Linux_GMAC_DPDK_EN.pdf
├── Rockchip_Developer_Guide_Linux_GMAC_Mode_Configuration_EN.pdf
├── Rockchip_Developer_Guide_Linux_GMAC_RGMII_Delayline_EN.pdf
└── Rockchip_Developer_Guide_Linux_MAC_TO_MAC_EN.pdf
This module document mainly contains development documents related to the HDMI-IN interface of the
Rockchip platform.
docs/en/Common/HDMI-IN/
├── Rockchip_Developer_Guide_HDMI_IN_Based_On_CameraHal3_EN.pdf
└── Rockchip_Developer_Guide_HDMI_RX_EN.pdf
This module document mainly contains development documents related to I2C interface of the Rockchip
platform.
docs/en/Common/I2C/
└── Rockchip_Developer_Guide_I2C_EN.pdf
3.1.15 IO Power Domain Module Document (IO-DOMAIN)
In the Rockchip platform, IO voltages generally include 1.8V, 3.3V, 2.5V, 5.0V, etc. Some IO interfaces support
multiple voltage levels. The io-domain is responsible for configuring the IO power domain registers. It configures
the corresponding voltage registers based on the actual hardware voltage range. Without proper configuration, the
IO interfaces cannot function correctly.
docs/en/Common/IO-DOMAIN/
└── Rockchip_Developer_Guide_Linux_IO_DOMAIN_EN.pdf
It mainly introduces the Rockchip platform IOMMU for converting 32-bit virtual addresses and physical
addresses. It has read and write control bits and can generate page missing exceptions and bus exception
interrupts.
docs/en/Common/IOMMU/
└── Rockchip_Developer_Guide_Linux_IOMMU_EN.pdf
It contains ISP development documents, VI driver development documents, IQ Tool development documents,
debugging documents and color debugging documents. The reference documents are as follows:
docs/en/Common/ISP/
├── ISP1.X
├── ISP21
├── ISP30
├── ISP32-lite
└── [Link]
Note :
Reference documents about RK3288/RK3399/RK3326/RK1808 Linux(kernel-4.4) rkisp1 driver, sensor
driver, vcm driver is: "RKISP_Driver_User_Manual_v1.3_20190919";
RK3288/RK3399/RK3326/RK1808 Linux(kernel-4.4) camera_engine_rkisp (3A repositry) reference
documents is: "camera_engine_rkisp_user_manual_v2.0";
Reference document for IQ effect file parameters of RK3288/RK3399/RK3326/RK1808 Linux(kernel-4.4)
camera_engine_rkisp v2.0.0 version v2.0.0 and above is:
"RKISP1_IQ_Parameters_User_Guide_v1.0_20190606".
3.1.18 MCU Module Document (MCU)
docs/en/Common/MCU/
└── Rockchip_RK3399_Developer_Guide_MCU_EN.pdf
Development guide for interfaces such as SDIO, SDMMC, and eMMC on the Rockchip platform.
docs/en/Common/MMC/
├── Rockchip_Developer_Guide_SDMMC_SDIO_eMMC_EN.pdf
└── Rockchip_Developer_Guide_SD_Boot_EN.pdf
Process memory module mechanisms such as CMA and DMABUF on the Rockchip platform.
docs/en/Common/MEMORY/
├── Rockchip_Developer_Guide_Linux_CMA_EN.pdf
├── Rockchip_Developer_Guide_Linux_DMABUF_EN.pdf
├── Rockchip_Developer_Guide_Linux_Meminfo_EN.pdf
└── Rockchip_Developer_Guide_Linux_Memory_Allocator_EN.pdf
docs/en/Common/MPP/
└── Rockchip_Developer_Guide_MPP_EN.pdf
RKNN-TOOLKIT2:
RKNN-Toolkit2 is a development kit for generating and evaluating RKNN models on a PC:
The development kit is located in the external/rknn-toolkit2 directory, mainly used to implement a series
of functions such as model conversion, optimization, quantization, inference, performance evaluation, and
accuracy analysis.
Model Supports performance and memory evaluation of the model on the NPU hardware
Evaluation platform
Accuracy
Supports quantization accuracy analysis function (simulator/NPU)
Analysis
Additional
Supports version/device query functions, etc.
Features
For specific usage instructions, please refer to the current doc/ directory documentation:
├── 01_Rockchip_RKNPU_Quick_Start_RKNN_SDK_V2.0.0beta0_EN.pdf
...
├── RKNNToolKit2_API_Difference_With_Toolkit1-[Link]
└── RKNNToolKit2_OP_Support-[Link]
RKNN API:
The development instructions for RKNN API are located in the project directory external/rknpu2 , used for
inferring RKNN-Toolkit2 generated rknn models.
For specific usage instructions, please refer to the current doc/ directory documentation:
...
├── 02_Rockchip_RKNPU_User_Guide_RKNN_SDK_V2.0.0beta0_EN.pdf
├── 03_Rockchip_RKNPU_API_Reference_RKNN_Toolkit2_V2.0.0beta0_EN.pdf
└── 04_Rockchip_RKNPU_API_Reference_RKNNRT_V2.0.0beta0_EN.pdf
It mainly introduces the boot process on the Rockchip platform, configuring and debugging storage, OTP OEM
area burning and other security interfaces。
docs/en/Common/NVM/
├── Rockchip_Application_Notes_Storage_EN.pdf
├── Rockchip_Developer_FAQ_Storage_EN.pdf
├── Rockchip_Developer_Guide_Dual_Storage_EN.pdf
└── Rockchip_Developer_Guide_SATA_EN.pdf
docs/en/Common/PCIe/
├── Rockchip_Developer_Guide_PCIe_EN.pdf
├── Rockchip_Developer_Guide_PCIE_EP_Stardard_Card_EN.pdf
├── Rockchip_Developer_Guide_PCIe_Performance_EN.pdf
├── Rockchip_PCIe_Virtualization_Developer_Guide_EN.pdf
└── Rockchip_RK3399_Developer_Guide_PCIe_EN.pdf
docs/en/Common/PERF/
├── Rockchip_Develop_Guide_Linux_RealTime_Performance_Test_Report_EN.pdf
├── Rockchip_Optimize_Tutorial_Linux_IO_EN.pdf
├── Rockchip_Quick_Start_Linux_Perf_EN.pdf
├── Rockchip_Quick_Start_Linux_Performance_Analyse_EN.pdf
├── Rockchip_Quick_Start_Linux_Streamline_EN.pdf
└── Rockchip_Quick_Start_Linux_Systrace_EN.pdf
docs/en/Common/PINCTRL/
└── Rockchip_Developer_Guide_Linux_Pinctrl_EN.pdf
Developer guide for PMICs such as RK805, RK806, RK808, RK809, and RK817 on the Rockchip platform.
docs/en/Common/PMIC/
├── Rockchip_RK805_Developer_Guide_EN.pdf
├── Rockchip_RK806_Developer_Guide_EN.pdf
├── Rockchip_RK808_Developer_Guide_EN.pdf
├── Rockchip_RK809_Developer_Guide_EN.pdf
├── Rockchip_RK816_Developer_Guide_EN.pdf
├── Rockchip_RK817_Developer_Guide_EN.pdf
├── Rockchip_RK818_Developer_Guide_EN.pdf
├── Rockchip_RK818_RK816_Developer_Guide_Fuel_Gauge_EN.pdf
└── Rockchip_RK818_RK816_Introduction_Fuel_Gauge_Log_EN.pdf
Basic concepts and optimization methods for chip power consumption on Rockchip platform.
docs/en/Common/POWER/
└── Rockchip_Developer_Guide_Power_Analysis_EN.pdf
docs/en/Common/PWM
└── Rockchip_Developer_Guide_Linux_PWM_EN.pdf
docs/en/Common/RGA/
├── Rockchip_Developer_Guide_RGA_EN.pdf
└── Rockchip_FAQ_RGA_EN.pdf
docs/en/Common/SARADC/
└── Rockchip_Developer_Guide_Linux_SARADC_EN.pdf
docs/en/Common/THERMAL/
└── Rockchip_Developer_Guide_Thermal_EN.pdf
Instructions for using tools such as partitioning, mass production burning, and factory line burning on the
Rockchip platform.
docs/en/Common/TOOL/
├── [Link]
├── RKUpgrade_Dll_UserManual.pdf
├── [Link]
├── Rockchip_Introduction_Partition_EN.pdf
└── Rockchip_User_Guide_Production_For_Firmware_Download_EN.pdf
Introduction to functions such as TRUST and sleep & wake-up on the Rockchip platform
docs/en/Common/TRUST/
├── Rockchip_Developer_Guide_Trust_EN.pdf
├── Rockchip_RK3308_Developer_Guide_System_Suspend_EN.pdf
├── Rockchip_RK3399_Developer_Guide_System_Suspend_EN.pdf
├── Rockchip_RK356X_Developer_Guide_System_Suspend_EN.pdf
├── Rockchip_RK3576_Developer_Guide_System_Suspend_EN.pdf
└── Rockchip_RK3588_Developer_Guide_System_Suspend_EN.pdf
docs/en/Common/UART/
├── Rockchip_Developer_Guide_UART_EN.pdf
└── Rockchip_Developer_Guide_UART_FAQ_EN.pdf
3.1.37 UBOOT Module Document (UBOOT)
docs/en/Common/UBOOT/
├── Rockchip_Developer_Guide_Linux_AB_System_EN.pdf
├── Rockchip_Developer_Guide_U-Boot_TFTP_Upgrade_EN.pdf
├── Rockchip_Developer_Guide_UBoot_MMC_Device_Analysis_EN.pdf
├── Rockchip_Developer_Guide_UBoot_MTD_Block_Device_Design_EN.pdf
├── Rockchip_Developer_Guide_UBoot_Nextdev_EN.pdf
└── Rockchip_Introduction_UBoot_rkdevelop_vs_nextdev_EN.pdf
Introduction to USB development guide, USB signal testing and debugging tools on the Rockchip platform
docs/en/Common/USB/
├── Rockchip_Developer_Guide_Linux_USB_Initialization_Log_Analysis_EN.pdf
├── Rockchip_Developer_Guide_Linux_USB_PHY_EN.pdf
├── Rockchip_Developer_Guide_Linux_USB_Performance_Analysis_EN.pdf
├── Rockchip_Developer_Guide_USB2_Compliance_Test_EN.pdf
├── Rockchip_Developer_Guide_USB_EN.pdf
├── Rockchip_Developer_Guide_USB_FFS_Test_Demo_EN.pdf
├── Rockchip_Developer_Guide_USB_Gadget_UAC_EN.pdf
├── Rockchip_Developer_Guide_USB_SQ_Test_EN.pdf
├── Rockchip_Introduction_USB_SQ_Tool_EN.pdf
├── Rockchip_RK3399_Developer_Guide_USB_EN.pdf
├── Rockchip_RK3399_Developer_Guide_USB_DTS_EN.pdf
├── Rockchip_RK356x_Developer_Guide_USB_EN.pdf
├── Rockchip_RK3588_Developer_Guide_USB_EN.pdf
├── Rockchip_Trouble_Shooting_Linux4.19_USB_Gadget_UVC_EN.pdf
└── Rockchip_Trouble_Shooting_Linux_USB_Host_UVC_EN.pdf
docs/en/Common/WATCHDOG/
└── Rockchip_Developer_Guide_Linux_WDT_EN.pdf
3.2.1 ApplicationNote
Development instructions for applications on the Rockchip platform, such as ROS, RetroArch, USB, etc
docs/en/Linux/ApplicationNote/
├── Rockchip_Developer_Guide_Linux_Flash_Open_Source_Solution_EN.pdf
├── Rockchip_Instruction_Linux_ROS2_EN.pdf
├── Rockchip_Instruction_Linux_ROS_EN.pdf
├── Rockchip_Quick_Start_Linux_USB_Gadget_EN.pdf
└── Rockchip_Use_Guide_Linux_RetroArch_EN.pdf
docs/en/Linux/Audio/
├── Rockchip_Developer_Guide_Microphone_Array_TEST_EN.pdf
├── Rockchip_Developer_Guide_Microphone_Array_Tuning.pdf
└── Rockchip_Introduction_Linux_Audio_3A_Algorithm_EN.pdf
MIPI/CSI Camera and Structured Light Development Guide on the Rockchip Platform
docs/en/Linux/Camera/
├── Rockchip_Developer_Guide_Linux4.4_Camera_EN.pdf
├── Rockchip_Developer_Guide_Linux_RMSL_EN.pdf
└── Rockchip_Trouble_Shooting_Linux4.4_Camera_EN.pdf
└── Rockchip_Trouble_Shooting_Linux5.10_Camera_EN.pdf
3.2.4 Docker Development Documents (Docker)
Docker build and development of third-party systems such as Debian/Buildroot on the Rockchip platform.
docs/en/Linux/Docker/
├── Rockchip_Developer_Guide_Debian_Docker_EN.pdf
├── Rockchip_Developer_Guide_Linux_Docker_Deploy_EN.pdf
└── Rockchip_User_Guide_SDK_Docker_EN.pdf
docs/en/Linux/Graphics/
├── Rockchip_Developer_Guide_Buildroot_Weston_EN.pdf
└── Rockchip_Developer_Guide_Linux_Graphics_EN.pdf
└── Rockchip_Developer_Guide_Linux_LVGL_EN.pdf
3.2.6 Multimedia
The general process of video encoding and decoding on the Rockchip Linux platform:
Currently, gstreamer is used in Debian/Buildroot systems by default to connect apps and codec components.
docs/en/Linux/Multimedia/
├── Rockchip_Developer_Guide_Linux_RKADK_EN.pdf
├── Rockchip_User_Guide_Linux_Gstreamer_EN.pdf
└── Rockchip_User_Guide_Linux_Rockit_EN.pdf
Encoding and decoding functionalities can also be tested directly through the testing interfaces provided by MPP
(such as mpi_dec_test\mpi_enc_test...). MPP source code reference is located in <SDK>/external/mpp/ . For
testing demos, please refer to <SDK>/external/mpp/test . Please refer to the SDK document
Rockchip_Developer_Guide_MPP_EN.pdf for details.
Below are the reference specifications for common chip encoding and decoding capabilities on each platform.
Note: The maximum testing specifications are related to numerous factors, so the same decoding IP
specifications might differ among different chips. Chip support may vary in different systems, leading to
differences in supported formats and performance.
An introduction to the recovery development process and upgrade during OTA upgrade of Rockchip Linux
platform.
docs/en/Linux/Recovery/
├── Rockchip_Developer_Guide_Linux_DFU_Upgrade_EN.pdf
├── Rockchip_Developer_Guide_Linux_Recovery_EN.pdf
├── Rockchip_Developer_Guide_Linux_Upgrade_EN.pdf
└── Rockchip_Introduction_Smart_Screen_OTA_EN.pdf
Introduction to the secure boot solution of Securboot and TEE on Rockchip Linux platform
docs/en/Linux/Security/
├── Rockchip_Developer_Guide_Linux_Secure_Boot_EN.pdf
└── Rockchip_Developer_Guide_TEE_SDK_EN.pdf
Introduction to the porting and development guide for Debian and other third-party systems on the Rockchip
Linux platform
docs/en/Linux/System/
├── Rockchip_Developer_Guide_Buildroot_EN.pdf
├── Rockchip_Developer_Guide_Debian_EN.pdf
└── Rockchip_Developer_Guide_Third_Party_System_Adaptation_EN.pdf
docs/en/Linux/Uefi/
└── Rockchip_Developer_Guide_UEFI_EN.pdf
3.2.12 Network Module (RKWIFIBT)
docs/en/Linux/Wifibt/
├── AP module RF test document
├── REALTEK module RF test document
├── Rockchip_Developer_Guide_Linux_WIFI_BT_EN.pdf
├── WIFIBT programming interface
└── WIFI performance testing PC tool
docs/en/Linux/DPDK/
└── Rockchip_Developer_Guide_Linux_DPDK_EN.pdf
Refer to the documentation in the <SDK>/docs/en/<chipset_name> directory. Normally, it will include the
release notes, quick start, software development guide, hardware development guide, Datasheet, etc.
It contains an overview of the chip, supported main functions, instructions for obtaining the SDK, etc.
Normally, it will include software and hardware development guide, SDK build, SDK pre-build firmware, SDK
burning, etc.
Please refer to the documentation in the <SDK>/docs/en/<chipset_name>/Quick-start directory.
In order to help developers get familiar with the development and debugging of the SDK faster, the
"Rockchip_Developer_Guide_Linux_Software_EN.pdf" document can be obtained from the
/docs/en/<chip_name>/ directory and will be continuously improved and updated.
3.4 Datasheet
In order to help developers get familiar with chip development and debugging faster, a chip datasheet is released
with the SDK.
Rockchip platform will have corresponding hardware reference documents released with the SDK software
package. The hardware user guide mainly introduces the basic features, hardware interfaces, and usage methods
of the reference hardware board. It aims to assist developers in using the EVB more quickly and accurately, and
in developing related products. For more details, please refer to the documents in the
<SDK>/docs/en/<chip_name>/Hardware directory.
For other reference documents, such as Repo mirror environment construction, Rockchip SDK application and
synchronization guide, Rockchip Bug system usage guide, etc., please refer to the documents in the
<SDK>/docs/en/Others directory.
docs/en/Others/
├── Rockchip_Developer_Guide_Repo_Mirror_Server_Deploy_EN.pdf
├── Rockchip_Trouble_Shooting_Linux_Real-Time_Performance_EN.pdf
├── Rockchip_User_Guide_Bug_System_EN.pdf
└── Rockchip_User_Guide_SDK_Application_And_Synchronization_EN.pdf
├── Common
├── Linux
├── Others
├── Rockchip_Developer_Guide_Linux_Software_EN.pdf
├──<chipset_name>
└── docs_list_en.txt
4. Tools Introduction
Tools released with the Rockchip Linux SDK are used for development, debugging, and mass production process.
The tool versions will be continuously updated along with SDK updates. If you have any questions or
requirements about the tools, please contact our FAE team: fae@[Link].
In the Rockchip Linux SDK, tools are included in the tools directory for use in Linux (tools for Linux
operating system environment), Mac (tools for macOS operating system environment), and Windows (tools for
Windows operating system environment).
Windows Tools
Linux Tools
SPI NOR firmware packing tool (the generated firmware can be used in
Firmware_Merger
the programmer)
Mac tools
The SDK provides Windows burning tools (the tool version requires V3.31 or above), which is located in
the project root directory:
<SDK>/tools/windows/RKDevTool/
The SDK provides Linux burning tools (the version of Linux_Upgrade_Tool requires V2.26 or above), the
tool is located in the project root directory:
<SDK>/tools/linux/Linux_Upgrade_Tool/Linux_Upgrade_Tool
Mainly used to package each discrete firmware into a complete [Link] firmware for easy upgrade.
How to package [Link] firmware in Windows environment, run the following command to generate
[Link]
<SDK>/tools/windows/RKDevTool/rockdev/[Link]
How to package [Link] firmware in Linux environment, run the following command to generate
[Link]
<SDK>/tools/linux/Linux_Pack_Firmware/rockdev/[Link]
It is used for making SD card upgrades, SD card booting, and SD card PCBA testing.
<SDK>/tools/windows/SDDiskTool_v1.[Link]
4.5 Device Information Writing Tool
<SDK>/tools/windows/RKDevInfoWriteTool*
Unzip RKDevInfoWriteTool-1.3.0.7z and install it. Open the software with administrator rights. Please refer to
the Rockchip_User_Guide_RKDevInfoWriteTool_EN.pdf in the current directory for tool usage,.
4.6 Firmware Signature Tool
The SDK provides Windows signature tool which is located in the project root directory:
<SDK>/tools/windows/SecureBootTool_v2.2
The SDK provides Linux signing tool which is located in the project root directory:
<SDK>/tools/linux/rk_sign_tool_v1.31_linux.zip
rk_sign_tool_v1.3_linux$ ./rk_sign_tool
rk_sign_tool is a tool signing firmware and loader for secureboot
usage of rk_sign_tool v1.3:
CC <--chip chip_id> //select sign options by chip
KK [--bits default=2048] <--out> //generating rsa key pairs
LK <--key> <--pubkey> //loading rsa key pairs
SI [--key] <--img> [--pss] //signing image like boot uboot trust
SL [--key] [--pubkey] <--loader> [--little] [--pss] //signing loader like
RKXX_loader.bin
SF [--key] [--pubkey] <--firmware> [--little] [--pss] //signing firmware like
[Link]
SB [--key] <--bin> [--pss] //signing binary file
GH <--bin> <--sha 160|256> [--little] //computing sha of binary file
******rk_sign_tool XX -h to get more help******
It is used for mass production of programmer image making tools, this tool is located at:
<SDK>/tools/windows/programmer_image_tool or
<SDK>/tools/linux/programmer_image_tool
Programmer image creation steps:
Please refer to the user_manual.pdf document in the tool directory for more instructions.
PCBA testing tools are used to help quickly identify the quality of product functions during mass production and
improve production efficiency. Currently includes screen(LCD), wireless (Wi-Fi), Bluetooth (bluetooth),
DDR/eMMC storage, SD card (sdcard), USB HOST, key (KEY), speaker and earphone (Codec) and other test
items.
These test items include automatic test items and manual test items. Wireless network, DDR/eMMC, and
Ethernet are automatic test items. Button, SD card, USB HOST, Codec are manual test items.
<SDK>/tools/windows/RKPCBATool_V1.[Link]
For detailed PCBA function configuration and usage instructions, please refer to:
It is used to test the hardware connection of DDR and troubleshoot hardware problems such as false soldering:
<SDK>/tools/windows/DDR_UserTool_v1.[Link]
4.10 eFuse Programming Tool
It is used for eFuse programming, suitable for RK3288/RK3368/RK3399/RK3399Pro and other platforms.
<SDK>/tools/windows/EfuseTool_v1.42zip
If the chip uses eFuse to enable the SecureBoot function, please ensure that there is no problem with the hardware
connection, because when eFuse is programmed, Kernel has not been started yet, so please ensure that
VCC_EFUSE has power in MaskRom state before it can be used.
<SDK>/tools/windows/FactoryTool_v1.91zip
<SDK>/tools/windows/ParameterTool_v1.[Link]
5. SDK Software Framework
A typical Linux SDK project directory includes buildroot, debian, app, kernel, u-boot, device, docs, external, etc.
Repositories are managed by manifests, and the repo tool is utilized to manage each directory or its
corresponding Git project, including the following subdirectories:
The general Linux SDK currently integrates several mainstream Linux distributions. Distributions refer to the
systems we commonly use on Linux hosts, providing users with pre-integrated Linux operating systems and
various application software. Linux distributions come in various forms, ranging from fully-featured desktop
systems to server versions and lightweight systems for small devices. For example, Debian supports desktop
versions, and there are customizable lightweight systems like Buildroot and Yocto.
Customers can choose the system of product based on detailed product requirements. The specific system
description are as follows:
5.1.2 Buildroot
The Buildroot system in Rockchip Linux SDK includes various system source code, drivers, tools, and
application software packages used for Linux system development. Buildroot is an open-source embedded Linux
system automatic build framework on the Linux platform. The entire Buildroot consists of Makefile scripts and
Kconfig configuration files. By configuring Buildroot, a complete Linux system software that can be directly
flashed and run on the device.
Advantages of Buildroot:
Source Code Building: Buildroot offers great flexibility through source code building.
Convenient Cross-Compilation Environment: It provides an easy-to-use cross-compilation environment
for quick and efficient building, making it beginner-friendly.
Component Configuration: Buildroot allows easy customization of various system components,
facilitating tailored development.
One of the most famous projects using Buildroot is OpenWrt. Images created with OpenWrt can run on routers
with 16 M SPI NOR flash memory, containing only essential components. This simplicity is achieved thanks to
Buildroot. The entire Buildroot project is maintained in a single Git repository.
Buildroot uses kconfig and make, a defconfig configuration represents a BSP support.
Buildroot itself does not have the ability to expand, and users need to complete the work through scripts. These
listed features are all different from Yocto.
Yocto, like Buildroot, is a set of tools for building embedded systems, but their styles are completely different.
Yocto projects are maintained through individual packages (meta), with some packages responsible for the core
and others for peripherals. Some packages are designed for running Rockchip chips, some for installing Weston,
and others for running Debian. Similar mechanisms are used for [Link]. The Yocto community is highly active
and expansive, allowing everyone to share their achievements on GitHub. This mechanism ensures that we can
reuse others' work from the internet, which is very valuable. Compared to the Buildroot system, Yocto has a
stronger compilation mechanism. It automatically handles dependencies and recompilation of third-party
packages. However, it is relatively complex and requires a VPN network.
Yocto is a very flexible build system that allows users to use the shell and Python to handle a variety of special
cases. Currently, the system is mainly targeted at foreign customers. If you need more information about Yocto,
check out the following references:
Yocto
Rockchip Yocto
At present, Yocto system is mainly used by overseas, enthusiasts or customers with secondary
development capabilities.
5.1.4 Debian
Debian is a Linux operating system that is completely free, open-source, and widely used on various devices. The
reasons for choosing Debian include:
The customized version of Debian for Rockchip is created through shell scripts, which involve obtaining Debian
distribution source code, compiling, and installing the Rockchip hardware acceleration package into the operating
system.
Currently, Debian system is mainly aimed at customer preliminary evaluations, third-party system porting
references, and products with complex desktop requirements.
As illustrated in Figure 3-1 of the SDK software architecture, it is divided into four layers from bottom to top: the
Boot Layer, Kernel Layer, Libraries, and Application Layer. Each layer is described as follows:
Boot Layer: This layer primarily handles system booting processes and provides support for components
such as BootROM, U-Boot, ATF, and related functionalities.
Kernel Layer: The Kernel Layer provides the standard implementation of the Linux Kernel. Linux is an
open-source operating system. The core of the Rockchip platform's Linux system is based on the standard
Linux 4.4/4.19/5.10 kernel versions. It offers foundational support for security, memory management,
process management, network protocol stack, etc. The Linux kernel manages hardware resources of
devices, such as CPU scheduling, caching, memory, I/O, etc.
Libraries: This layer corresponds to general embedded systems and functions as middleware. It includes
various system basic libraries and support for third-party open-source libraries. Libraries provide API
interfaces to the application layer. System customizers and application developers can develop new
applications based on the API provided by the Libraries layer.
Application Layer: The Application Layer implements specific product features and interaction logic. It
requires support from system basic libraries and third-party libraries. Developers can create their own
applications, leveraging various system capabilities to deliver the final user experience.
Figure 3-1 SDK Software Block Diagram
The SDK system startup process refers to a software process from system power on to completion of system
startup. The following is the Linux system startup process:
BootROM preloader
trust
Description:
Both AP and MCU have a BOOTROM integrated inside. When the system is powered on, it will first run
the BOOTROM code, and then the BOOTROM code will detect the peripheral memory and load the
Loader code.
There are currently 3 Pre Loaders: miniloader (non-open source), uboot spl and loader.
5.3 SDK Development Process
The Rockchip Linux system is based on the Buildroot/Yocto/Debian system, and kernel is developed based on
kernel 4.4/4.19/5.10. It is an SDK developed for a variety of different product forms. Based on this SDK, system
customization and application porting development can be effectively realized.
As shown in Figure 4-1, developers can follow the development process described above to quickly set up the
Rockchip Linux system development environment and build code locally. Here is a brief overview of this
process:
Check System Requirements: Before downloading code and compiling, ensure that the local development
device meets the requirements, including hardware capabilities, software system, toolchain, etc. Currently,
the SDK supports compilation under the Linux operating system environment and provides toolchain
support only for Linux. Other systems like MacOS and Windows are not supported at the moment.
Set Up Compilation Environment: Provide information about the various software packages and tools
that need to be installed on the development device. For details, please refer to SDK Development
Environment Setup.
Select Device: During the development process, developers need to choose the appropriate hardware board
based on their requirements. Please refer to SDK Adapted Hardware Automatic Compilation Summary.
Download Source Code: After selecting the device type, install the repo tool for batch downloading of
source code. For details, please refer to SDK Software Packages.
System Customization: Developers can customize U-Boot, Kernel, and Rootfs based on the hardware
board and product definition. Please refer to SDK Development.
Compile and Package: After setting up the source code and selecting the product, initialize the relevant
compilation environment. Then execute compilation commands, including overall or module compilation,
and cleanup work. For further details, please refer to SDK Compilation Instructions.
Flash and Run: After generating the image files, learn how to flash the image and run it on the hardware
device. For further details, please refer to SDK Firmware Upgrade.
This section mainly introduces how to set up a local compilation environment to build Rockchip Linux SDK
source code. Currently, the SDK only supports compilation and secondary development in a Linux environment.
A typical embedded development environment typically includes a Linux server, PC, and target hardware board,
as shown in the diagram below.
Set up a cross-compilation environment on the Linux server to provide services such as code provision,
updates downloading, and compilation for software development.
Share programs between the PC and Linux server, and install Putty or Minicom. Remote login to the Linux
server over the network is used for cross-compilation and development code debugging.
Connect the PC to the target hardware board via serial ports and USB. The compiled image file can be
flashed onto the target hardware board, and the system or application program can be debugged.
Note: Windows PC is used in the development environment. In fact, many tasks can also be completed on
Linux PC, such as using Minicom instead of Putty. Users can choose by themselves.
The code and related documents of Rockchip Linux SDK are divided into several git repositories for version
management. Developers can use repo to download, submit, switch branches, and other operations on these git
repositories.
Please configure your own git information before using repo, otherwise subsequent operations may encounter
hook checking errors:
repo is a script written by Google using Python script to call git. It is mainly used to download and manage the
project's software repositories.
The installation path in the following commands takes "~/bin" as an example. Users should create the required
directories themselves.
mkdir ~/bin
cd ~/bin
git clone ssh://git@[Link]/repo/rk/tools/repo
chmod a+x ~/bin/repo/repo
export PATH=~/bin/repo:$PATH
In addition to the above methods, you can also use the following command to obtain repo
In foreign regions, you can download the repo tool from the Google mirror site:
mkdir ~/bin
curl [Link] -o ~/bin/repo
chmod a+x ~/bin/repo
export PATH=~/bin:$PATH
In domestic areas, you can download the repo tool from the [Link] site:
mkdir ~/bin
curl [Link] -o ~/bin/repo
chmod a+x ~/bin/repo
export PATH=~/bin:$PATH
The SDK is released through Rockchip code server. When customers apply for the SDK through Rockchip's
technical window, they need an account to access the source code repository provided by Rockchip. In order to be
able to obtain code synchronization, please provide SSH public key for server authentication and authorization
when apply for SDK from Rockchip technical window. About Rockchip server SSH public key authorization,
please refer to the Chapter SSH Public Key Operation Instructions in this document.
Rockchip Linux SDK can be adapted to different chip platforms, such as RK3588, RK3576,RK3562, RK3566,
RK3568, RK3308, RK3288, RK3326/PX30, RK3399, RK3399Pro, RK1808, etc. The source code of different
chip platforms will be different to a certain extent. Developers need to declare the chip platform they want when
downloading the source code, so as to avoid downloading code they don't need.
SDK uses different XML to declare the corresponding chip platform you want to download.
Please refer to the Chapter Download through code server in this document.
When the code start to download automatically, just wait patiently. The source code files will be located in the
working directory under the corresponding project name. The initial sync operation will take an hour or more to
complete.
[Link] Compressed Package of SDK Code
For quick access to SDK source code, Rockchip Technical Window usually provides corresponding version of
SDK initial compression package. In this way, developers can get SDK source code through decompressing the
initial compression package, which is the same as the one downloaded by repo.
Please refer to the Chapter Obtain by decompressing the local compressed package in this document.
The software release version upgrade can be viewed through the project xml. For example, the way for the
RK3588 chip is as follows:
Software release version upgrade and update content can be viewed through the project text. Please refer to the
project directory. For example, check the version of RK3588 as follows:
<SDK>/.repo/manifests/rk3588_linux/RK3588_Linux5.10_SDK_Note.md
<SDK>/docs/en/RK3588/RK3588_Linux5.10_SDK_Note.md
Developers can synchronize updates through commands according to the update instructions published regularly
in the FAE window.
.repo/repo/repo sync -c
In order to better assist customer development, the Rockchip bug system (Redmine) records the user problem
handling process and status, making it easier for both parties to track at the same time, making issue processing
more timely and efficient. SDK issues, specific technical issues, technical consultation, etc. can be submitted to
this bug system, and Rockchip technical services will distribute, handle and track the issues in a timely manner.
For more detailed instructions, please refer to the documentation
<SDK>/docs/en/Others/Rockchip_User_Guide_SDK_Application_And_Synchronization_EN.pdf
。
6.3 Setting Up a Linux Development Environment
We recommend using a system with Ubuntu 22.04 or a higher version for compilation. Other Linux versions may
require corresponding adjustments to the software packages. In addition to system requirements, there are other
hardware and software requirements.
Hardware Requirements: 64-bit system with hard disk space greater than 40GB. If you are performing multiple
builds, you will need more hard disk space.
When developing for devices using the command line, you can install the necessary libraries and tools required
for compiling the SDK by following these steps.
Use the following apt-get commands to install the libraries and tools needed for subsequent operations:
Note:
The installation command is suitable for Ubuntu 22.04. For other versions, please use the corresponding
installation command based on the package name. If you encounter errors during compilation, you can
install the corresponding software packages based on the error messages. Specifically:
Python requires the installation of version 3.6 or higher, with version 3.6 used as an example here.
Make requires the installation of version 4.0 or higher, with version 4.2 used as an example here.
LZ4 requires the installation of version 1.7.3 or higher.
Compiling Yocto requires a VPN network.
The method to check and upgrade the host's Python version is as follows:
$ python3 --version
Python 3.10.6
If the requirement of Python version >= 3.6 is not met, you can upgrade by the following method:
The method to check and upgrade the host's make version is as follows:
$ make -v
GNU Make 4.2
Built for x86_64-pc-linux-gnu
The method to check and upgrade the host's LZ4 version is as follows:
$ lz4 -v
*** LZ4 command line interface 64-bits v1.9.3, by Yann Collet ***
make
sudo make install
sudo install -m 0755 lz4 /usr/bin/lz4
6.4 Window PC Development Environment Setup
Users should install editing software such as Vim and Notepad++ by themselves.
Download Virtual-Box (software that provides a virtual development environment)
Download XShell6 (used to establish interaction with Linux system)
During the development and debugging process, the device needs to be switched to Loader mode or Maskrom
mode, and Rockusb driver should be installed, then the device can be recognized normally.
Rockchip USB driver installation assistant is stored in tools/windows/DriverAssitant_v5.[Link]. support
xp, win7_32, win7_64, win10_32, win10_64 and other operating systems.
The installation steps are as follows:
Please refer to the SDK software package applicable hardware list SDK software package applicable hardware
list to select the corresponding hardware board for development and debugging. The corresponding hardware
instruction document will introduce the hardware interface, usage instructions and burning operation methods.
To help developers quickly complete the complex development environment preparation mentioned above, we
also provide a cross-compiler Docker image. This enables customers to rapidly verify and then shorten the build
time of the compilation environment.
Before using the Docker environment, you can refer to the following document for instructions:
<SDK>/docs/en/Linux/Docker/Rockchip_Developer_Guide_Linux_Docker_Deploy_EN.pdf .
The Docker image can be obtained from the website Docker Image.
Since Rockchip Linux SDK is currently only built in the Linux PC environment, we only provide the cross-
compilation tool chain under Linux. The tool chain in the prebuilt directory is used by U-Boot and Kernel.
Specifically, Rootfs needs to use its corresponding tool chain, or use a third-party tool chain for building.
Linux4.4/4.19 SDK:
prebuilts/gcc/linux-x86/aarch64/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-
gnu/bin/aarch64-linux-gnu-
Linux5.10/6.1 SDK:
prebuilts/gcc/linux-x86/aarch64/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-
gnu/bin/aarch64-none-linux-gnu-
Corresponding version:
Linux4.4/4.19 SDK:
gcc version 6.3.1 20170404 (Linaro GCC 6.3-2017.05)
Linux5.10/6.1 SDK:
gcc version 10.3.1 20210621 (GNU Toolchain for the A-profile Architecture 10.3-
2021.07 (arm-10.29))
To compile individual modules or third-party applications, a cross-compilation environment must be set up. For
instance, for the RK3576, the cross-compilation tools are located in the
buildroot/output/rockchip_rk3576/host/usr directory. It is necessary to set the bin/ directory of the
tools and the aarch64-buildroot-linux-gnu/bin/ directory as environment variables. Execute the script for
automatic configuration of the environment variables in the top-level directory:
cd buildroot/output/rockchip_rk3576/host/usr/bin
./aarch64-linux-gcc --version
Buildroot supports the packaging of the built-in toolchain into a compressed archive for standalone compilation
by third-party applications. For detailed information on how to package the toolchain, please refer to the
Buildroot official documentation:
buildroot/docs/manual/[Link]
In the SDK, you can directly run the following command to generate the toolchain package:
./[Link] bmake:sdk
./aarch64-buildroot-linux-gnu_sdk-buildroot/bin/aarch64-buildroot-linux-gnu-gcc
6.6.3 Debian Toolchain
Utilize Docker on the machine side, gcc, or dpkg-buildpackage for the relevant compilation.
The Linux SDK currently has different versions such as Linux 4.4, Linux 4.19, and Linux 5.10. Use repo to
manage the SDK and use tags to manage versions. The various components and modules of the SDK are stored in
different Git repositories, and the repo tool is used to coordinate version and code synchronization between them.
Each component's Git repository has its own branch and commit history.
Note:
Rockchip[1]RK3399[2]Linux5.10[3]SDK[4]Release[5]V1.0.0[6]20220920[7]_EN [8]
Note:
[1]: Rockchip, required. Documents released by RK must begin with Rockchip.
[2]: Chip model. The initial letter of the chip is uniformly capitalized, the suffix depends on the chip and
remains consistent with the official website definition. If there are two chips, connect them with an
underscore such as (RK3566_RK3568).
[3]: Linux, Android, FreeRTOS, etc., the first letter is capitalized.
[4]: Optional, indicating the target market. If it is a general SDK, this item is omitted.
[5] and [6]: Release type (Alpha/Beta/Release) and version number. The version number style is defined as
follows: "Vn.n.n" . The letter "V" remains capitalized and n represents an integer. It can be seen that the
version number consists of three numbers with 2 dots in the middle.
Alpha version starts from V0.0.1, that is, the first two digits keep the number 0, and the last digit is
incremented according to the actual testing/release situation;
The Beta version starts from V0.1.1, that is, the first digit is kept as 0, the increment of the second
digit indicates the addition of functional modules or major updates of functions, and the increment of
the third digit indicates bug correction;
Release version starts from V1.0.0, the first digit indicates a major update, and the second and third
digits refer to the Beta version.
[7]: Release date. Use the format 20220920 uniformly.
[8]: Document language version information. CN: Chinese, EN: English
Chip platform - software version - [target market] + SDK + version number + release date
Example:
RK3399_LINUX5.10_SDK_RELEASE_V1.0.0_20220920
Note:
If there is an update to the SDK, it will be updated around the 20th of each month, and an Change Notice will be
sent out at the end of the month. The update mechanism is a one-month small update (such as V1.0.x), and the
version has been fully tested by QA (such as V1.x.0).
If any important issues are encountered when releasing the SDK, they will be pushed to customers in the form of
the following patches:
rockchip-patch
How to build a Gitolite server and use it for management and maintenance of SDK code. Please refer to the
following documents for details.
<SDK>/docs/en/Others/Rockchip_Developer_Guide_Repo_Mirror_Server_Deploy.pdf
8. SDK Compilation Instructions
The SDK can be configured and compiled with make or ./[Link] along with target parameters. For
specific references, see the compilation instructions in device/rockchip/common/[Link] .
To ensure SDK updates smoothly each time, it is recommended to clean previous compilation products before
updating. This avoids potential compatibility issues or compilation errors, as old compilation products may not be
suitable for the new version of the SDK. Run the following command to clean these compilation products:
./[Link] cleanall .
$ make help
menuconfig - interactive curses-based configurator
oldconfig - resolve any unresolved symbols in .config
syncconfig - Same as oldconfig, but quietly, additionally update
deps
olddefconfig - Same as syncconfig but sets new symbols to their
default value
savedefconfig - Save current config to RK_DEFCONFIG (minimal config)
...
That is, you can also run ./[Link] <target> to build related functions. You can view the detailed
compilation commands through ./[Link] help .
$ ./[Link] -h
############### Rockchip Linux SDK ###############
Manifest: rk3562_linux_release_v1.1.0_20231220.xml
$ ./[Link] lunch
1. rockchip_defconfig
2. rockchip_rk3562_evb1_lp4x_v10_defconfig
3. rockchip_rk3562_evb2_ddr4_v10_defconfig
Which would you like? [1]:
The configuration of other functions can be configured through make menuconfig to configure related
properties.
The SDK can be configured through make menuconfig , with the main components currently available for
configuration being:
(rk3562) SoC
Rootfs --->
Loader (u-boot) --->
RTOS --->
Kernel --->
Boot --->
Recovery (based on buildroot) --->
PCBA test (based on buildroot) --->
Security --->
Extra partitions --->
Firmware --->
Update (Rockchip update image) --->
Others configurations --->
Rootfs: This represents the "Root File System". Here, you can choose different root file systems like
Buildroot, Yocto, Debian, etc.
Loader (u-boot): This is the boot loader configuration, usually u-boot, which initializes hardware and loads
the main operating system.
RTOS: Real-Time Operating System (RTOS) configuration options, suitable for applications requiring real-
time performance.
Kernel: Configure kernel options here, customizing a Linux kernel suitable for your hardware and
application needs.
Boot: Configure Boot partition support formats here.
Recovery (based on buildroot): This is the configuration for the recovery environment based on buildroot,
used for system recovery and upgrade.
PCBA test (based on buildroot): This is a configuration for a PCBA (Printed Circuit Board Assembly)
testing environment based on buildroot.
Security: Indicates that certain security features will depend on the buildroot configuration chosen for
Rootfs, mainly the Secureboot feature activation.
Extra partitions: Used to configure additional partitions.
Firmware: Configure firmware-related options here.
Update (Rockchip update image): Used to configure options for Rockchip's complete firmware.
Others configurations: Other additional configuration options.
The make menuconfig interface provides a text-based user interface to select and configure various options.
Once configuration is complete, use the command make savedefconfig to save these settings, so that custom
builds will be done based on these settings.
With the above configs, you can choose different Rootfs/Loader/Kernel configurations for various custom builds,
allowing flexible selection and configuration of system components to meet specific needs.
Configurations for different chips and target functions can be set via source [Link] .
$ source [Link]
Top of tree: /home/wxt/linux-develop/rk3562
1. rockchip_px30_32
2. rockchip_px30_64
3. rockchip_px30_recovery
4. rockchip_rk3036
5. rockchip_rk3036_recovery
6. rockchip_rk3126c
7. rockchip_rk312x
8. rockchip_rk312x_recovery
9. rockchip_rk3288
10. rockchip_rk3288_recovery
11. rockchip_rk3308_32_release
12. rockchip_rk3308_b_32_release
13. rockchip_rk3308_b_release
14. rockchip_rk3308_bs_32_release
15. rockchip_rk3308_bs_release
16. rockchip_rk3308_h_32_release
17. rockchip_rk3308_recovery
18. rockchip_rk3308_release
19. rockchip_rk3326_64
20. rockchip_rk3326_recovery
21. rockchip_rk3358_32
22. rockchip_rk3358_64
23. rockchip_rk3358_recovery
24. rockchip_rk3399
25. rockchip_rk3399_base
26. rockchip_rk3399_recovery
27. rockchip_rk3399pro
28. rockchip_rk3399pro-multi-cam
29. rockchip_rk3399pro-npu
30. rockchip_rk3399pro-npu-multi-cam
31. rockchip_rk3399pro_combine
32. rockchip_rk3399pro_recovery
33. rockchip_rk3528
34. rockchip_rk3528_recovery
35. rockchip_rk3562
36. rockchip_rk3562_32
37. rockchip_rk3562_recovery
38. rockchip_rk3566
39. rockchip_rk3566_32
40. rockchip_rk3566_recovery
41. rockchip_rk3566_rk3568_base
42. rockchip_rk3566_rk3568_ramboot
43. rockchip_rk3568
44. rockchip_rk3568_32
45. rockchip_rk3568_recovery
46. rockchip_rk3588
47. rockchip_rk3588_base
48. rockchip_rk3588_ramboot
49. rockchip_rk3588_recovery
Which would you like? [1]:
Then go to the Buildroot directory of RK3562 and start compiling the relevant modules.
8.5 Fully Automatic Compilation
Enter the project root directory and execute the following command to automatically complete all compilation:
./[Link] all # Only build module code (u-Boot, kernel, Rootfs, Recovery)
# Need to execute ./[Link] again to package the firmware
It is Buildroot by default, you can specify different rootfs by setting the environment variable
RK_ROOTFS_SYSTEM , which can set three systems currently: Buildroot, Debian, and Yocto.
For example, if you need Debain, you can generate it with the following command:
export RK_ROOTFS_SYSTEM=debian
./[Link]
or
RK_ROOTFS_SYSTEM=debian ./[Link]
<SDK>#./[Link] uboot
For detailed board-level build, please refer to the build instructions in the SDK release document.
Enter the root directory of the project directory and execute the following command to automatically build and
package kernel.
<SDK>#./[Link] kernel
For detailed board-level compilation, please refer to the release notes or the compilation instructions in Quick
Start.
Enter the root directory of the project and execute the following command to automatically complete the
compilation and packaging of Recovery.
<SDK>#./[Link] recovery
Note: [Link] includes Kernel, so every time Kernel changes, Recovery needs to be repackaged. The
method for repackaging Recovery is as follows:
<SDK>#source buildroot/[Link]
<SDK>#cd buildroot
<SDK>#make recovery-reconfigure
<SDK>#cd -
<SDK>#./[Link] recovery
Note: Recovery is not a mandatory feature, some board configurations might not set it
Enter the root directory of the project and execute the following command to automatically complete the
compilation and packaging of Rootfs:
./[Link] rootfs
After compilation, different formats of images are generated in the Buildroot directory
output/rockchip_rk3562/images , rootfs.ext4 format is used by default.
<SDK>/docs/en/Linux/System/Rockchip_Developer_Guide_Buildroot_EN.pdf
./[Link] debian
<SDK>/docs/en/Linux/System/Rockchip_Developer_Guide_Debian_EN.pdf
Enter the root directory of the project and execute the following command to automatically complete the
compilation and packaging of Rootfs:
./[Link] yocto
The default login username is root. For more information on Yocto, please refer to Rockchip Wiki.
FAQ:
Solution:
locale-gen en_US.UTF-8
export LANG=en_US.UTF-8 LANGUAGE=en_US.en LC_ALL=en_US.UTF-8
Or refer to setup-locale-python3.
8.6.7 Cross-Compilation
Contents Description
Click here
Different chip and target feature configurations can be set via source buildroot/[Link]
$ source buildroot/[Link]
Top of tree: rk3562
44. rockchip_rk3562
45. rockchip_rk3562_32
46. rockchip_rk3562_dictpen
47. rockchip_rk3562_ramboot
48. rockchip_rk3562_recovery
49. rockchip_rk3562_robot
...
Default choice is 44, rockchip_rk3562 . Then, enter the RK3562 Buildroot directory to start compiling related
modules.
For example, to compile the rockchip-test module, commonly used compilation commands are as follows:
SDK#cd buildroot
buildroot#make rockchip-test-recreate
Recompile rockchip-test
buildroot#make rockchip-test-rebuild
Delete rockchip-test
buildroot#make rockchip-test-dirclean
or
buildroot#rm -rf output/rockchip_rk3562/build/rockchip-test-master/
cd buildroot/output/rockchip_rk3562/host/usr/bin
./aarch64-linux-gcc --version
This chapter mainly introduces the process of building a complete image file (image), burning it and running it on
a hardware device.
The introduction of several image burning tools provided by Rockchip platform is as follows. You can choose the
appropriate burning method for burning. Before burning, you need to install the latest USB driver. For details,
please see Rockchip USB Driver Installation.
Run
Tools Description
System
The several modes of Rockchip platform hardware operation are as shown in the following table. Firmware can
only be burned or updated on the board when the device is in Maskrom or Loader mode.
Tool
Mode Description
Burn
When firmware is not yet burned into the Flash, the Chip will enter Maskrom
mode, allowing the initial firmware burning. During the development and
Maskrom Support
debugging process, if Loader fails to start normally, firmware can also be
burned in Maskrom mode.
Not System boot recovery starts, its main function is to upgrade and restore
Recovery
supported factory settings.
Normal Not System boot rootfs starts, loads rootfs, most development is debugged in this
Boot supported mode.
The board has not been burned with firmware. Power on and enter Maskrom mode.
The board has been burned with firmware, press and hold the recovery button to power on or reset, and the
system will enter the Loader firmware burning mode.
The board has been burned with firmware, press and hold the Maskrom button to power on or reset, and the
system will enter the MaskRom firmware burning mode.
The board has been burned with firmware, and the board enters the system normally after powering on or
resetting, Rockchip's development tool displays "An ADB device was found" or "An MSC device was
found", and then click the "Switch" button on the tool to enter Loader mode.
The board has been burned with firmware, you can enter reboot loader command in the serial port or
ADB command line mode to enter the Loader mode.
Rockchip's SDK provides a Windows burning tool (the tool version requires V3.31 or above). The tool is located
in the project root directory:
tools/
├── windows/RKDevTool
As shown in the figure below, after compiling and generating the corresponding firmware, the device needs to
enter the MASKROM or BootROM burning mode.
After connecting the USB download cable, press and hold the "MASKROM" button and press the reset button
"RST" and then release it to enter MASKROM mode, after loading the corresponding path of the compiled and
generated firmware, click "Execute" to burn. You can also press and hold the "recovery" button and press the
reset button "RST" and then release it to enter the loader mode for burning. The following is the partition offset
and burning file in the MASKROM mode . (Note: Windows PC requires administrator rights to run the tool
before it can be executed)
Note: Before burning, you need to install the latest USB driver. For driver details, please see:
<SDK>/tools/windows/DriverAssitant_v5.[Link]
9.1.2 Linux Flashing Instructions
The Linux burning tool is located in the tools/linux directory (Linux_Upgrade_Tool tool version requires V2.26
or above), please make sure your board is connected to MASKROM/loader rockusb. For example, if the
generated firmware is in the rockdev directory, the upgrade command is as follows:
Or in the root directory, run the following command to upgrade when the device is in MASKROM mode:
./[Link]
Default partition description is showed as follows: (below is the RK3562 EVB partition reference)
Core components development in SDK, such as U-Boot, Kernel, Recovery, Buildroot, Debian, Yocto,
Multivideo, Graphics, Rootfs post-processing, Overlays, and other key component development.
This section provides a brief introduction to the basic concepts of U-Boot and considerations for compilation to
help customers understand the U-Boot framework on the RK platform. For specific details on U-Boot
development, refer to <SDK>/docs/en/Common/U-Boot/Rockchip-Developer-Guide-UBoot-*.pdf .
The v2017(next-dev) is a development branch derived from the official v2017.09 release of U-Boot by RK,
which now supports all mainstream RK chips currently on the market. The main features supported include:
10.1.2 Version
There are two versions of RK's U-Boot: the old version v2014 and the new version v2017, with internal names
rkdevelop and next-dev, respectively. Users have two methods to confirm whether the current U-Boot is version
v2017.
Method 1: Confirm whether the version number of the Makefile in the root directory is 2017.
#
### SPDX-License-Identifier: GPL-2.0+
#
VERSION = 2017
PATCHLEVEL = 09
SUBLEVEL =
EXTRAVERSION =
NAME =
......
Method 2: Confirm whether the first line of the formal print at boot is U-Boot 2017.09.
Project Open Source: v2017 is open source and regularly updated to Github: [Link]
nux/u-boot
Download rkbin
This is a repository of tools, used to store the non-open source bin, scripts, and packaging tools of RK.
When compiling U-Boot, it indexes the relevant files from this repository to package and generate the
loader, trust, and uboot firmware. The rkbin and U-Boot projects must maintain the same directory level
relationship.
Download GCC
The GCC compiler uses gcc-linaro-6.3.1, which is placed inside the prebuilts directory. The prebuilts and
U-Boot maintain the same directory level relationship. As follows:
// 32-bit:
prebuilts/gcc/linux-x86/arm/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-
gnueabihf
// 64-bit:
prebuilts/gcc/linux-x86/aarch64/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-
linux-gnu/
Select defconfig
The support status of defconfig for each platform (subject to the SDK release):
"[Chip]_defconfig" or "[Chip].config" are usually full-featured versions, and the rest are specific
feature versions.
1. The support status of defconfig for each platform (subject to the SDK release):
"[Chip]_defconfig" or "[Chip].config" are usually full-featured versions, and the rest are specific feature
versions.
Support for Kernel
Chip defconfig Description
DTB
RK3399Pro-
rknpu-lion_defconfig Yes General version
npu
rk3568_defconfig
General version
[Link]
Supports DFU
[Link]
Supports MLC/TLC/eMMC
RK3568 rk3568-spl-spi- Yes
SPI-nand specific SPL
nand_defconfig
Supports aarch32 mode
[Link]
Supports usbplug mode
[Link]
General version
rk3588_defconfig No storage device (memory
[Link] boot)
RK3588 [Link] Yes Dual storage support for sata
[Link] boot
[Link] Supports aarch32 mode
Used on IPC SDK
General version
rk3576_defconfig
Open source usbplug
[Link]
Car version
RK3576 [Link] Yes
Supports AB system car
[Link]
version
[Link]
E-ink version
Note: If the table and the defconfig released by the SDK are different, please refer to the SDK.
10.1.4 Booting Process
The U-Boot booting process for the RK platform is as follows, with only some important steps listed:
start.s
// Assembly environment
=> IRQ/FIQ/lowlevel/vbar/errata/cp15/gic // ARM architecture-related
lowlevel initialization
=> _main
=> stack // Prepare the stack needed for
the C environment
// [First Phase] C environment initialization, initiating a series of
function calls
=> board_init_f: init_sequence_f[]
initf_malloc
arch_cpu_init // [SoC's lowlevel initialization]
serial_init // Serial port initialization
dram_init // [Obtaining DDR capacity
information]
reserve_mmu // Reserve memory from the end of
the DDR towards lower addresses
reserve_video
reserve_uboot
reserve_malloc
reserve_global_data
reserve_fdt
reserve_stacks
dram_init_banksize
sysmem_init
setup_reloc // Determine the relocation
address for U-Boot itself
// Assembly environment
=> relocate_code // Assembly implementation of U-
Boot code relocation
// [Second Phase] C environment initialization, initiating a series of
function calls
=> board_init_r: init_sequence_r[]
initr_caches // Enable MMU and I/D cache
initr_malloc
bidram_initr
sysmem_initr
initr_of_live // Initialize of_live
initr_dm // Initialize the device model
(dm) framework
board_init // [Platform initialization, the
core part]
board_debug_uart_init // Serial port I/O multiplexing,
clock configuration
init_kernel_dtb // [Switch to the kernel device
tree blob (dtb)]!
clks_probe // Initialize system clock
frequencies
regulators_enable_boot_on // Initialize system power supply
io_domain_init // I/O domain initialization
set_armclk_rate // __weak, ARM frequency scaling
(only implemented if the platform requires it)
dvfs_init // DVFS for wide-temperature chips
rk_board_init // __weak, Implemented by each
specific platform
console_init_r
board_late_init // [Platform late initialization]
rockchip_set_ethaddr // Set MAC address
rockchip_set_serialno // Set serial number
setup_boot_mode // Parse "reboot xxx" command,
// Identify key presses and loader burn mode, recovery
charge_display // U-Boot charging
rockchip_show_logo // Display boot logo
soc_clk_dump // Print the clock tree
rk_board_late_init // __weak, Implemented by each
specific platform
run_main_loop // [Enter command line mode, or
execute boot command]
The RK platform offers a set of serial port combination keys to trigger certain events for debugging and flashing
(if they do not trigger, please try multiple times; ineffective when secure-boot is enabled). Press and hold at
startup:
This section aims to provide you with a brief introduction to common kernel configuration modifications,
focusing on Device Tree (DTS) configurations, to help you make simple modifications more quickly and
conveniently. The following introduction is based on the Linux 5.10 kernel version.
The Device Tree Source (DTS) is a data structure that describes hardware devices, used to define and configure
hardware devices within the Linux kernel. The DTS employs a text-like format, representing hardware devices
and their relationships through hierarchical structures and property descriptions.
The DTS is compiled into a Device Tree Blob (DTB), which the kernel loads and parses at startup, extracting
information about the hardware devices for initialization and configuration.
The introduction of the device tree addresses the inflexibility and maintainability issues of the traditional "hard-
coding" approach when dealing with different hardware configurations. With the device tree, hardware
descriptions and configuration information are abstracted, allowing the kernel to adapt to different hardware
platforms without modifying the kernel code. In this way, the same kernel can run on multiple different hardware
devices, simply by loading the corresponding device tree.
This article aims to introduce how to add a new board DTS configuration and some common syntax explanations.
For more detailed information on DTS, see: devicetree-specifications and devicetree-bindings.
The Linux Kernel currently supports multiple platforms using dts files, and the dts files for the Rockchip platform
are stored at:
The general naming convention for dts files is "[Link]", such as [Link].
soc refers to the chip model, and board_name is generally named according to the silk screen on the board.
If your board is an all-in-one board, you only need one dts file to describe it.
If the hardware design consists of a core board and a bottom board, or if the product has multiple product forms,
you can place the common hardware descriptions in the dtsi file, and the dts file describes different hardware
modules, and include the common hardware descriptions by including "[Link]".
├──[Link]
│ ├── [Link]
│ └── [Link]
--- a/arch/arm64/boot/dts/rockchip/Makefile
+++ b/arch/arm64/boot/dts/rockchip/Makefile
@@ -50,6 +50,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += [Link]
dtb-$(CONFIG_ARCH_ROCKCHIP) += [Link]
dtb-$(CONFIG_ARCH_ROCKCHIP) += [Link]
dtb-$(CONFIG_ARCH_ROCKCHIP) += [Link]
+dtb-$(CONFIG_ARCH_ROCKCHIP) += [Link]
When compiling the Kenrel, you can directly make [Link] (such as [Link]) to
generate the corresponding [Link] (including dtb data).
The dts syntax can include other common dts data like c/c++ by using #include [Link]. The dts file will inherit
all the properties and values of the device nodes included in the dtsi file. If a property is defined in multiple
dts/dtsi files, its value will be the definition in the dts. All chip-related controller nodes will be defined in [Link],
and if you need to enable the device function, you need to set its status to "okay" in the dts file. To disable the
device, you need to set its status to "disabled" in the dts file.
/dts-v1/;
#include "[Link]"
#include "[Link]"
...
&i2s2 {
#sound-dai-cells = <0>;
status = "okay";
};
&hdmi_sound {
status = "okay";
};
cat /sys/devices/system/cpu/cpufreq/policy0/scaling_cur_freq
cat /sys/kernel/debug/clk/armclk/clk_rate
Using the CPUFreq user-space interface to view the frequency of little cores and big cores:
Using the Clock Debug interface to view the frequency of little cores and big cores:
When adjusting frequency and voltage, please follow the sequence below:
Increase Frequency: First adjust the voltage, then increase the frequency.
Decrease Frequency: First decrease the frequency, then adjust the voltage.
For heterogeneous core platforms (e.g., RK3399), set the little cores to 216MHz and the big cores to 408MHz:
For heterogeneous core platforms (e.g., RK3399), set the little cores to 950mV and the big cores to 1000mV:
cat /sys/kernel/debug/opp/opp_summary
cat /sys/class/thermal/thermal_zone0/temp
Switch the GPU to user space control mode (the path [Link] may vary depending on the
platform):
cat /sys/class/devfreq/[Link]/cur_freq
[Link].2 View Current GPU Frequency
Method One: Through the devfreq user-space interface (the path [Link] may vary depending on
the platform):
cat /sys/class/devfreq/[Link]/cur_freq
Method Two: Through the clock debug interface ( aclk_gpu may vary according to the actual
configuration):
cat /sys/kernel/debug/clk/aclk_gpu/clk_rate
To inspect the GPU voltage (the vdd_logic may vary based on the actual regulator configuration):
cat /sys/kernel/debug/regulator/vdd_logic/voltage
Important: When increasing frequency, adjust the voltage first; when decreasing frequency, adjust the
frequency first.
Disable GPU automatic frequency scaling (the path [Link] may vary depending on the platform):
Adjust the GPU frequency ( aclk_gpu may vary according to actual configuration):
Adjust the GPU voltage ( vdd_logic may vary according to actual regulator configuration):
To check the GPU utilization (the path [Link] may vary depending on the platform):
cat /sys/devices/platform/[Link]/devfreq/[Link]/load
To check the GPU temperature (the thermal_zone1 may need to be modified according to the actual
hardware configuration):
cat /sys/class/thermal/thermal_zone1/temp
[Link] DDR Related Commands
cat /sys/class/devfreq/dmc/available_frequencies
cat /sys/class/devfreq/dmc/load
cat /proc/meminfo
cat /proc/vmallocinfo
ls /sys/kernel/debug/cma/cma-reserved
cat /sys/kernel/debug/dma_buf/bufinfo
cat /proc/rk_dmabuf/size
docs\en\Common\DDR\***
docs\en\Common\MEMORY\***
Utilize the following commands to inspect the NPU frequency (note: the device path [Link] may vary
by platform):
Set the frequency for the NPU device (the device path [Link] may need to be changed based on the
platform):
The following commands are applicable to the RKNPU2 platform and require the driver version to be above
0.7.2:
cat /sys/kernel/debug/rknpu/load
cat /proc/debug/rknpu/load
cat /sys/kernel/debug/rknpu/volt
To dynamically manage NPU power and delay shutdown time (unit: ms):
Tool: rknn-toolkit
Runtime: rknpu, RK3399Pro_npu
Tool: rknn-toolkit2
Runtime: rknpu2
rknn_model_zoo: rknn_model_zoo
cat /sys/kernel/debug/rkrga/driver_version
cat /proc/rkrga/driver_version
[Link].4 Check the Version Number of the librga Library
Linux System
export ROCKCHIP_RGA_LOG=1
export ROCKCHIP_RGA_LOG_LEVEL=6
cat /sys/kernel/debug/rkrga/debug
cat sys/kernel/debug/rkrga/load
cat sys/kernel/debug/rkrga/mm_session
cat sys/kernel/debug/ampak/request_manager
cat sys/kernel/debug/rkrga/hardware
/*Use the following commands to dump runtime data for debugging purposes*/
echo /data/rga_image > sys/kernel/debug/rkrga/dump_path
echo 1 > sys/kernel/debug/rkrga/dump_image
`docs\en\Common\RGA\***` or [Link]
Use the following command to query the version information of the VPU driver:
cat /proc/mpp_service/version
[Link].2 Inspect VPU Frame Rate
To inspect the frame rate data of the VPU, use the following command:
cat /proc/mpp_service/sessions-summary
To modify the frequency of the VPU to 600MHz, the following command can be utilized:
docs\en\Common\MPP\Rockchip_Developer_Guide_MPP_EN.pdf
For instance, the RK3399/RK3399Pro chip offers 5 sets of GPIOs (GPIO0 to GPIO4), totaling 122 GPIO pins.
All GPIOs can serve as interrupt sources, with GPIO0 and GPIO1 also capable of acting as system wake-up pins.
Each GPIO can be configured via software for pull-up or pull-down, with the default state being input mode.
Additionally, the driving capability of the GPIO can also be configured by software.
Regarding the correspondence between GPIO on the schematic and GPIO in the Device Tree Source (DTS), for
example, GPIO4C0 should be represented as "gpio4 16" in the DTS. This is because GPIO4A has 8 pins, and
GPIO4B also has 8 pins, with counting starting from 0, so the C0 pin corresponds to the 16th pin, the C1 pin
corresponds to the 17th pin, and so on.
Rockchip pins can be multiplexed into various functions. If a controller has multiple multiplexing pins, they are
generally referred to as m0, m1, m2, etc. For instance, the I2C controller has two sets of multiplexing pins, which
are named 2cm0 and i2cm1 respectively.
The configuration registers for pin multiplexing are located in GRF/PMUGRF (on RK3588, it is referred to as
IOC).
Multiplexing support provides greater flexibility in hardware design. When the peripheral working voltage is
1.8V or 3.3V, one can select pins with different voltage domains VCCIO.
Note: The configuration of multiplexing registers does not apply to TX-type pins but is effective for RX-type
pins.
bias-disable
bias-pull-up
bias-pull-down
Pull-up and pull-down configurations are applied to the IO PAD and take effect for both GPIO and IOMUX.
[Link] DRIVE-STRENGTH (Port Drive Strength)
The drive strength of Rockchip IO PAD supports different intensity configurations based on various processes.
For chips before RK3399, the drive strength configuration is set in units of mA, while for chips after RK1808, it
is generally set in levels, with the numerical value of the gear representing the register configuration value.
For example, in the RK3588 TRM, the drive strength levels for GPIO0_C7 are as follows:
gpio0c7_ds
GPIO0C7 DS control Driver Strength Selection
3'b000: 100ohm
3'b100: 66ohm
3'b010: 50ohm
3'b110: 40ohm
3'b001: 33ohm
3'b101: 25ohm
The software driver still processes according to the level, that is, the above register description corresponds to:
3'b000: Level0
3'b100: Level4
3'b010: Level2
3'b110: Level6
3'b001: Level1
3'b101: Level5
In the DTS, drive-strength=<5>; indicates the configuration is set to Level5, which means writing 3'b101
to the register.
Most Rockchip IO PAD chips support the SMT function, which is disabled by default; enabling SMT can
eliminate edge jitter, increase the voltage range of VIH and VIL, and enhance the signal stability of IOs.
Generally, the I2C SCL/SDA will have the SMT function enabled by default.
The Thermal framework is a model defined by kernel developers to support the control of system temperature
based on a specified governor, in order to prevent the chip from overheating. The Thermal framework consists of
governors, cores, cooling devices, and sensor drivers, with the software architecture as follows:
Thermal Governor: It is used to determine whether the cooling device needs to reduce frequency and to what
extent. The following types of governors are included in Linux versions 4.4 and above:
Thermal Core: It encapsulates and abstracts thermal governors and thermal drivers, and defines a clear interface.
Thermal Sensor Driver: A sensor driver used to obtain temperature, such as tsadc.
Thermal Cooling Device: A device that generates heat or can reduce temperature, such as CPU, GPU, DDR, etc.
The Rockchip chip has thermal control sensors on its ARM core and GPU core, which can monitor the
temperature of the CPU and GPU in real time, and control the frequency of the CPU and GPU through algorithms
to control the temperature of the CPU and GPU. The hardware design and mold of each product are different, and
the corresponding heat dissipation conditions are also different. Appropriate adjustments to thermal control
parameters can be made through the following configurations in dts to adapt to the product:
&threshold {
temperature = ; /* millicelsius */
};
&soc_crit {
temperature = ; /* millicelsius */
};
&tsadc {
rockchip,hw-tshut-mode = ; /* tshut mode 0:CRU 1:GPIO */
rockchip,hw-tshut-polarity = ; /* tshut polarity 0:LOW 1:HIGH */
rockchip,hw-tshut-temp = ;
status = "okay";
};
For detailed information on thermal control, refer to the relevant documentation in the
<SDK>/docs/en/Common/THERMAL directory.
During the DDR development process, you may encounter various issues. Below are some key development
resources and steps to help you efficiently resolve problems:
Frequently Asked Questions: Understand the typical issues that may arise in DDR development and their
solutions.
Troubleshooting Methods: Master the systematic problem diagnosis process to quickly locate the root cause
of the problem.
Particle Verification Process: Follow detailed verification steps to ensure the performance and compatibility
of DDR particles.
PCB Design Considerations: Pay attention to the key elements of PCB design to avoid potential layout
issues.
Eye Diagram Analysis Tools: Learn how to use eye diagram tools for signal integrity analysis to optimize
DDR performance.
Bandwidth Statistics Tools: Utilize bandwidth statistics tools to assess the data transmission capabilities of
DDR.
For more detailed information and guidance, please refer to the documents under the path
<SDK>/docs/en/Common/DDR . These documents will provide you with comprehensive development
instructions and practical guides.
For specific instructions on SD card configuration, please refer to the relevant documents in the directory
<SDK>/docs/en/Common/MMC .
For some chips, such as RK3326/RK3399PRO, the UART for debugging and the SD card are multiplexed by
default. The default configuration enables debugging. If you want to use the SD card, you need the following
configuration:
&fiq_debugger {
status = "disabled";
pinctrl-0 = <&uart2a_xfer>;
};
&sdmmc {
...
sd-uhs-sdr104;
status = "okay";
};
10.3.1 Introduction
The development of the Recovery mechanism is akin to the development of Android's Recovery functionality. Its
primary role is to erase user data and facilitate system upgrades.
In Linux, Recovery mode involves an additional Recovery partition on the device, composed of the kernel,
resources, and ramdisk, mainly used for upgrade operations. The u-boot will determine whether to boot into the
Normal system or the Recovery system based on the fields stored in the misc partition. Due to the system's
independence, Recovery mode ensures the integrity of the upgrade process, meaning that if the upgrade is
interrupted, such as by an abnormal power loss, the upgrade can still continue to be executed.
10.3.2 Debugging
touch .rkdebug
Logs for upgrades in Recovery mode are printed out through the serial port. Another method is to inspect the file
userdata/recovery/Log .
Buildroot is a tool that facilitates the construction of a complete Linux system for embedded systems through
cross-compilation, offering a simple and automated process.
On the native Buildroot, Rockchip has integrated the BSP configuration for related chips, configurations for
hardware module acceleration features, and in-depth customization development of third-party packages, making
it convenient for customers to deeply customize and develop their products.
<SDK>/docs/en/Linux/System/Rockchip_Developer_Guide_Buildroot_EN.pdf
Rockchip offers support for Debian 10/11 based on the X11 display architecture and is based on the Linaro
version. This support also includes graphics and video acceleration capabilities. The relevant packages include
libmali, xserver, and gstreamer rockchip, among others. These packages can be compiled by setting up an
environment in Docker, and the generated deb packages are stored in the <SDK>/debian/packages/*
directory.
For detailed steps on how to use Docker to compile deb packages, please refer to the document:
<SDK>/docs/en/Linux/Docker/Rockchip_Developer_Guide_Debian_Docker_EN.pdf
<SDK>/docs/en/Linux/System/Rockchip_Developer_Guide_Debian_EN.pdf
The rockchip_multicodecs driver differs from the simple-card mainly in the following aspects:
Primarily, it is compatible with the support for one sound card with one or multiple codecs.
It supports ADC for headphones and other detections, whereas the simple-card commonly uses GPIO.
The I2S TDM controller has separate TX/RX, and multicodecs support them independently, which would
affect third-party implementations if added to the simple-card.
The default audio system utilizes Pulseaudio, and typically, it is only necessary to configure
/etc/pulse/[Link] .
For example, in RK3588, adaptation for ES8388 and RK809 codecs is performed as follows:
+set-default-source alsa_input.platform-es8388-
sound.HiFi__hw_rockchipes8388__source
+set-default-sink alsa_output.platform-es8388-sound.HiFi__hw_rockchipes8388__sink
+set-default-source alsa_input.platform-rk809-
sound.HiFi__hw_rockchiprk809__source
+set-default-sink alsa_output.platform-rk809-sound.HiFi__hw_rockchiprk809__sink
To add support for additional codecs, obtain relevant information through the following commands:
vpu_service: Driver
mpp: The video codec middleware for the Rockchip platform, refer to the mpp
documentation for details
GStreamer/Rockit: Component interfacing with the app
The complete solution currently provided by the Rockchip Linux general SDK is based on GStreamer. The
advantage of using GStreamer is the convenience of building players, encoders, and other applications based on
the pipeline approach. For customized development based on Rockit, refer to the relevant Rockit release
documentation.
<SDK>/docs/en/Linux/Multimedia
├── Rockchip_Developer_Guide_Linux_RKADK_EN.pdf
├── Rockchip_User_Guide_Linux_Gstreamer_EN.pdf
└── Rockchip_User_Guide_Linux_Rockit_EN.pdf
The Graphics on the Rockchip Linux platform utilizes DRM and DMA-BUF for ARM Linux platforms. The
advantage is its universal architecture, making it easier to customize development based on this architecture, and
it is possible to leverage many existing components. Many foundational open-source projects have begun to use
the Rockchip platform as the adaptation platform for the ARM end. However, the disadvantage is that many
people do not fully understand these contents, and actual application requires a learning process. More
information can be referred to in the Rockchip wiki and the following documents.
<SDK>/docs/en/Linux/Graphics/
├── Rockchip_Developer_Guide_Buildroot_Weston_EN.pdf
├── Rockchip_Developer_Guide_Linux_Graphics_EN.pdf
Configure RK_ROOTFS_BOOTANIM through the SDK's mak config. Relevant settings include:
RK_ROOTFS_BOOTANIM_TIMEOUT for animation timeout, default is 3 seconds.
The example boot animation script located at
device/rockchip/common/overlays/rootfs/bootanim/etc/bootanim.d/[Link] plays
videos under /etc/bootanim.d by default (if no video is available, it plays snowflakes) until the first screen
appears and then goes full screen.
If there are special requirements such as multi-screen support, the [Link] script can also be modified to
achieve this. The process involves disabling Weston display at boot time, then invoking this script for the
animation display, and after waiting for 3 seconds, killing it and restoring the Weston display.
FAQ
If there are issues during the boot animation process, you can add the following line to the video playback script:
echo 0xff > /sys/module/drm/parameters/debug
This will enable the debug log of the display driver (printing all related calls from the upper layer). After
reproducing the issue, package and send the /var/log directory.
Some issues may be related to the boot logo, in which case you can add echo 3 > /sys/class/graphics/fb0/blank at
the beginning of the animation playback script to turn off the logo display.
The SDK in Debian defaults to using Xserver desktop applications based on the X11 protocol, such as XFCE,
LXDE, GNOME, etc., while Buildroot/Yocto defaults to using the Weston DRM based on the Wayland protocol
as the display backend. As shown in the following figure:
These Weston applications provide some basic functionality configurations such as status bars and backgrounds,
including Chromium browser, Terminal, Launchers configuration, camera preview, multi-channel video, GPU,
mouse, and other demos. For more demos, they can be added through the configuration in
/etc/xdg/weston/[Link].d/*. For more information on Weston parameter configuration and usage, refer to
Weston Development.
Note: Third-party UI frameworks may involve infringement risks without commercial authorization. If
using UI frameworks such as Buildroot QT/Enlightenment/Minigui on the Rockchip platform, third-party
authorization and technical support are required, as Rockchip does not provide related technical support
and maintenance.
The SDK offers three options for customizing UI: Weston+Wayland, LVGL UI, EFL, Flutter, and other desktop
development options.
/usr/bin/#
├── weston-calibrator
├── weston-clickdot
├── weston-cliptest
├── weston-confine
├── weston-content_protection
├── weston-debug
├── weston-dnd
├── weston-editor
├── weston-eventdemo
├── weston-flower
├── weston-fullscreen
├── weston-image
├── weston-multi-resource
├── weston-presentation-shm
├── weston-resizor
├── weston-scaler
├── weston-screenshooter
├── weston-simple-damage
├── weston-simple-dmabuf-egl
├── weston-simple-dmabuf-v4l
├── weston-simple-egl
├── weston-simple-shm
├── weston-simple-touch
├── weston-smoke
├── weston-stacking
├── weston-subsurfaces
├── weston-tablet
├── weston-terminal
├── weston-touch-calibrator
├── weston-transformed
BR2_PACKAGE_EFL=y
BR2_PACKAGE_LUAJIT=y
BR2_PACKAGE_EFL_GSTREAMER1=y
BR2_PACKAGE_ENLIGHTENMENT=y
BR2_PACKAGE_EFL_WAYLAND=y
Solution:
$ whereis [Link]
Find [Link] and create a soft link to [Link].9
/usr/lib/x86_64-linux-gnu$ ln -s [Link].9 [Link]
BR2_PACKAGE_LVGL=y
BR2_PACKAGE_LVGL_COLOR_DEPTH=32
BR2_PACKAGE_LV_DRIVERS=y
BR2_PACKAGE_LV_DRIVERS_USE_DRM=y
BR2_PACKAGE_LVGL_DEMO=y
BR2_PACKAGE_RK_DEMO=y
BR2_PACKAGE_LVGL_DEMO_USE_DRM=y
BR2_PACKAGE_FREETYPE=y
10.11.4 Flutter Linux Desktop Development
BR2_PACKAGE_FLUTTER_EMBEDDED_LINUX=y
BR2_PACKAGE_FLUTTER_GALLERY=y
## flutter-client -f -b /usr/share/flutter/gallery/release/
arm_release_ver: g13p0-01eac0, rk_so_ver: 10
[11:38:01.054] seeing the first app
Security mechanisms encompass secure boot, Rockchip anti-cloning, and other functionalities, for details refer to
the documents in the directory <SDK>/docs/en/Linux/Security .
Secure Boot is a mechanism designed to protect the system from malware and unauthorized modifications,
ensuring that only software signed by the manufacturer or developer can run at boot time. The following are the
general steps of the Secure Boot process.
By default, Secure Boot is not enabled. If you need to verify it, the steps are as follows:
$make menuconfig
Enable Security ---> [*] security feature
--- Security feature (secureboot, encryption, verity, etc.)
security check method (base|system-encryption|system-verity) (system-
encryption) --->
There are three security mechanisms by default: base, system-encryption, and system-verity. The base version has
no encryption, system-encryption has encryption capabilities, and system-verity has verification capabilities.
--- a/.chips/rk3576/rockchip_rk3576_evb1_v10_defconfig
+++ b/.chips/rk3576/rockchip_rk3576_evb1_v10_defconfig
@@ -1,4 +1,5 @@
RK_ROOTFS_PREBUILT_TOOLS=y
-RK_UBOOT_SPL=y
RK_KERNEL_DTS_NAME="rk3576-evb1-v10-linux"
+RK_SECURITY=y
+RK_SECURITY_CHECK_SYSTEM_ENCRYPTION=y
Directly run ./[Link] and follow the compilation error messages for step-by-step operations.
$ ./[Link]
============================================
system-encryption
ERROR: No root password (u-boot/keys/root_passwd) found in u-boot
Echo your root key for sudo to u-boot/keys/root_passwd
Some operations require superuser permission when creating an encrypted
image
$ ./[Link]
==========================================
system-encryption
ERROR: No encryption key (u-boot/keys/system_enc_key) found in u-boot
Create it by ./[Link] security-createkeys or move your key to it
$ ./[Link] security-createkeys
CONFIG_BLK_DEV_DM
CONFIG_DM_CRYPT
CONFIG_DM_VERITY
CONFIG_TEE
CONFIG_OPTEE
--- a/arch/arm64/boot/dts/rockchip/[Link]
+++ b/arch/arm64/boot/dts/rockchip/[Link]
@@ -22,6 +22,13 @@ fiq_debugger: fiq-debugger {
status = "okay";
};
+ firmware {
+ optee: optee {
+ compatible = "linaro,optee-tz";
+ method = "smc";
+ };
+ };
+
After running the ./[Link] command, the [Link] firmware generated in the rockdev directory can be used
for system updates. Simply boot the system normally, and as long as the vroot partition is properly mounted, the
secureboot feature is enabled. You can check the mount status of the vroot partition by executing the df -h
command:
root@rk3576-buildroot:/# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vroot 924M 799M 62M 93% /
FAQ
Environment Installation
For verification, find a machine that has not been burned with rpmb. If there is an encryption key in the
machine, use the encryption key in the machine first. If the machine's encryption key is different from the
one we compiled, the system will fail to start.
The encryption key is placed in the rpmb area and can be repeatedly erased and written. If you encounter a
different key, causing the system to not load, you can open FORCE_KEY_WRITE=true in
buildroot/board/rockchip/common/security-ramdisk-overlay/[Link] to force an update of
the key.
<SDK>/docs/en/Common/SECURITY/Rockchip_Developer_Guide_Secure_Boot_for_UBoot_Next_De
v_EN.pdf
TEE Development Guide:
<SDK>/docs/en/Common/SECURITY/Rockchip_Developer_Guide_TEE_SDK_EN.pdf
Rockchip chips offer anti-cloning technology to protect customers' firmware, private data, and core code. The
anti-cloning technology is primarily used to prevent unauthorized users from illegally copying and using
customers' firmware and private data, thus avoiding commercial losses caused by cloning.
Currently, there are three schemes provided for anti-cloning technology:
Basic Scheme
During production, Rockchip chips will burn the CPUID into the OTP, and each chip has a unique CPUID.
Customers can read the CPUID, use a symmetric key to encrypt it to obtain ENC-CPUID, and store the ENC-
CPUID in the vendor storage partition. After the system starts, it reads the ENC-CPUID from the vendor storage
partition and decrypts it to obtain DEC-CPUID, comparing it with the CPUID. If the match fails, it is considered
illegal, and the device is restarted to achieve the purpose of anti-cloning.
The security of this scheme depends on the protection of the key. Customers should avoid hardcoding the key in
the code in plaintext and are advised to obfuscate the key before hardcoding it into the code to prevent
unauthorized users from obtaining the plaintext key through disassembly.
Additionally, since the ENC-CPUID is stored in the vendor storage partition, erasing the flash will clear the
vendor storage partition and cause the loss of ENC-CPUID. Therefore, after erasing the flash, it is necessary to
rewrite the ENC-CPUID.
Intermediate Scheme
Rockchip chips reserve space in the OTP for customers to store private data for anti-cloning. Customers generate
custom private data DATA and MAC, where DATA and MAC meet a specific function transformation
relationship, such as MAC = func(DATA). Customers can write anti-cloning private data DATA to the OTP area
and hardcode the MAC in the trusted application TA (Trust Application) code. After the system starts, the trusted
application TA reads the anti-cloning private data DATA from the OTP, and the trusted application TA determines
whether there is a given function transformation relationship between DATA and MAC. If the match fails, it is
considered illegal, and the device is restarted to achieve the purpose of anti-cloning.
The security of this scheme depends on the protection of the anti-cloning private data DATA. The kernel side
cannot read this data, only the trusted application TA (Trust Application) can read this data. Customers should
refer to the "TA Signature" section in the document "Rockchip_Developer_Guide_TEE_SDK_EN.md" and sign
the trusted application TA (Trust Application) with their own key to prevent illegal TA from running and causing
the leakage of anti-cloning private data DATA.
Advanced Scheme
Rockchip chips reserve space in the OTP for customers to store custom private keys. For usage methods, please
refer to the "OEM Cipher Key" section in
docs/en/Common/SECURITY/Rockchip_Developer_Guide_OTP_EN.pdf .
The anti-cloning technology relies on the customer's private key OEM Cipher Key stored in the chip's OTP. This
key is written during the factory production phase. To ensure the key is not leaked, the system only provides a
writing interface without a reading interface. Some platforms also support the Hardware Read function to lock
the key, making the security even higher after the key is locked and cannot be read by the CPU.
Customers can customize plaintext data data, use the private key OEM Cipher Key, and use the AES algorithm to
encrypt the data to obtain encrypted data enc-data and store it in the specified location on the flash, or hardcode it
in the code. After the system starts, it first decrypts the encrypted data enc-data with the private key OEM Cipher
Key to obtain the decrypted data dec-data and compares the decrypted data dec-data with the plaintext data data
in the application code. If the plaintext data data or the encrypted data enc-data is tampered with, or if the flash
firmware is illegally copied to other unauthorized chip platforms, the decrypted data dec-data and the plaintext
data data will not match. If the match fails, it is considered illegal, and the device is restarted to achieve the
purpose of anti-cloning.
The advantage of this scheme is that the customer's private key OEM Cipher Key, after being locked, cannot be
read by the CPU, which has higher security characteristics such as confidentiality, integrity, and non-
tamperability.
The post rootfs option is primarily used for post-processing of the root file system, including performance tuning,
feature support, and debugging assistance, to meet various development and deployment needs. Feature
configuration can be performed through the SDK menuconfig. Here is an example of using menuconfig in the
SDK directory:
<SDK>$ make menuconfig
```markdown
[*] Rootfs (Buildroot|Debian|Yocto) --->
Post root fs installs --->
[*] create /etc/[Link]
hostname (auto) --->
locale (auto) --->
[*] strip kernel modules
[*] async-commit DRM driver hack
[*] debug information dir (/info/)
[*] Rockchip udev rules
[*] Wi-Fi/BT (Kernel modules, firmwares and scripts) --->
disk helpers (Boot-time mounting and resizing) (auto) --->
[ ] format extra partitions when needed
[ ] bypass boot time fsck
[*] log guardian (Truncate logs when disk is full) --->
The Rockchip post rootfs development options provide a variety of features for customizing and optimizing the
root file system, mainly including:
Log monitoring feature to truncate log files when disk space is insufficient
Through these options, you can customize and optimize the root file system on Rockchip devices according to
actual needs, improving system performance, feature support, and debugging capabilities. These options provide
developers with flexible customization space, helping to meet special needs in different scenarios.
10.15 Overlays Development
Rockchip Overlays offer a variety of functional options, including USB device support, fonts, input event
handling, boot animation, interrupt balancing, file system optimization, virtual terminals, prebuilt tools, and
custom overlays. You can configure these features through the SDK menuconfig.
Here is an example of using menuconfig in the SDK directory:
$ make menuconfig
For instance, if you need to enable the MTP feature in USB device support, you can configure it as follows:
In this way, you can enable or disable different Overlays features as needed, and configure them accordingly to
meet specific development requirements.
Currently, there are three startup methods provided in the Linux SDK: Sysv, Busybox, and Systemd init.
Yocto systems default to using the Sysv init method for managing boot startup, using the update-
[Link] to manage the startup configuration of services.
Buildroot systems default to using the Busybox init method for managing boot startup, which reads the
/etc/inittab file after booting.
Debian systems default to using the Systemd method for managing boot startup. The Systemd init reads the
relevant services in the /etc/systemd/system/ directory after booting.
The SDK has different treatments for different startup services. For example:
<SDK>/device/rockchip/common/scripts/[Link]
if [ "$POST_INIT_BUSYBOX" ]; then
mkdir -p "$TARGET_DIR/etc/init.d"
install -m 0755 external/rkscript/$SCRIPT "$TARGET_DIR/etc/init.d/"
fi
if [ "$POST_INIT_SYSTEMD" ]; then
mkdir -p "$TARGET_DIR/lib/systemd/system"
install -m 0755 external/rkscript/$DISK_HELPER_TYPE-[Link]
"$TARGET_DIR/lib/systemd/system/"
mkdir -p "$TARGET_DIR/etc/systemd/system/[Link]"
ln -sf /lib/systemd/system/$DISK_HELPER_TYPE-[Link]
"$TARGET_DIR/etc/systemd/system/[Link]/"
fi
if [ "$POST_INIT_SYSV" ]; then
mkdir -p "$TARGET_DIR/etc/init.d"
install -m 0755 external/rkscript/$SCRIPT
"$TARGET_DIR/etc/init.d/${DISK_HELPER_TYPE}[Link]"
mkdir -p "$TARGET_DIR/etc/rcS.d"
ln -sf ../init.d/${DISK_HELPER_TYPE}[Link] "$TARGET_DIR/etc/rcS.d/$SCRIPT"
fi
Here are some reference data for common benchmark tests; you can find more information in the following test
documentation:
<SDK>/docs/en/Linux/Profile/Rockchip_Introduction_Linux_Benchmark_KPI_EN.pdf
Below are some common module functionalities and methods for stress testing. You can find more detailed
information in the following document:
<SDK>/docs/en/Linux/Profile/Rockchip_User_Guide_Linux_Software_Test_EN.pdf
There are some commonly used debugging tools for static compilation are pre-installed in the SDK , as follows:
device/rockchip/common/tools/
├── adbd
├── busybox
├── gdb
├── io
├── kmsgrab
├── modetest
├── perf-4.19
├── perf-4.4
├── perf-5.10
├── pmap
├── procrank
├── ps
├── slabtop
├── strace
├── top
├── update
├── vendor_storage
├── vmstat
└── watch
Just make menuconfig in the SDK directory and select the relevant configuration.
│ Symbol: RK_ROOTFS_PREBUILT_TOOLS [=y]
│
│ Type : bool
│
│ Prompt: prebuilt tools
│
│ Location:
│
│ -> Rootfs
│
│ -> Post rootfs installs
│
│ Defined at [Link]-rootfs:263
Save the configuration, for example, the detailed modifications of RK3588 EVB1 are as follows:
device/rockchip/rk3588/rockchip_rk3588_evb1_lp4_v10_defconfig
@@ -1,4 +1,7 @@
RK_YOCTO_CFG="rockchip-rk3588-evb"
RK_WIFIBT_TTY="ttyS8"
+RK_ROOTFS_PREBUILT_TOOLS=y
You can open the following macros in Buildroot to build and obtain:
BR2_PACKAGE_ANDROID_TOOLS=y
BR2_PACKAGE_ANDROID_TOOLS_STATIC=y
For details usage of ADB tools, please refer to ADB official guidance document.
11.1.1 Overview
Network ADB: The host is connected to the STB device via a wired/wireless network (same LAN)
USB ADB: The host is connected to the STB device through a USB cable
You can open the following macros in Buildroot to build and obtain:
BR2_PACKAGE_BUSYBOX=y
BR2_PACKAGE_BUSYBOX_STATIC=y
Busybox is similar to a Linux toolbox. It integrates and compresses many tools and commands of Linux.
## ./busybox
BusyBox v1.36.0 (2023-05-20 11:25:39 CST) multi-call binary.
BusyBox is copyrighted by many authors between 1998-2015.
Licensed under GPLv2. See source distribution for detailed
copyright notices.
You can open the following macros in Buildroot to build and obtain:
BR2_PACKAGE_GDB=y
BR2_PACKAGE_GDB_STATIC=y
BR2_PACKAGE_GDB_DEBUGGER=y
GDB, a commonly used debugging tool in Linux, is a powerful program debugger. Please refer to GDB for more
usage instructions.
11.4 IO Tool
You can open the following macros in Buildroot to build and obtain:
BR2_PACKAGE_RKTOOLKIT=y
BR2_PACKAGE_RKTOOLKIT_STATIC=y
Memory can be accessed through /dev/mem, with permission to read and write chip registers.
Captures the KMS scan-out framebuffer associated with the specified CRTC or screen as a DRM object that can
be passed to other hardware functions.
11.6 modetest Tool
Modetest is a debugging tool that comes with the libdrm source code, which can perform some basic debugging
on drm.
(shell)# modetest -h
usage: modetest [-cDdefMPpsCvw]
Query options:
-c list connectors
-e list encoders
-f list framebuffers
-p list CRTCs and planes (pipes)
Test options:
-P <crtc_id>:<w>x<h>[+<x>+<y>][*<scale>][@<format>] set a plane
-s <connector_id>[,<connector_id>][@<crtc_id>]:<mode>[-<vrefresh>][@<format>]
set a mode
-C test hw cursor
-v test vsynced page flipping
-w <obj_id>:<prop_name>:<value> set property
Generic options:
-d drop master after mode set
-M module use the given driver
-D device use the given device
Default is to dump all info.
You can open the following macros in Buildroot to build and obtain:
To see how much memory a process uses, pmap provides a memory mapping of a process. The pmap command is
used to display the memory status of one or more processes. It reports the address space and memory status
information of the process.
#pmap PID
11.9 ProcrankTool
You can open the following macros in Buildroot to build and obtain:
BR2_PACKAGE_PROCRANK_LINUX=y
BR2_PACKAGE_PROCRANK_LINUX_STATIC=y
Use procrank to analyze memory utilization and analyze source code. procrank is a tool that counts memory
usage, including detailed parameters of VSS, PSS, PSS and USS. It is commonly used memory analysis tool.
11.10 PS Tool
The Linux PS (process status) command is used to display the status of the current process, similar to the
Windows Task Manager.
There are many parameters of PS. Here we only list a few commonly used parameters and briefly introduce them.
-A: lists all processes
-w: display more information by widening the display
-au: displays more detailed information
-aux: displays all processes containing other users
slabtop -d 10
Strace is a Linux user space tracer that can be used for tracking and debugging.
The top command is a commonly used performance analysis tool under Linux. It can display the resource usage
of each process in the system in real time and is often used for server-side performance analysis.
Enter the recovery program to update and format, then reboot into the normal system.
The vmstat command reports statistics on kernel threads, virtual memory, disks, hypervisor pages, traps, and
processor activity.
## watch
Usage:
watch [options] command
Options:
-b, --beep beep if command has a non-zero exit
-c, --color interpret ANSI color and style sequences
-d, --differences[=<permanent>]
highlight changes between updates
-e, --errexit exit if command has a non-zero exit
-g, --chgexit exit when output from command changes
-n, --interval <secs> seconds to wait between updates
-p, --precise attempt run command in precise intervals
-t, --no-title turn off header
-w, --no-wrap turn off line wrapping
-x, --exec pass command to exec instead of "sh -c"
Core options:
--seat=SEAT The seat that weston should run on, instead of the seat
defined in XDG_SEAT
--drm-device=CARD The DRM device to use, e.g. "card0".
--use-pixman Use the pixman (CPU) renderer (deprecated alias for --
renderer=pixman)
--current-mode Prefer current KMS mode over EDID preferred mode
--continue-without-input Allow the compositor to start without input
devices
11.19 Obtain System Log Information Automatically
The log information will be automatically obtained in the /info directory. The main log information is as follows:
/info/
├── clk_summary -> /sys/kernel/debug/clk/clk_summary
├── cmdline -> /proc/cmdline
├── cpuinfo -> /proc/cpuinfo
├── device-tree -> /proc/device-tree
├── diskstats -> /proc/diskstats
├── dma_buf -> /sys/kernel/debug/dma_buf
├── dri -> /sys/kernel/debug/dri
├── fstab -> /etc/fstab
├── gpio -> /sys/kernel/debug/gpio
├── interrupts -> /proc/interrupts
├── iomem -> /proc/iomem
├── kallsyms -> /proc/kallsyms
├── log -> /var/log
├── meminfo -> /proc/meminfo
├── [Link] -> /tmp/[Link]
├── os-release -> /etc/os-release
├── partitions -> /proc/partitions
├── pinctrl -> /sys/kernel/debug/pinctrl/
├── rkcif-mipi-lvds -> /proc/rkcif-mipi-lvds
├── rk_dmabuf -> /proc/rk_dmabuf
├── rkisp0-vir0 -> /proc/rkisp0-vir0
├── slabinfo -> /proc/slabinfo
├── softirqs -> /proc/softirqs
├── version -> /proc/version
└── wakeup_sources -> /sys/kernel/debug/wakeup_sources
...
Before customers obtain the SDK, they need to sign the SDK agreement. This agreement states specific rights
and obligations.
12.1.1 Buildroot
make legal-info
The SDK project can automatically generate relevant License information by running the make legal-info
command, Like RK3566 project:
The [Link] is the license information of the relevant repository used by RK3566 project.
The [Link] is the license information of the third-party tools of the PC used by RK3566 project.
12.1.2 Debian
The relevant copyright instructions for each source code package are located in
/usr/share/doc/*/copyright
12.1.3 Yocto
The relevant copyright instructions for each source code package are located in
build/tmp/deploy/licenses/*/recipeinfo
For the current mainstream License list, please refer to the following link
license-list
13.1 Github
13.3 Upstream
RV1108, RK3036, RK3066, RK3188, RK3228, RK3288, RK3368, RK3399, RK3566, RK3568
The following offers answers and clarifications to common questions about various aspects of the SDK. Here are
some potential questions that might be included in an SDK FAQ.
Relevant information can be obtained through the /info/ directory or /etc/os-release , such as
During the update with repo sync -c, the prompt No module named formatter occurs because your host machine
is using a newer version of Python, such as Python 3.8+, which has completely removed the formatter module.
This issue is caused by the outdated version of the repo tool in the external SDK. To resolve this problem,
updating the version of repo is necessary. An example of how to do this is as follows:
$ cd .repo/repo/
$ git checkout origin/stable
This branch repo is the 2022 version, and the default master branch is the 2020
version. Or add `--repo-rev=stable` during the repo init project to switch to the
new version repo.
Due to the matching problem between python3 and project repo versions in buildroot, device/rockchip can
be modified as follows:
--- a/common/[Link]
+++ b/common/[Link]
@@ -171,8 +171,6 @@ function add_build_info()
mkdir -p "$INFO_DIR"
If some network reasons cause buildroot compilation to fail. This can be solved by using the following ways:
Preset dl directory, dl is a pre-compiled package that can be integrated into buildroot in advance. Reduce
download time and improve compilation efficiency.
For example, rk3588 Linux SDK can be modified to add the dl directory as follows
$ cd .repo/manifests
$ Change the rk3588_linux_release.xml file as follows:
$ cd -
$.repo/repo sync -c
14.3.1 How to prevent recovery from being compiled into the [Link]
Newer SDKs support disabling recovery; to do this, navigate to make config and deselect the recovery option.
The packaging of [Link] is based on the package-file description. Early SDKs used a predefined package-file
located in the tools directory. For specific instructions, refer to the relevant documentation and remove the
recovery entry.
In newer SDKs, the package-file is automatically generated before packaging the [Link]. It is based on the
partition descriptions in the parameter partition and the partition images with the same name in the
output/firmware directory during the packaging process. If they match, they are automatically added to the
package-file and then packaged into the [Link]. Therefore, you can either delete the recovery partition in the
used [Link] or manually delete the output/firmware/[Link] before running make updateimg to
package it.
Newer SDKs also allow you to use make edit-package-file to directly edit the package-file and adjust which
images need to be packaged.
clock-format=seconds
The default configuration updates the time every minute separately, initiating the update when a specific screen is
enabled. The first update aligns with the current time to the nearest whole minute.
From the previous description, it seems likely that the screens were not enabled together, and then the system
time changed (either through network synchronization or manual setting), causing the two to be out of sync.
If minute-level accuracy is essential and this scenario needs to be considered, you could modify Weston.
Otherwise, using the second-level format should suffice.
widget_schedule_redraw(clock->widget);
+
+ clock_timer_reset(clock);
}
static void
@@ -589,7 +593,7 @@ clock_timer_reset(struct panel_clock *clock)
clock_gettime(CLOCK_REALTIME, &ts);
tm = localtime(&ts.tv_sec);
- its.it_interval.tv_sec = clock->refresh_timer;
+ its.it_interval.tv_sec = 0;
its.it_interval.tv_nsec = 0;
its.it_value.tv_sec = clock->refresh_timer - tm->tm_sec % clock-
>refresh_timer;
its.it_value.tv_nsec = 10000000; /* 10 ms late to ensure the clock digit has
actually changed */
14.4.2 How to Set Buildroot System to Boot into Command Line Mode
To disable Weston in buildroot (remove the include of [Link] in the corresponding board defconfig), then:
The difference is that frecon supports rotation, scaling, and Chinese characters, but it can only display on a single
screen.
This chapter is going to answer some frequently asked questions about Debian GNU/Linux based on the
Rockchip platform. For other questions, please refer to the official website Debian FAQ.
14.5.1 "noexec or nodev" Issue
Solution:
In addition, if other compilation exceptions are encountered, first check that the compilation system used is not
the system type of ext2/ext4.
Since building Base Debian needs to visit foreign websites, and when using domestic networks to visit
foreign websites, download failures often occur:
To uses live build in Debian, configured like followings to change the image source to domestic:
32-bit system:
+++ b/ubuntu-build-service/{buster/bullseye}-desktop-armhf/configure
@@ -11,6 +11,11 @@ set -e
echo "I: create configuration"
export LB_BOOTSTRAP_INCLUDE="apt-transport-https gnupg"
lb config \
+ --mirror-bootstrap "[Link] \
+ --mirror-chroot "[Link] \
+ --mirror-chroot-security "[Link] \
+ --mirror-binary "[Link] \
+ --mirror-binary-security "[Link] \
--apt-indices false \
--apt-recommends false \
--apt-secure false \
64-bit system:
--- a/ubuntu-build-service/{buster/bullseye}-desktop-arm64/configure
+++ b/ubuntu-build-service/{buster/bullseye}-desktop-arm64/configure
@@ -11,6 +11,11 @@ set -e
echo "I: create configuration"
export LB_BOOTSTRAP_INCLUDE="apt-transport-https gnupg"
lb config \
+ --mirror-bootstrap "[Link] \
+ --mirror-chroot "[Link] \
+ --mirror-chroot-security "[Link] \
+ --mirror-binary "[Link] \
+ --mirror-binary-security "[Link] \
--apt-indices false \
--apt-recommends false \
--apt-secure false \
If the package cannot be downloaded due to other network reasons, there is a pre-built package to share in Baidu
Cloud Network Disk, place it in the current directory and execute the next step directly .
It may be frequent abnormal operations (CTRL+C) during the compilation process, and the above errors can be
fixed by the following way:
The reason may be that the compilation process has been mounted multiple times, resulting in the above error,
which can be fixed by the following way:
[Link] How to Check Whether the Debian Display Uses X11 or Wayland
On X11 systems:
$ echo $XDG_SESSION_TYPE
x11
On X11 systems:
$ echo $XDG_SESSION_TYPE
wayland
root@linaro-alip:~# parted -l
This is a problem of Debian10 or earlier version, please add the following code in the /etc/[Link]:
#!/bin/sh -e
#
## [Link]
#
## This script is executed at the end of each multiuser runlevel.
## Make sure that the script will "exit 0" on success or any other
## value on error.
#
## In order to enable or disable this script just change the execution
## bits.
#
## By default this script does nothing.
## Generate the SSH keys if non-existent
if [ ! -f /etc/ssh/ssh_host_rsa_key ]
then
# else ssh service start in dpkg-reconfigure will fail
systemctl stop [Link]||true
dpkg-reconfigure openssh-server
fi
exit 0
It is mainly required that the kernel version of the PC should be 5.10+, which is a bug in the old QEMU. There
are two solutions:
The kernel version that comes with the PC must meet the requirements of 5.10+.
The way to check PC's Kernel Version:
cat /proc/version
Linux version 5.13.0-39-generic
If you want to modify and repackage on the original deb, please refer to the follow way:
When the physical memory of the system is not enough, you can add Debian's swap virtual memory partition for
the current running program. For example, create a 2G virtual memory
cd /opt
mkdir swap
dd if=/dev/zero of=swapfile bs=1024 count=2000000
## count represents the size, here is 2G.
swapon /opt/swapfile
Uninstall:
swapoff /opt/swapfile
If it is automatically mounted after booting, you can add it to the /etc/fstab file
eg : /opt/swapfile swap swap defaults 0 0
14.5.9 Update Debian System for the First Time Will Restart the Display Service
In general, in order to be compatible with different chips, when Debian starts for the first time,
/etc/init.d/[Link] will install various differential packages according to the chip, such as libmali isp and other
packages. After installation, the display service will be restarted. If it is an independent project, it can be placed
in the image to process this difference.
Introduction as follows:
EGL is an extension of OpenGL on the ARM platform for the x window system, and its function is
equivalent to the glx library under x86.
Since the driver modesettings used by Xorg will load [Link] by default (disabling glx will cause some
applications which detecting through glx environment fail to start), [Link] will search for the dri library
in the system. However, Xorg 2D acceleration is implemented directly based on DRM and does not
implement the dri library, so [Link] will report the following error during booting.
Similarly, the following errors will also be reported during the booting process of some applications, please
ignore it for it has not influence on applications operation.
14.5.11 How to Confirm that the Hardware Mouse Layer is Useful in Debian
If there are steps 1/2, and there are still problems, then check whether /var/log/[Link] has abnormalities.
Debian provides logrotate to manage log files. Logrotate is intended to simplify log file management for systems
that will generate many log files. Logrotate supports automatic rotation compression, deletion and sending log
related emails. Logrotate can be run daily, weekly, monthly or when the log file size reaches a certain value.
Typically, logrotate is run as a daily cron job.
When the system starts, the 'systemd' process will try to start '/lib/systemd/system/default. target' (usually the
graphical interface system is a symbolic link to "graphical. target"). The status can be obtained through the
following command:
After restarting, it was found that the interface was suspended at the logo and could not access the system.
The normal startup sequence of the system is' sysinit ->multi user ->graphic '. If it is set to' multi user. target ', it
means that the graphical interface has not been started. In this case, VT2 (terminal interaction needs to be
enabled) is required, which means that the kernel needs to open the following two macros
The default username and password for the system are 'linaro' and 'linaro',
Root 'can log in without a password, and can be accessed through the command line
to' sudo su '
XFCE desktop native bug can be resolved by checking 'Settings ->Desktop ->Icon' and clicking on 'Activate
Project'.
Unless using non-hardware accelerated, official native browser version. Otherwise, the customized browser
version needs to be started with the -no-sandbox parameter, because the sandbox is a permission management
and controls file access, and only without a sandbox can access to the hardware node is allowed to achieve
hardware acceleration.
In the SDK, glmark2-es2 uses the dri2 interface for display with the Mali GPU library.
#include <stdlib.h>
#include <stdio.h>
#include <xcb/xcb.h>
#include <xcb/dri2.h>
#include <X11/Xlib.h>
#include <X11/Xlib-xcb.h>
int main(void)
{
xcb_connection_t *c;
xcb_dri2_connect_cookie_t cookie;
xcb_dri2_connect_reply_t *reply;
Display *display = XOpenDisplay(NULL);
Window window = DefaultRootWindow(display);
c = XGetXCBConnection(display);
cookie = xcb_dri2_connect(c, window, XCB_DRI2_DRIVER_TYPE_DRI);
reply = xcb_dri2_connect_reply(c, cookie, 0);
printf("%s[%d] device(%s)\n", __func__, __LINE__,
xcb_dri2_connect_device_name (reply));
c = xcb_connect(NULL, NULL);
xcb_screen_t *screen = xcb_setup_roots_iterator(xcb_get_setup(c)).data;
cookie = xcb_dri2_connect(c, screen->root, XCB_DRI2_DRIVER_TYPE_DRI);
reply = xcb_dri2_connect_reply(c, cookie, 0);
printf("%s[%d] device(%s)\n", __func__, __LINE__,
xcb_dri2_connect_device_name (reply));
return 0;
}
root@linaro-alip:/# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/10/lto-wrapper
Target: aarch64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 10.2.1-6' --with-
bugurl=[Link] --enable-
languages=c,ada,c++,go,d,fortranx
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.1 20210110 (Debian 10.2.1-6)
This is a common operation in Linux systems. Normally, you need to install the bash-completion package.
DRI3 extension, part of X11, provides improved support for direct rendering. It's usually enabled by default in
Debian. As a low-level protocol, it's not directly executed without external calls.
To use the DRI3 extension in applications, refer to DRI3 documentation and write code to call the respective
interfaces. For example, use DRI3 interfaces provided by the XCB (X protocol C-language Binding) library.
Here's how to install and view these interfaces in Debian:
This installs the necessary libraries and headers for using DRI3 functions in your applications.
To view the definitions and functions of DRI3 interfaces, check the dri3.h header file:
vi /usr/include/xcb/dri3.h
This file contains specific implementations of the DRI3 interface, helping you understand how to use the
DRI3 extension in your applications.
Follow these steps to start using the DRI3 extension in Debian for developing or improving your graphics
applications. Remember to refer to official XCB and DRI3 documentation for correct and efficient use of these
interfaces.
Uninstalling xserver
Enabling CONFIG_FRAMEBUFFER_CONSOLE , CONFIG_DRM_FBDEV_EMULATION , CONFIG_VT ,
CONFIG_VT_CONSOLE in the kernel
Refer to /etc/X11/[Link].d/[Link]
...
Section "Screen"
Identifier "Default Screen"
Device "Rockchip Graphics"
Monitor "Default Monitor"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1024x600"
EndSubSection
EndSection
#### Valid values for rotation are "normal", "left", "right"
Section "Monitor"
Identifier "HDMI-A-1"
Option "Rotate" "inverted"
Option "Position" "0x0"
EndSection
Section "Monitor"
Identifier "DSI-1"
Option "Rotate" "left"
Option "Position" "0x0"
EndSection
Black screen refers to the time from X service startup to desktop application display (dependent on the desktop
application itself).
To maintain a logo during this time, add the following before executing [Link] in /usr/bin/X :
export XSERVER_FREEZE_DISPLAY=/.freeze_xserver
touch $XSERVER_FREEZE_DISPLAY
$(sleep 6; rm $XSERVER_FREEZE_DISPLAY)&
Freeze for 6 seconds, then display the desktop. Adjust the freeze duration as needed.
Alternatively:
{
export XSERVER_FREEZE_DISPLAY=/.freeze_xserver
touch $XSERVER_FREEZE_DISPLAY
while sleep .5; do
pgrep panel && break # Waiting for status bar service
done
sleep 2 # Waiting for status bar rendering
rm $XSERVER_FREEZE_DISPLAY
}&
The native mechanism is designed for compatibility with some non-touch applications, where Xserver converts
the first touch event into a mouse event.
To bypass, try:
For chips like RK3588, switch to a lower version of GCC and GLIBC for porting to a third-party system.
Step 2: Set the Buildroot configuration to use GCC 8 and GLIBC 2.28 by default.
[Configuration for rockchip_rk3588 with GCC version 8.x and GLIBC 2.28]
For a physically split screen with a resolution of 3840x2160 cut into 3840x720, the output resolution must be
3840x2160 to light up the screen, but only the 720 part is displayed.
Setting method:
+++ b/overlay/etc/X11/[Link].d/[Link]
[Configuration changes to set VirtualSize and Padding for the display]
Mouse movement is relative and usually doesn't require special modifications. If there are ratio or position issues,
consider using a software cursor (remove the mouse layer in kernel dts configuration or configure SWcursor in
the modesetting conf).
kernel/arch/arm64/boot/dts/rockchip# ag cursor
[Link]
12: cursor-win-id = <ROCKCHIP_VOP2_CLUSTER0>;
--- a/overlay/etc/X11/[Link].d/[Link]
+++ b/overlay/etc/X11/[Link].d/[Link]
@@ -2,6 +2,8 @@ Section "Device"
Identifier "Rockchip Graphics"
Driver "modesetting"
14.6.1 When playing videos, there is stuttering, and the logs show frame dropping
errors
Using fpsdisplaysink to confirm the maximum frame rate. If the maximum frame rate is close to the expected
frame rate, you can specify sync=false to solve the problem, some platforms can enable AFBC. About video
playback freezes, you can also check the hardware running time by echo 0x100 >
/sys/module/rk_vcodec/parameters/mpp_dev_debug
14.6.2 gst-launch-1.0 Camera Video Preview Command
Screen jitter is generally caused by insufficient DDR bandwidth. You can try the fixed performance mode. In
addition, due to the display hardware implementation, If there is scaling in the vertical direction, the required
performance and bandwidth will be relatively high, which is easily insufficient, and other scaling methods should
to be used (such as rga/gpu).
Use dmabuf related interfaces for data processing to achieve zero copy
Set the performance mode, use the official fpsdisplaysink to check the frame rate, and the driver's debugging
interface to check the driver frame rate.
Jitter is generally caused by insufficient performance of the display hardware, mostly due to insufficient DDR
bandwidth. DDR performance mode can be used to fix the highest frequency
Generally, the synthesis is supported by the gl plug-in, and the display is supported by a third-party display
service. Display services that can be synthesized internally through opengles (such as Weston)
14.7.1 Is There Any Introduction to Kylin System Porting, Which is to Download the
Standard iso Image and Extract [Link] for Porting
You can refer to the introduction of the porting document in the SDK, which is also applicable to Kirin os, but
Kirin os is relatively closed. If you want better performance, you can ask Kirin for images of RK platform.
14.7.2 Which Domestic OS Have Been Adapted
Tongxin and Kirin have adapted. In addition, the HarmonyOS community is currently working on the adaptation
of RK3588, RK356X, and RK3399. For detailed progress, you can also consult our company's business, or
follow the HarmonyOS open source community.
"Refer to the SDK documentation on VOP configuration to set the primary and mouse layers to non-cluster
layers."
Some chips support types of layers such as smart, esmart, and cluster, with the cluster layer being the default
setting for the mouse layer, relying on some special processing in the SDK.
Some customer applications use methods that do not support cluster layers and require the use of other types of
layers (such as smart, esmart) as the mouse layer, for example:
&vp0 {
cursor-win-id = <ROCKCHIP_VOP2_SMART0>;
};
There are interface of drm to query the type of plane. For details, please refer to kmssink method of gstreamer.
14.8.3 How to Configure the Position of Each Screen in Wayland Multi-screen with
Differential Display Mode, Such As Left and Right or Up and Down Positions
Weston's differential display only supports left and right arrangement, according to the screen loading order.
please refer to
<SDK>/docs/en/Linux/*/Rockchip_Developer_Guide_Buildroot_Weston_EN.pdf 2.9 Multi-screen
configuration for details.
Using the parameter --force-device-scale-factor=1.5 will make the entire screen display smaller, resulting in an
inability to display in full screen.
For the Chromium Wayland interface, this feature has only been adapted for Google's customized Aura Wayland
protocol in newer versions, and there are bugs present under the standard Weston.
If the same SSH public key should be used in different machines, you can copy the SSH private key file id_rsa to
“~/.ssh/id_rsa” of the machine you want to use.
The following prompt will appear when using a wrong private key, please be careful to replace it with the correct
private key.
After adding the correct private key, you can use git to clone code, as shown below.
ssh-add ~/.ssh/id_rsa
15.2 Switches Different SSH Public Keys on One Device
~$ man ssh_config
~$ cp /etc/ssh/ssh_config ~/.ssh/config
~$ vi .ssh/config
As shown in the figure, SSH uses the file “~/.ssh1/id_rsa” of another directory as an authentication private key. In
this way, different keys can be switched.
15.3 Key Authority Management
Server can monitor download times and IP information of a key in real time. If an abnormality is found,
download permission of the corresponding key will be disabled.
Keep the private key file properly. Do not grant second authorization to third parties.