Rockchip Linux Developer Guide V2.0.1
Rockchip Linux Developer Guide V2.0.1
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-04- Caesar
V1.0.0 Initial version
10 Wang
2021-05- Caesar
V1.1.0 Added support for rk3399, rk3288,rk3326/px30
20 Wang
2021-09- Caesar
V1.2.0 Updated support for Linux4.4 and Linux4.19
30 Wang
2022-05- Caesar
V1.4.1 Updated chip support list and 2022 roadmap
20 Wang
2022-06- Caesar
V1.4.2 Update SDK version and support
20 Wang
2022-09- Caesar
V1.5.0 Updated support for Linux 5.10
20 Wang
2023-09- Caesar
V2.0.0 Update the contents of each chapter
20 Wang
2023-12-
Ruby Zhang V2.0.1 Fix some description
05
RK Linux SDK Supported System List
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.3.0_20230920
gen-
rkr6
linux-
5.10-
RK3562 2021.11 11 4.0 5.10 V1.0.0_20230620
stan-
rkr1
linux-
5.10-
RK3566 2021.11 11 4.0 5.10 V1.3.0_20230920
gen-
rkr6
linux-
5.10-
RK3568 2021.11 11 4.0 5.10 V1.3.0_20230920
gen-
rkr6
linux-
5.10-
RK3399 2021.11 11 4.0 5.10 V1.3.0_20230920
gen-
rkr6
linux-
5.10-
RK3358 2021.11 N/A N/A 5.10 V1.2.0_20230920
gen-
rkr6
linux-
5.10-
RK3326 2021.11 N/A N/A 5.10 V1.2.0_20230920
gen-
rkr6
linux-
5.10-
PX30 2021.11 11 4.0 5.10 V1.3.0_20230920
gen-
rkr6
linux-
5.10-
RK3308 2021.11 N/A N/A 5.10 V1.2.0_20230920
gen-
rkr6
linux-
5.10-
RK312X 2021.11 N/A N/A 5.10 V1.2.0_20230920
gen-
rkr6
Buildroot Yocto Kernel TAG
Chipset DebianVersion SDK Version
Version Version Version Version
linux-
5.10-
RK3036 2021.11 N/A N/A 5.10 V1.2.0_20230920
gen-
rkr6
Linux4.19 SDK
linux-
4.19-
RK3566 2021.11 11 4.0 4.19 V1.4.0_20230720
gen-
rkr4
linux-
4.19-
RK3568 2021.11 11 4.0 4.19 V1.4.0_20230720
gen-
rkr4
linux-
4.19-
RK3399 2021.11 11 4.0 4.19 V1.3.0_20230720
gen-
rkr4
linux-
2018.02- 4.19-
RK3326 N/A N/A 4.19 V1.2.2_20221220
rc3 gen-
rkr3.2
linux-
2018.02-
RK3358 N/A N/A 4.19 V1.1.1_20220915 4.19-M-
rc3
rkr1
linux-
2018.02- 4.19-
RK3288 10 3.4 4.19 V1.2.2_20221220
rc3 gen-
rkr3.2
linux-
2018.02- 4.19-
PX30/PX30S 10 3.4 4.19 V1.2.2_20221220
rc3 gen-
rkr3.2
Linux4.4 SDK
Buildroot Debian Yocto Kernel TAG
Chipset SDK Version
Version Version Version Version Version
2018.02-
RK3399PRO 10 3.2 4.4 V1.4.2_20210202 N/A
rc3
2018.02-
RK1808 N/A N/A 4.4 V2.3.8_20210820 N/A
rc3
linux-
2018.02- 4.4-
RK3399 10 3.4 4.4 V2.9.0_20220620
rc3 gen-
rkr1
linux-
2018.02- 4.4-
RK3326 N/A N/A 4.4 V1.8.0_20220620
rc3 gen-
rkr1
2018.02-
RK3328 N/A N/A 4.4 V1.1.0_20200603 N/A
rc3
linux-
2018.02- 4.4-
RK3288 10 3.4 4.4 V2.6.0_20220620
rc3 gen-
rkr1
linux-
2018.02- 4.4-
PX30 10 3.4 4.4 V1.8.0_20220620
rc3 gen-
rkr1
2018.02-
RK3308 N/A N/A 4.4 V1.5.2_20220124 N/A
rc3
linux-
2018.02- 4.4-
RK3358 N/A N/A 4.4 V1.8.0_20220620
rc3 gen-
rkr1
linux-
2018.02- 4.4-
RK312X N/A N/A 4.4 V1.3.0_20220620
rc3 gen-
rkr1
2018.02-
PX3SE N/A N/A 4.4 V1.0.0_20190124 N/A
rc3
1.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.
RK3566 、 Linux5.10
-u \
ssh://git@[Link]/linux/rockchip/platform/manifests -b
RK3568
linux -m \
rk356x_linux5.10_release.xml
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_LINUX5.10_SDK_RELEASE_V1.0.0_20220520.tgz for example, After getting a initialization
package, you can get source code by running the following command:
mkdir rk3588
tar xvf RK3588_LINUX5.10_SDK_RELEASE_V1.0.0_20220520.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 Linux5.10 are as follows:
Chipset Compressed Package Version
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 --
rootfs
&& ./[Link] make ARCH=arm64 rk3588s- spl-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 --
rootfs
./[Link] make ARCH=arm64 rk3588- spl-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 --
rootfs
./[Link] make ARCH=arm64 rk3588- spl-new
[Link] -j24
make ARCH=arm64
./[Link] ./[Link]
./[Link] rockchip_linux_defconfig;
RK3568 EVB RK3568 EVB1 lunch:rockchip_rk3568_evb1_ddr4_v10_defconfig rk3568 --
rootfs make ARCH=arm64 rk3568-
&& ./[Link] spl-new
[Link] -j24
make ARCH=arm64
./[Link] ./[Link]
./[Link] rockchip_linux_defconfig;
RK3568 EVB RK3568 EVB8 lunch:rockchip_rk3568_evb8_lp4_v10_defconfig && rk3568 --
rootfs make ARCH=arm64 rk3568-
./[Link] spl-new
[Link] -j24
make ARCH=arm64
./[Link] ./[Link]
./[Link] rockchip_linux_defconfig;
RK3566 EVB RK3566 EVB2 lunch:rockchip_rk3566_evb2_lp4x_v10_defconfig rk3566 --
rootfs make ARCH=arm64 rk3566-
&& ./[Link] spl-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 --
rootfs make ARCH=arm64 rk3562-
&& ./[Link] spl-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 --
rootfs
Cleaner && ./[Link] make ARCH=arm64 rk3562- spl-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 --
rootfs
Cleaner && ./[Link] make ARCH=arm64 rk3562- spl-new
[Link] -j24
make ARCH=arm64
./[Link] ./[Link]
./[Link] rockchip_linux_defconfig;
RK3562 EVB RK3562 EVB1 lunch:rockchip_rk3562_evb1_lp4x_v10_defconfig rk3562 --
rootfs make ARCH=arm64 rk3562-
&& ./[Link] spl-new
[Link] -j24
make ARCH=arm64
./[Link] ./[Link]
./[Link] rockchip_linux_defconfig;
RK3562 EVB RK3562 EVB2 lunch:rockchip_rk3562_evb2_ddr4_v10_defconfig rk3562 --
rootfs make ARCH=arm64 rk3562-
&& ./[Link] spl-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
RK3399 ./[Link]
./[Link] rockchip_linux_defconfig; ./[Link]
RK3399 excavator SAPPHIRE lunch:rockchip_rk3399_sapphire_excavator_defconfig
rootfs make ARCH=arm64 rk3399- rk3399
EXCAVATOR && ./[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] rootfs
Build Debian system: RK_ROOTFS_SYSTEM=debian ./[Link] rootfs
Build Yocto system: RK_ROOTFS_SYSTEM=yocto ./[Link] rootfs
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-
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_cn.txt (docs file directory structure), and the detailed introduction as follows:
Please refer to <SDK>/docs/cn/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/cn/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/cn/Common/AVL
directory in the document titled 'RKeMMCSupportList_V1.73_20230303.pdf'. 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].
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.41_20230303.pdf" in the <SDK>/docs/cn/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.
WIFI/BT Support List for Rockchip Platform can be found in the document titled
'Rockchip_Support_List_Linux_WiFi_BT_20220828.pdf' in the <SDK>/docs/cn/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].
It includes audio algorithms for microphones and relevant development documents for audio/Pulseaudio
modules. The reference documents are as follows:
docs/cn/Common/AUDIO/
├── Algorithms
├── Rockchip_Developer_Guide_Audio_CN.pdf
└── Rockchip_Developer_Guide_PulseAudio_CN.pdf
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/cn/Common/CAN/
├── Rockchip_Developer_Guide_CAN_FD_CN.pdf
└── Rockchip_Developer_Guide_Can_CN.pdf
2.1.4 Clock Module Document (CLK)
This document primarily covers clock development on the Rockchip platform, including Clock, GPIO, PLL
spreading, etc.
docs/cn/Common/CLK/
├── Rockchip_Developer_Guide_Clock_CN.pdf
├── Rockchip_Developer_Guide_Gpio_Output_Clocks_CN.pdf
└── Rockchip_Developer_Guide_Pll_Ssmod_Clock_CN.pdf
The following documents primarily focus on the development of Rockchip Crypto and HWRNG (TRNG),
including driver development and upper-layer application development.
docs/cn/Common/CRYPTO/
└── Rockchip_Developer_Guide_Crypto_HWRNG_CN.pdf
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/cn/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/cn/Common/DEBUG/
├── Rockchip_Developer_Guide_DS5_CN.pdf
├── Rockchip_Developer_Guide_FT232H_USB2JTAG.pdf
├── Rockchip_Developer_Guide_GDB_Over_ADB_CN.pdf
└── Rockchip_Developer_Guide_GNU_MCU_Eclipse_OpenOCD_CN.pdf
This module document mainly includes development documents about DRM, DP, HDMI, MIPI, RK628 and
other display modules for Rockchip platform.
docs/cn/Common/DISPLAY/
├── DP
├── HDMI
├── MIPI
├── RK628
├── Rockchip_BT656_TX_AND_BT1120_TX_Developer_Guide_CN.pdf
├── Rockchip_Developer_Guide_Baseparameter_Format_Define_And_Use_CN.pdf
├── Rockchip_Developer_Guide_DRM_Display_Driver_CN.pdf
├── Rockchip_Developer_Guide_RGB_MCU_CN.pdf
├── Rockchip_Develop_Guide_DRM_Direct_Show_CN.pdf
├── Rockchip_DRM_Panel_Porting_Guide_V1.6_20190228.pdf
└── Rockchip_RK3588_Developer_Guide_MIPI_DSI2_CN.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/cn/Common/DVFS/
├── Rockchip_Developer_Guide_CPUFreq_CN.pdf
└── Rockchip_Developer_Guide_Devfreq_CN.pdf
This module document primarily includes the development documentation related to the file system on the
Rockchip platform.
docs/cn/Common/FS/
└── Rockchip_Developer_FAQ_FileSystem_CN.pdf
This module document primarily includes the development documentation related to the Ethernet GMAC
interface on the Rockchip platform.
docs/cn/Common/GMAC/
├── Rockchip_Developer_Guide_Linux_GMAC_CN.pdf
├── Rockchip_Developer_Guide_Linux_GMAC_DPDK_CN.pdf
├── Rockchip_Developer_Guide_Linux_GMAC_Mode_Configuration_CN.pdf
├── Rockchip_Developer_Guide_Linux_GMAC_RGMII_Delayline_CN.pdf
└── Rockchip_Developer_Guide_Linux_MAC_TO_MAC_CN.pdf
2.1.12 HDMI-IN Module Document (HDMI-IN)
This module document mainly contains development documents related to the HDMI-IN interface of the
Rockchip platform.
docs/cn/Common/HDMI-IN/
├── Rockchip_Developer_Guide_HDMI_IN_Based_On_CameraHal3_CN.pdf
└── Rockchip_Developer_Guide_HDMI_RX_CN.pdf
This module document mainly contains development documents related to I2C interface of the Rockchip
platform.
docs/cn/Common/I2C/
└── Rockchip_Developer_Guide_I2C_CN.pdf
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/cn/Common/IO-DOMAIN/
└── Rockchip_Developer_Guide_Linux_IO_DOMAIN_CN.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/cn/Common/IOMMU/
└── Rockchip_Developer_Guide_Linux_IOMMU_CN.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/cn/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".
docs/cn/Common/MCU/
└── Rockchip_RK3399_Developer_Guide_MCU_CN.pdf
Development guide for interfaces such as SDIO, SDMMC, and eMMC on the Rockchip platform.
docs/cn/Common/MMC/
├── Rockchip_Developer_Guide_SDMMC_SDIO_eMMC_CN.pdf
└── Rockchip_Developer_Guide_SD_Boot_CN.pdf
Process memory module mechanisms such as CMA and DMABUF on the Rockchip platform.
docs/cn/Common/MEMORY/
├── Rockchip_Developer_Guide_Linux_CMA_CN.pdf
├── Rockchip_Developer_Guide_Linux_DMABUF_CN.pdf
├── Rockchip_Developer_Guide_Linux_Meminfo_CN.pdf
└── Rockchip_Developer_Guide_Linux_Memory_Allocator_CN.pdf
docs/cn/Common/WATCHDOG/
└── Rockchip_Developer_Guide_Linux_WDT_CN.pdf
The development and usage of RKNN API are located in the project directory external/rknpu2 and are used
for inferring RKNN models generated by RKNN-Toolkit2.
For detailed usage instructions, please refer to the documentation in the current directory.
docs/cn/Common/NPU/
├── [Link]
├── rknn-toolkit2
│ ├── [Link]
│ ├── requirements_cp310-[Link]
│ ├── requirements_cp36-[Link]
│ ├── requirements_cp38-[Link]
│ ├── RKNNToolKit2_API_Difference_With_Toolkit1-[Link]
│ ├── RKNNToolKit2_OP_Support-[Link]
│ ├── Rockchip_Quick_Start_RKNN_Toolkit2_CN-[Link]
│ ├── Rockchip_Trouble_Shooting_RKNN_Toolkit2_CN-[Link]
│ └── Rockchip_User_Guide_RKNN_Toolkit2_CN-[Link]
└── rknpu2
├── RK3588_NPU_SRAM_usage.md
├── RKNN_Compiler_Support_Operator_List_v1.[Link]
├── RKNN_Dynamic_Shape_Usage.md
├── Rockchip_Quick_Start_RKNN_SDK_V1.5.2_CN.pdf
├── Rockchip_RKNPU_User_Guide_RKNN_API_V1.5.2_CN.pdf
└── Rockchip_RV1106_Quick_Start_RKNN_SDK_V1.5.2_CN.pdf
It mainly introduces the boot process on the Rockchip platform, configuring and debugging storage, OTP OEM
area burning and other security interfaces 。
docs/cn/Common/NVM/
├── Rockchip_Application_Notes_Storage_CN.pdf
├── Rockchip_Developer_FAQ_Storage_CN.pdf
├── Rockchip_Developer_Guide_Dual_Storage_CN.pdf
└── Rockchip_Developer_Guide_SATA_CN.pdf
docs/cn/Common/PCIe/
├── Rockchip_Developer_Guide_PCIe_CN.pdf
├── Rockchip_Developer_Guide_PCIE_EP_Stardard_Card_CN.pdf
├── Rockchip_Developer_Guide_PCIe_Performance_CN.pdf
├── Rockchip_PCIe_Virtualization_Developer_Guide_CN.pdf
└── Rockchip_RK3399_Developer_Guide_PCIe_CN.pdf
docs/cn/Common/PERF/
├── Rockchip_Develop_Guide_Linux_RealTime_Performance_Test_Report_CN.pdf
├── Rockchip_Optimize_Tutorial_Linux_IO_CN.pdf
├── Rockchip_Quick_Start_Linux_Perf_CN.pdf
├── Rockchip_Quick_Start_Linux_Performance_Analyse_CN.pdf
├── Rockchip_Quick_Start_Linux_Streamline_CN.pdf
└── Rockchip_Quick_Start_Linux_Systrace_CN.pdf
docs/cn/Common/PINCTRL/
└── Rockchip_Developer_Guide_Linux_Pinctrl_CN.pdf
Developer guide for PMICs such as RK805, RK806, RK808, RK809, and RK817 on the Rockchip platform.
docs/cn/Common/PMIC/
├── Rockchip_RK805_Developer_Guide_CN.pdf
├── Rockchip_RK806_Developer_Guide_CN.pdf
├── Rockchip_RK808_Developer_Guide_CN.pdf
├── Rockchip_RK809_Developer_Guide_CN.pdf
├── Rockchip_RK816_Developer_Guide_CN.pdf
├── Rockchip_RK817_Developer_Guide_CN.pdf
├── Rockchip_RK818_Developer_Guide_CN.pdf
├── Rockchip_RK818_RK816_Developer_Guide_Fuel_Gauge_CN.pdf
└── Rockchip_RK818_RK816_Introduction_Fuel_Gauge_Log_CN.pdf
Basic concepts and optimization methods for chip power consumption on Rockchip platform.
docs/cn/Common/POWER/
└── Rockchip_Developer_Guide_Power_Analysis_CN.pdf
docs/cn/Common/PWM
└── Rockchip_Developer_Guide_Linux_PWM_CN.pdf
docs/cn/Common/RGA/
├── Rockchip_Developer_Guide_RGA_CN.pdf
└── Rockchip_FAQ_RGA_CN.pdf
docs/cn/Common/SARADC/
└── Rockchip_Developer_Guide_Linux_SARADC_CN.pdf
docs/cn/Common/THERMAL/
└── Rockchip_Developer_Guide_Thermal_CN.pdf
Instructions for using tools such as partitioning, mass production burning, and factory line burning on the
Rockchip platform.
docs/cn/Common/TOOL/
├── [Link]
├── RKUpgrade_Dll_UserManual.pdf
├── [Link]
├── Rockchip_Introduction_Partition_CN.pdf
└── Rockchip_User_Guide_Production_For_Firmware_Download_CN.pdf
Introduction to functions such as TRUST and sleep & wake-up on the Rockchip platform
docs/cn/Common/TRUST/
├── Rockchip_Developer_Guide_Trust_CN.pdf
├── Rockchip_RK3308_Developer_Guide_System_Suspend_CN.pdf
├── Rockchip_RK3399_Developer_Guide_System_Suspend_CN.pdf
└── Rockchip_RK3588_Developer_Guide_System_Suspend_CN.pdf
docs/cn/Common/UART/
├── Rockchip_Developer_Guide_UART_CN.pdf
└── Rockchip_Developer_Guide_UART_FAQ_CN.pdf
Introduction to USB development guide, USB signal testing and debugging tools on the Rockchip platform
docs/cn/Common/USB/
├── Rockchip_Developer_Guide_Linux_USB_Initialization_Log_Analysis_CN.pdf
├── Rockchip_Developer_Guide_Linux_USB_Performance_Analysis_CN.pdf
├── Rockchip_Developer_Guide_Linux_USB_PHY_CN.pdf
├── Rockchip_Developer_Guide_USB2_Compliance_Test_CN.pdf
├── Rockchip_Developer_Guide_USB_CN.pdf
├── Rockchip_Developer_Guide_USB_FFS_Test_Demo_CN.pdf
├── Rockchip_Developer_Guide_USB_Gadget_UAC_CN.pdf
├── Rockchip_Developer_Guide_USB_SQ_Test_CN.pdf
├── Rockchip_Introduction_USB_SQ_Tool_CN.pdf
├── Rockchip_RK3399_Developer_Guide_USB_CN.pdf
├── Rockchip_RK3399_Developer_Guide_USB_DTS_CN.pdf
├── Rockchip_RK356x_Developer_Guide_USB_CN.pdf
├── Rockchip_RK3588_Developer_Guide_USB_CN.pdf
└── Rockchip_Trouble_Shooting_Linux4.19_USB_Gadget_UVC_CN.pdf
├── ApplicationNote
├── Audio
├── Camera
├── Docker
├── Graphics
├── Multimedia
├── Profile
├── Recovery
├── Security
├── System
├── Uefi
└── Wifibt
2.2.1 ApplicationNote
Development instructions for applications on the Rockchip platform, such as ROS, RetroArch, USB, etc
docs/cn/Linux/ApplicationNote/
├── Rockchip_Developer_Guide_Linux_Flash_Open_Source_Solution_CN.pdf
├── Rockchip_Instruction_Linux_ROS2_CN.pdf
├── Rockchip_Instruction_Linux_ROS_CN.pdf
├── Rockchip_Quick_Start_Linux_USB_Gadget_CN.pdf
└── Rockchip_Use_Guide_Linux_RetroArch_CN.pdf
docs/cn/Linux/Audio/
├── Rockchip_Developer_Guide_Microphone_Array_TEST_CN.pdf
├── Rockchip_Developer_Guide_Microphone_Array_Tuning.pdf
└── Rockchip_Introduction_Linux_Audio_3A_Algorithm_CN.pdf
MIPI/CSI Camera and Structured Light Development Guide on the Rockchip Platform
docs/cn/Linux/Camera/
├── Rockchip_Developer_Guide_Linux4.4_Camera_CN.pdf
├── Rockchip_Developer_Guide_Linux_RMSL_CN.pdf
└── Rockchip_Trouble_Shooting_Linux4.4_Camera_CN.pdf
Docker build and development of third-party systems such as Debian/Buildroot on the Rockchip platform.
docs/cn/Linux/Docker/
├── Rockchip_Developer_Guide_Debian_Docker_CN.pdf
├── Rockchip_Developer_Guide_Linux_Docker_Deploy_CN.pdf
└── Rockchip_User_Guide_SDK_Docker_CN.pdf
docs/cn/Linux/Graphics/
├── Rockchip_Developer_Guide_Buildroot_Weston_CN.pdf
└── Rockchip_Developer_Guide_Linux_Graphics_CN.pdf
2.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/cn/Linux/Multimedia/
├── Rockchip_Developer_Guide_Linux_RKADK_CN.pdf
├── Rockchip_User_Guide_Linux_Gstreamer_CN.pdf
└── Rockchip_User_Guide_Linux_Rockit_CN.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_CN.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.
docs/cn/Linux/Profile/
├── Rockchip_Developer_Guide_Linux_PCBA_CN.pdf
├── Rockchip_Introduction_Linux_Benchmark_KPI_CN.pdf
├── Rockchip_Introduction_Linux_PLT_CN.pdf
└── Rockchip_User_Guide_Linux_Software_Test_CN.pdf
An introduction to the recovery development process and upgrade during OTA upgrade of Rockchip Linux
platform.
docs/cn/Linux/Recovery/
├── Rockchip_Developer_Guide_Linux_DFU_Upgrade_CN.pdf
├── Rockchip_Developer_Guide_Linux_Recovery_CN.pdf
├── Rockchip_Developer_Guide_Linux_Upgrade_CN.pdf
└── Rockchip_Introduction_Smart_Screen_OTA_CN.pdf
Introduction to the secure boot solution of Securboot and TEE on Rockchip Linux platform
docs/cn/Linux/Security/
├── Rockchip_Developer_Guide_Linux_Secure_Boot_CN.pdf
└── Rockchip_Developer_Guide_TEE_SDK_CN.pdf
2.2.10 System Development (System)
Introduction to the porting and development guide for Debian and other third-party systems on the Rockchip
Linux platform
docs/cn/Linux/System/
├── Rockchip_Developer_Guide_Debian_CN.pdf
└── Rockchip_Developer_Guide_Third_Party_System_Adaptation_CN.pdf
docs/cn/Linux/DPDK/
└── Rockchip_Developer_Guide_Linux_DPDK_CN.pdf
Refer to the documentation in the <SDK>/docs/cn/<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/cn/<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_CN.pdf" document can be obtained from the
/docs/cn/<chip_name>/ directory and will be continuously improved and updated.
2.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/cn/<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/cn/Others directory.
docs/cn/Others/
├── Rockchip_Developer_Guide_Repo_Mirror_Server_Deploy_CN.pdf
├── Rockchip_Trouble_Shooting_Linux_Real-Time_Performance_CN.pdf
├── Rockchip_User_Guide_Bug_System_CN.pdf
└── Rockchip_User_Guide_SDK_Application_And_Synchronization_CN.pdf
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
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.15 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.17 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]
<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_CN.pdf in the current directory for tool usage,.
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
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]
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.[Link]
<SDK>/tools/windows/ParameterTool_v1.[Link]
4. Chapter-4 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:
SDK Overview
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:
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.
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.
4.1.2 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.
4.1.3 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.
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:
uboot kernel rootfs linux app
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.
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.
5. Chapter-5 SDK Development Environment Setup
5.1 Overview
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, 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/cn/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/cn/Others/Rockchip_User_Guide_SDK_Application_And_Synchronization_CN.pdf
。
5.3 Linux Server Development Environment Setup
It is recommended to use Ubuntu 22.04 for compilation. Other Linux versions may need to adjust the software
package accordingly. In addition to the system requirements, there are other hardware and software requirements.
Hardware requirements: 64-bit system, hard disk space should be greater than 40G. If you do multiple builds, you
will need more hard drive space
Considering the time cost of setting up customer's development environment, we also provide the image mode of
cross compiler docker for customer verification, so as to shorten the time-consuming of setting up the
compilation environment.
The compatibility test results of docker compilation image system are as follows:
When using the command line for device development, you can install the libraries and tools required for
compiling the SDK by the following steps.
Use the following apt-get command to install the libraries and tools required for the following operations:
sudo apt-get update && sudo apt-get install git ssh make gcc libssl-dev \
liblz4-tool expect expect-dev g++ patchelf chrpath gawk texinfo chrpath \
diffstat binfmt-support qemu-user-static live-build bison flex fakeroot \
cmake gcc-multilib g++-multilib unzip device-tree-compiler ncurses-dev \
libgucharmap-2-90-dev bzip2 expat gpgv2 cpp-aarch64-linux-gnu libgmp-dev \
libmpc-dev bc python-is-python3 python2
Note:
The installation command is applicable to Ubuntu22.04. For other versions, please use the corresponding
installation command according to the name of the installation package. If you encounter an error when
compiling, you can install the corresponding software package according to the error message.
If a PC cannot access the Google website while compiling Buildroot, DNS needs to be set up to
support downloading dl packages using the domestic image [Link]
Python 3.6 or later versions is required to be installed, and python 3.6 is used as an example here.
It is requires make 4.0 and above version to be installed, take make 4.2 as an example here.
lz4 1.7.3 or later versions is required to be installed.
Compiling yocto requires a VPN network, and git does not have the CVE-2022-39253 security
detection patch.
[Link] Setting up DNS to support for [Link]
The method to check and upgrade the python version of the host is as follows:
$ python3 --version
Python 3.10.6
If it does not meet the requirements of Python>=3.6 version, you can upgrade as follows:
PYTHON3_VER=3.6.15
echo "wget
[Link]
echo "tar xf Python-${PYTHON3_VER}.tgz"
echo "cd Python-${PYTHON3_VER}"
echo "sudo apt-get install libsqlite3-dev"
echo "./configure --enable-optimizations"
echo "sudo make install -j8"
The method to check and upgrade the make version of the host is as follows:
$ make -v
GNU Make 4.2
Built for x86_64-pc-linux-gnu
The method to check and upgrade the lz4 version of the host 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
$ git -v
git version 2.38.0
This SDK development environment installs the following versions of Linux systems. The SDK is compiled with
this Linux system by default:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04 LTS"
Linux version 5.15.0-46-generic (buildd@lcy02-amd64-115) (gcc (Ubuntu 11.2.0-
19ubuntu1) 11.2.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #49-Ubuntu SMP Thu Aug
4 18:03:25 UTC 2022
5.3.3 Introduction to Cross-compilation Tool Chain
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 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 SDK:
gcc version 10.3.1 20210621 (GNU Toolchain for the A-profile Architecture 10.3-
2021.07 (arm-10.29))
If you need to build a single module or third-party application, you need to configure the cross-compilation
environment. For example, RK3588, its cross-compilation tool is located in the
buildroot/output/rockchip_rk3588/host/usr directory, you need to add the tool’s bin/ directory and
set the aarch64-buildroot-linux-gnu/bin/ directory as an environment variable, and execute a script to
automatically configure environment variables in the top-level directory:
source buildroot/[Link]
cd buildroot/output/rockchip_rk3588/host/usr/bin
./aarch64-linux-gcc --version
If you need tool chains for other platforms or versions, you need to build them by yourself.
After the above environment is prepared, the Linux server development environment has been set up and the
source code can be downloaded and built.
Reference is as follows:
[Link]
s#Adding_new_recipes_to_the_build_system
[Link]
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.
6. Chapter-6 SDK Version and Update Instructions
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]_CN [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.
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/cn/Others/Rockchip_Developer_Guide_Repo_Mirror_Server_Deploy.pdf
7. Chapter-7 SDK Build Instructions
SDK can be configured and built related functions through make or ./[Link] and target parameters.
For details, please refer to device/rockchip/commo/[Link] compilation instructions.
That is, you can also run ./[Link] <target> to build related functions. You can view the detailed
compilation commands through ./[Link] help .
$ ./[Link] -h
Usage: [Link] [OPTIONS]
Available options:
lunch - choose defconfig
*_defconfig - switch to specified defconfig
olddefconfig - resolve any unresolved symbols in .config
savedefconfig - save current config to defconfig
menuconfig - interactive curses-based configurator
kernel-5.10 - build kernel 5.10
kernel - build kernel
modules - build kernel modules
loader - build loader (uboot|spl)
uboot - build u-boot
spl - build spl
uefi - build uefi
wifibt - build Wifi/BT
rootfs - build rootfs (default is buildroot)
buildroot - build buildroot rootfs
yocto - build yocto rootfs
debian - build debian rootfs
recovery - build recovery
pcba - build PCBA
security_check - check contidions for security features
createkeys - build secureboot root keys
security_uboot - build uboot with security paramter
security_boot - build boot with security paramter
security_recovery - build recovery with security paramter
security_rootfs - build rootfs and some relevant images with security paramter
(just for dm-v)
updateimg - build update image
otapackage - build OTA update image
sdpackage - build SDcard update image
firmware - generate and check firmwares
all - build all basic image
save - save images and build info
allsave - build all & firmware & updateimg & save
cleanall - cleanup
post-rootfs - trigger post-rootfs hook scripts
shell - setup a shell for developing
help - usage
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 . The currently available modules are as follows:
(rk3562) SoC
Rootfs --->
Loader (u-boot) --->
Kernel --->
Boot --->
Recovery (buildroot) --->
PCBA test (buildroot) --->
Security --->
Update (OTA and A/B) --->
Firmware --->
Extra partitions --->
Others configurations --->
Through the above config, you can choose different rootfs/loader/kernel and other configurations to perform
various customized compilations. It also comes with a powerful command line switching function.
Note that after menuconfig is configured, you should use make savedefconfig to save the
configuration.
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.
7.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 project root directory and execute the following command to automatically build and package of
Recovery.
<SDK>#./[Link] recovery
output/rockchip_<chipset_name>_recovery/images .
Note: [Link] contains the kernel ([Link]), so every time the Kernel changes, Recovery needs to
be repackaged and generated. Recovery repackaging method is as follows:
<SDK>#source buildroot/[Link]
<SDK>#cd buildroot
<SDK>#make recovery-reconfigure
<SDK>#cd -
<SDK>#./[Link] recovery
For more compilation instructions, please refer to the SDK release documentation.
Note: Recovery is a non-essential function, and some board-level configurations will not set it.
Enter the root directory of the project directory and execute the following command to automatically complete
the compilation and packaging of Rootfs:
./[Link] rootfs
After compilation, images in different formats are generated in the Buildroot directory:
output/rockchip_<target>/images . The rootfs.ext4 format is used by default.
If you need to build a single module or third-party application, you need to configure the cross-compilation
environment. For example, cross-compilation tool of RK3562 is located in the
buildroot/output/rockchip_rk3562/host/usr directory. You need to set the tool's bin/ directory and
aarch64-buildroot-linux-gnu/bin/ directory as environment variables, and execute the script to
automatically configure environment variables in the top directory (only valid for the current console).
source buildroot/[Link]
cd buildroot/output/rockchip_rk3562/host/usr/bin
./aarch64-linux-gcc --version
For example, for the rockchip-test module, the commonly used related compilation commands are as follows:
SDK#cd buildroot
Build rockchip-test
buildroot#make rockchip-test
Re-build rockchip-test
buildroot#make rockchip-test-reconfigure
Delete rockchip-test
buildroot#make rockchip-test-dirclean
or
buildroot#rm -rf output/rockchip_rk3562/build/rockchip-test-master/
./[Link] debian
cd debian/
For subsequent compilation and Debian firmware generation, please refer to the [Link] in the current
directory.
FAQ:
Solution:
In addition, if you encounter other compilation exceptions, first check that the compilation system used is not
ext2/ext4.
Since compiling Base Debian requires access to foreign websites, and when domestic networks access
foreign websites, download failures often occur:
Debian uses live build, and if the image source is changed to domestic, it can be configured like this:
+++ b/ubuntu-build-service/buster-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 are pre-generated packages shared in
Debian Base Download Package, and placed in the current directory to directly and go directly to the next step.
./[Link]
Enter the root directory of the project directory and execute the following command to automatically complete
the compilation and packaging of Rootfs:
./[Link] yocto
FAQ:
If you encounter the following problems during compiling the above steps:
Solution:
locale-gen en_US.UTF-8
export LANG=en_US.UTF-8 LANGUAGE=en_US.en LC_ALL=en_US.UTF-8
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.15 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]
The Linux burning tool is located in the tools/linux directory (Linux_Upgrade_Tool tool version requires V2.17
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:
./[Link]
Default partition description is showed as follows: (below is the RK3562 EVB partition reference)
This chapter mainly introduces the development of some core modules in SDK development, such as U-Boot,
Kernel, Recovery, Buildroot, Debian, Yocto, Multivideo, Graphics
This section briefly introduces the basic concepts of U-Boot and compilation precautions to help customers
understand the U-Boot framework of the RK platform. For detailed U-Boot development details, please refer to
the document Rockchip-Developer-Guide-UBoot-*.pdf in the <SDK>/docs/cn/Common/U-Boot
directory.
The v2017 (next-dev) is a version developed by Rockchip from the official v2017.09 official version of U-Boot.
It currently supports all mainstream chips on sale in Rockchip. The supported functions mainly include:
9.1.2 Version
There are two versions of RK U-Boot: the old version v2014 and the new version v2017. The internal names are
rkdevelop and next-dev respectively. Users have two ways to confirm whether the current U-Boot is version
v2017.
Method 1: Confirm whether the version number of Makefile in the root directory is 2017.
#
### Chapter-1 SPDX-License-Identifier: GPL-2.0+
#
VERSION = 2017
PATCHLEVEL = 09
SUBLEVEL =
EXTRAVERSION =
NAME =
......
Method 2: Confirm whether the first line officially printed on boot is U-Boot 2017.09.
Open source project : v2017 has been open source and regularly updated to Github: [Link]
kchip-linux/u-boot
Download rkbin
This is a toolkit repository used to store bins, scripts, and packaging tools of RK that are not open source.
When U-Boot is compiled, it will index relevant files from this repository and package them to generate
loader, trust, and uboot firmware. The rkbin and U-Boot projects should keep in the a same level of
directory.
Download GCC
The GCC compiler uses gcc-linaro-6.3.1 and is placed in the prebuilts directory. prebuilts and U-Boot
should keep in the a same level of directory. 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
"[Chip]_defconfig" or "[Chip].config" are usually full-featured versions, and the rest are Version of
specific features.
Supported kernel
Chip defconfig Description
dtb
RK3399Pro-
rknpu-lion_defconfig Y General version
npu
rk3568_defconfig
[Link]
[Link]
RK3568 rk3568-spl-spi-
nand_defconfig
[Link]
rk3568-usbplug. config
General version
rk3588_defconfig
None Storage device (memory
[Link]
boot)
RK3588 [Link] Y
Dual storage supports sata boot
[Link]
Supports aarch32 mode
[Link]
Used in ipc sdk
The U-Boot startup process of the RK platform is as follows, below are 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 required for
the C environment
// 【Phase 1】 C environment initialization, initiating a series of
function calls
=> board_init_f: init_sequence_f[]
initf_malloc
arch_cpu_init // 【SoC lowlevel initialization】
serial_init // Serial port initialization
dram_init // 【Get ddr capacity information】
reserve_mmu // Reserve memory from the end of
ddr to lower addresses
reserve_video
reserve_uboot
reserve_malloc
reserve_global_data
reserve_fdt
reserve_stacks
dram_init_banksize
sysmem_init
setup_reloc // Determine the address to be
relocated by U-Boot itself
// Assembly environment
=> relocate_code // Implements U-Boot code
relocation by assembly
// 【Phase 2】 C environment is initialized and a series of function calls
are initiated.
=> board_init_r: init_sequence_r[]
initr_caches // Enable MMU and I/Dcache
initr_malloc
bidram_initr
sysmem_initr
initr_of_live // Initialize of_live
initr_dm // Initialize dm framework
board_init // 【Platform initialization, this
is the core part 】
board_debug_uart_init // Serial port iomux, clk
configuration
init_kernel_dtb // 【switch to kernel dtb】!
clks_probe // Initialize system frequency
regulators_enable_boot_on // Initialize system power
io_domain_init // Initialize io-domain
set_armclk_rate // __weak, ARM frequency increase
(implemented only when the platform requires it)
dvfs_init // Frequency and voltage
regulation of wide temperature chip
rk_board_init // __weak, implemented by each
chip platform
console_init_r
board_late_init // 【Initialize Platform late】
rockchip_set_ethaddr // Set mac address
rockchip_set_serialno // Set serialno
setup_boot_mode // Parse "reboot xxx" command 、
// Identify buttons and loader
burning mode, recovery
charge_display // U-Boot charging
rockchip_show_logo // Show boot logo
soc_clk_dump // print clk tree
rk_board_late_init // __weak, implemented by each
chip platform
run_main_loop // 【Enter command line mode, or
execute the boot command 】
RK platform provides serial port key combinations to trigger some events for debugging and burning (if it cannot
be triggered, please try a few more times; it will not work when secure-boot is enabled). Long press when
powering on:
This section briefly introduces some common configuration modifications of the kernel, mainly the configuration
of DTS, to help customers make some simple modifications faster and more conveniently. The Kernel version is
based on 4.4 and will be introduced accordingly.
Device Tree Source (DTS) files are a data structure used to describe hardware devices, defining and configuring
hardware devices in the Linux kernel. These files utilize a text-like format, representing hardware devices and
their relationships through a hierarchical structure and attribute descriptions.
Device Tree Source files are built into Device Tree Blob (DTB) files, which the kernel loads and parses during
startup. The kernel extracts hardware device information from these files for initialization and configuration.
The introduction of Device Tree addresses solves the inflexibility and maintainability issues of traditional "hard-
coded" methods when dealing with different hardware configurations. By abstracting hardware descriptions and
configurations, the kernel can adapt to various hardware platforms without modifying the kernel code. In this
way, the same kernel can run on multiple different hardware devices, requiring only the loading of the appropriate
device tree.
This chapter aims to introduce how to add a new board DTS configuration and provides some common syntax
introduction. For more detailed information about DTS, please refer to devicetree-specifications and devicetree-
bindings.
Currently, Linux Kernel supports using dts on multiple platforms. The dts files of RK platform are stored in:
ARM:arch/arm/boot/dts/
ARM64:arch/arm64/boot/dts/rockchip
The general naming rule for dts files is "[Link]", such as [Link].
soc refers to the chip model, and board_name is usually named according to the silk of the board.
If your board is an integrated board, you only need a dts file to describe it.
If the hardware is designed with a core board and base board, or the product has multiple product forms, you can
put the common hardware description in the dtsi file, the dts file describes different hardware modules, and
includes common hardware descriptions through include "[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 building Kenrel, you can directly make [Link] (such as [Link]) to
generate the corresponding [Link] (including dtb data).
The dts syntax just like c/c++, by #include [Link] to include other public dts data. The dts file will inherit all
the device nodes' properties and values included in the dtsi files. If a property is defined in multiple dts/dtsi files,
its value is ultimately the definition of dts. All controller nodes related to the chip will be defined in [Link]. If
you need to enable the device function, you need to set its status to "okay" in the dts file. To shut down 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";
};
The corresponding development documents are released for functional modules under the
<SDK>/docs/cn/Common/ directory. This section mainly make a summary index of these development
documents. Based on the issues encountered in actual development, refer to the following table to read and learn
the corresponding development guide. It can be obtained under docs/cn/Common and will be continuously
improved and updated. For more details, please refer to Documentation Description.
9.2.3 GPIO
For example, RK3399/RK3399Pro provides 5 groups of GPIOs (GPIO0~GPIO4), a total of 122. All GPIOs can
be used as interrupts. GPIO0/GPIO1 can be used as system wake-up pins. All GPIOs can be configured as pull-
up or pull-down by software. All GPIOs are default for input, GPIO drive capabilities are software configurable.
About the correspondence relationship between the GPIO on the schematic diagram and the GPIO in the dts, for
example, GPIO4C0, then the corresponding dts should be "gpio4 16". Because GPIO4A has 8 pins and GPIO4B
also has 8 pins, so the c0 port is 16, the c1 port is 17, and so on; for the use of GPIO, please refer to
<SDK>/docs/cn/Common/PinCtrl/ Rockchip_Developer_Guide_Linux_Pinctrl_CN.pdf for details.
Dynamic Voltage and Frequency Scaling(DVFS) is a real-time voltage and frequency adjustment technology.
Currently, the modules supporting DVFS in the 4.4 kernel include CPU, GPU, and DDR. CPUFreq is a set of
framework models defined by kernel developers that support dynamic scaling of CPU frequency and voltage. It
can effectively reduce CPU power consumption while taking into account CPU performance. CPUFreq selects a
suitable frequency for CPU to use through different frequency conversion strategies. The current kernel version
provides the following strategies:
:
CPU small core /sys/devices/system/cpu/cpu0/cpufreq/
CPU big : /sys/devices/system/cpu/cpu4/cpufreq/
:
GPU /sys/class/devfreq/[Link]/
DDR: /sys/class/devfreq/dmc/
Taking RK3399/RK3399pro GPU as an example to perform fixed frequency operation, the process is as follows:
cat /sys/class/devfreq/[Link]/available_frequencies
Fixed frequency:
There are temperature control sensors in the ARM core and GPU core of RK3399/RK3399Pro chips respectively,
which can monitor the temperature of CPU and GPU in real time, and control the frequencies of CPU and GPU
through algorithms to control the temperatures of CPU and GPU. The heat dissipation conditions corresponding
to different hardware designs and molds of each product are also different. The temperature control parameters
can be appropriately adjusted through the following configuration 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 instructions on temperature control, please refer to the relevant documents in the
<SDK>/docs/cn/Common/THERMAL directory.
For DDR configuration instructions, please refer to the relevant documents in the
<SDK>/docs/cn/Common/DDR directory.
For the dts configuration of RK3399Pro using LPDDR4, please refer to the file:
arch/arm64/boot/dts/rockchip/[Link] . Just copy the following 3 nodes in
the file to the corresponding product dts:
&dfi {
status = "okay";
};
&dmc {
status = "okay";
center-supply = <&vdd_center>;//Customers need to configure according to the
actual hardware circuit here
upthreshold = <40>;
downdifferential = <20>;
system-status-freq = <
/*system status freq(KHz)*/
SYS_STATUS_NORMAL 856000
SYS_STATUS_REBOOT 416000
SYS_STATUS_SUSPEND 416000
SYS_STATUS_VIDEO_1080P 416000
SYS_STATUS_VIDEO_4K 856000
SYS_STATUS_VIDEO_4K_10B 856000
SYS_STATUS_PERFORMANCE 856000
SYS_STATUS_BOOST 856000
SYS_STATUS_DUALVIEW 856000
SYS_STATUS_ISP 856000
>;
vop-pn-msch-readlatency = <
/* plane_number readlatency */
0 0
4 0x20
>;
vop-bw-dmc-freq = <
/* min_bw(MB/s) max_bw(MB/s) freq(KHz) */
763 1893 416000
3013 99999 856000 \
>;
auto-min-freq = <0>;
};
&dmc_opp_table {
compatible = "operating-points-v2";
opp-200000000 {
opp-hz = /bits/ 64 ;
opp-microvolt = <900000> ;
status = "disabled";
};
opp-300000000 {
opp-hz = /bits/ 64 ;
opp-microvolt = <900000> ;
status = "disabled";
};
opp-400000000 {
opp-hz = /bits/ 64 ;
opp-microvolt = <900000> ;
status = "disabled";
};
opp-416000000 {
opp-hz = /bits/ 64 ;
opp-microvolt = <900000> ;
};
opp-528000000 {
opp-hz = /bits/ 64 ;
opp-microvolt = <900000> ;
status = "disabled";
};
opp-600000000 {
opp-hz = /bits/ 64 ;
opp-microvolt = <900000>;
status = "disabled";
};
opp-800000000 {
opp-hz = /bits/ 64 ;
opp-microvolt = <900000>;
status = "disabled";
};
opp-856000000 {
opp-hz = /bits/ 64 ;
opp-microvolt = <900000>;
};
opp-928000000 {
opp-hz = /bits/ 64 ;
opp-microvolt = <900000>;
status = "disabled";
};
opp-1056000000 {
opp-hz = /bits/ 64 ;
opp-microvolt = <900000>;
status = "disabled";
};
};
For LPDDR4, only the two frequencies: 416M and 856M are supported. Other frequencies have been disabled, so
if customers want to use the same dts to support LPDDR4 and other types of DDR will only be able to support
416M and 856M frequencies. At this time please be sure to configure the DDR frequency conversion function to
be enabled by default. The frequency conversion function of LPDDR4 limits the number of sound cards for the
following reasons:
If LPDDR4 requires frequency conversion function, the audio buffer needs to be moved to sram. The sram
memory of RK3399Pro is limited, and the available memory is 128k. Currently, the memory pre-allocated
to a single audio stream is 32k, so the maximum number of sound cards supported by the system is only 2
(32k22, each sound card includes playback and recording). More sound cards cannot be created
successfully unless the pre-allocated memory size for a single audio stream is reduced. but this also
relatively reduces the maximum buffer size supported underlying. If the user layer uses a sound card and
wants to set a larger buffer, it will be limited. Please note that USB sound cards are not within the restriction
because they do not use dma. In other words, you can have 2 sound cards (including sound cards with
HDMI, spdif, i2s and other interfaces) and multiple USB sound cards.
If LPDDR4 frequency conversion is required, the audio buffer needs to be moved to sram. At this time, the
system can only support up to 2 sound cards.
&dmac_bus {
iram = <&iram>;
rockchip,force-iram;
};
If you do not need LPDDR4 frequency conversion, since LPDDR4 frequency conversion is limited to 2
sound cards, if you need more than 3 sound cards, you need to turn off LPDDR4 frequency conversion, that
is, disable the dmc node in the dts of the corresponding product, as shown below:
&dmc {
status = "disabled";
… …
};
In addition, you need to make sure that the following two configurations in the kernel are deleted:
Delete the following configuration in dts:
&dmac_bus {
iram = <&iram>;
rockchip,force-iram;
};
For detailed instructions on SD Card configurationl, please refer to the relevant documents in the
<SDK>/docs/cn/Common/MMC directory.
The UART debug of some chips such as RK3326/RK3399PRO is multiplexed with SD Card. The default
configuration is to turn on debug. If you want to use SD Card, the following configuration is needed:
&fiq_debugger {
status = "disabled";
pinctrl-0 = <&uart2a_xfer>;
};
&sdmmc {
...
sd-uhs-sdr104;
status = "okay";
};
9.3.1 Introduction
The development of Recovery mechanism is similar to the development of Android's Recovery function. The
main function is to erase user data and upgrade system.
Recovery mode in Linux is to add an additional Recovery partition on the device. This partition is composed of
kernel+resource+ramdisk and is mainly used for upgrade operations. u-boot will determine whether the system to
be booted is a Normal system or a Recovery system based on the fields stored in the misc partition. Due to the
independence of the system, Recovery mode can ensure the integrity of the upgrade. That is, if the upgrade
process is interrupted, such as an abnormal power off, the upgrade can still continue.
9.3.2 Debug
The log upgraded in Recovery mode is printed on the serial port. Another way is to check the
userdata/recovery/Log file
Buildroot is a tool that uses cross-compilation to build a complete Linux system for embedded systems. The
operation is simple and automatic.
Based on the native Buildroot, Rockchip has integrated BSP configuration of relevant chips, the configuration of
the acceleration functions of each hardware module, and the in-depth customization development of third-party
packages to facilitate customers to deeply customize and secondary develop products.
Rockchip provides support for Debian 10/11 based on X11 display architecture and is based on the Linaro
version. The support also includes graphics and video acceleration functions. Related software packages include
libmali, xserver, gstreamer rockchip, etc. These software packages can be built 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 build the deb packages, please refer to the documentation:
<SDK>/docs/cn/Linux/Docker/Rockchip_Developer_Guide_Debian_Docker_CN.pdf
<SDK>/docs/cn/Linux/System/Rockchip_Developer_Guide_Debian_CN.pdf
Audio uses pulseaudio by default. Normally, you only need to configure /etc/pulse/[Link]
For example, the two Codecs of ES8388 and RK809 is adapted in RK3588.
+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
If you need to add more Codec support, obtain relevant information through the following command:
vpu_service: driver
mpp: Video encoding and decoding middleware for the rockchip platform. For
related instructions, please refer to the mpp document.
gstreamer/rockit: components for docking apps
Currently, the complete solution provided by Rockchip Linux Universal SDK is based on GStreamer. The
advantage of using GStreamer is that it can more conveniently complete applications such as players and
encoders based on pipelines. If you need customized development based on rockit, please refer to the relevant
release documents of rockit.
Reference documents:
<SDK>/docs/cn/Linux/Multimedia
├── Rockchip_Developer_Guide_Linux_RKADK_CN.pdf
├── Rockchip_User_Guide_Linux_Gstreamer_CN.pdf
└── Rockchip_User_Guide_Linux_Rockit_CN.pdf
9.9 Grahpics Development
Graphics of Rockchip Linux Platform is an ARM Linux platform that utilizes DRM and DMA BUF. The
advantage is that with a universal architecture, customized development based on this architecture is easier, and
many existing components can be utilized. The development of many existing open source projects has started to
use the Rockchip platform as an adaptation platform for ARM. But the disadvantage is that many people do not
fully understand these contents, and practical application requires a learning process. For more information,
please refer to the Rockchip wiki and the following documents.
<SDK>/docs/cn/Linux/Graphics/
├── Rockchip_Developer_Guide_Buildroot_Weston_CN.pdf
├── Rockchip_Developer_Guide_Linux_Graphics_CN.pdf
Commonly used applications of SDK include Weston, EFL, ROS and other application development. Please refer
to the documents in the /docs/cn/Linux/Graphics/ApplicationNote directory.
9.12 Secureboot
Secureboot is not enabled by default. If verification is required, the steps are as follows:
$make menuconfig
Enable Security ---> [*] security feature
$ make savedefconfig
--- a/.chips/rk3566_rk3568/rockchip_rk3568_evb1_ddr4_v10_defconfig
+++ b/.chips/rk3566_rk3568/rockchip_rk3568_evb1_ddr4_v10_defconfig
@@ -3,3 +3,4 @@ RK_KERNEL_DTS_NAME="rk3568-evb1-ddr4-v10-linux"
RK_USE_FIT_IMG=y
RK_WIFIBT_TTY="ttyS8"
RK_PARAMETER="[Link]"
+RK_SECURITY=y
9.12.3 Build Secureboot
Directly run ./[Link] and follow the compilation error instructions and operate step by step:
$ ./[Link]
$ ./[Link] createkeys
$ ./[Link]
============================================
ERROR: No root passwd(u-boot/keys/root_passwd) found in u-boot
echo your root key for sudo to u-boot/keys/root_passwd
$ ./[Link]
Security: No found config CONFIG_BLK_DEV_DM in
kernel/arch/arm64/configs/rockchip_linux_defconfig
make sure your config include this list
---------------------------------------
CONFIG_BLK_DEV_DM
CONFIG_DM_CRYPT
CONFIG_BLK_DEV_CRYPTOLOOP
CONFIG_DM_VERITY
CONFIG_TEE
CONFIG_OPTEE
CONFIG_FIT_SIGNATURE
CONFIG_SPL_FIT_SIGNATURE
u-boot adds related configuration:
--- a/configs/rockchip_rk3566_rk3568_ramboot_defconfig
+++ b/configs/rockchip_rk3566_rk3568_ramboot_defconfig
@@ -4,6 +4,8 @@
BR2_PACKAGE_LUKSMETA=y
+BR2_PACKAGE_RECOVERY=y
+BR2_PACKAGE_RECOVERY_UPDATEENGINEBIN=y
Environment installation:
When verifying, find a device that has not burned rpmb. If there is an encryption key in the device, it will
be used first. If the device encryption key is different from the encryption key we compiled, the startup will
fail.
The encryption key is placed in the rpmb area and can be rewritten. If the key is different and the system
cannot be loaded, you can turn on FORCE_KEY_WRITE=true in
buildroot/board/rockchip/common/security-ramdisk-overlay/[Link] to force the key to be
updated.
Currently, there are three booting ways provided in the Linux SDK: Sysv, Busybox, and Systemd init.
Yocto system uses Sysv init by default to manage booting, and [Link] is used to manage the
booting configuration of services.
Buildroot system uses the Busybox init way to manage booting by default. Busybox init will read the inittab file
in the /etc/ directory after booting.
Debian system uses Systemd way to manage booting by default. Systemd init will read related services in the
/etc/systemd/system/ directory after booting.
SDK has some different processing for different booting 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
The following are reference data for some commonly used benchmark tests. You can find more information in the
following test documents:
<SDK>/docs/cn/Linux/Profile/Rockchip_Introduction_Linux_Benchmark_KPI_CN.pdf
Some common module functions and stress testing methods are provided below. You can find more detailed
information in the following documents:
<SDK>/docs/cn/Linux/Profile/Rockchip_User_Guide_Linux_Software_Test_CN.pdf
10. Chapter-10 SDK System Debugging Tools Introduction
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.
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
10.1 ADB Tool
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.
10.1.1 Overview
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.
## Chapter-10 ./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.
10.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.
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.
10.7 Perf Tool
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
10.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.
10.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.
## Chapter-10 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
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
...
11. Chapter-11 SDK Software License Instructions
Before customers obtain the SDK, they need to sign the SDK agreement. This agreement states specific rights
and obligations.
11.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.
11.1.2 Debian
The relevant copyright instructions for each source code package are located in
/usr/share/doc/*/copyright
11.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
12. Chapter-12 Rockchip open source information
12.1 Github
12.2 Wiki
12.3 Upstream
RV1108, RK3036, RK3066, RK3188, RK3228, RK3288, RK3368, RK3399, RK3566, RK3568
13. Chapter-13 SDK FAQ
Relevant information can be obtained through the /info/ directory or /etc/os-release , such as
When using repo sync -c to update, prompts No module named formatter . This is because your host
uses a new version of python. For example, python3.8+ completely removes formatter, and the repo version of
the released SDK is too old. This is only fixed by updating the repo version, for example, through the following
ways:
$ 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
Solution :
mount -o remount,exec,dev xxx
(where xxx is the project directory path, then rebuild)
In addition, if you encounter other compilation exceptions, firstly, make sure that the compilation system used is
not ext2/ext4.
Since compiling Base Debian requires access to foreign websites, and when domestic networks access
foreign websites, download failures often occur:
Debian uses live build, and if the image source is changed to domestic, it can be configured like this:
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 are pre-generated packages shared in
Debian Base Download Package, and placed in the current directory to directly go to the next step.
The error may have been caused by frequent abnormal operations (CTRL+C) during the compilation process. It
can be fixed as follows:
The error may have been caused by multiple mounts during the compilation process. It can be fixed as follows:
In X11 systems:
$ echo $XDG_SESSION_TYPE
x11
In Wayland systems:
$ echo $XDG_SESSION_TYPE
wayland
root@linaro-alip:~# parted -l
#!/bin/sh -e
#
## Chapter-13 [Link]
#
## Chapter-13 This script is executed at the end of each multiuser runlevel.
## Chapter-13 Make sure that the script will "exit 0" on success or any other
## Chapter-13 value on error.
#
## Chapter-13 In order to enable or disable this script just change the execution
## Chapter-13 bits.
#
## Chapter-13 By default this script does nothing.
## Chapter-13 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
The main requirement is that the PC kernel version is 5.10+. This is a bug in the old QEMU. There are two main
solutions:
The kernel version that comes with the PC needs to meet the requirements of 5.10+.
Refer to qemu.
13.3.7 How to Decompress, Modify and Repackage the Debian deb Package
If you want to modify and repackage the original deb, the method is as follows:
When the system's physical memory is not enough, you can add Debian's swap virtual memory partition for use
by currently running programs. For example, create a 2G virtual memory
cd /opt
mkdir swap
dd if=/dev/zero of=swapfile bs=1024 count=2000000
## Chapter-13 count represents the size, it is 2G in this example
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
13.3.9 When Updating the Debian System for the First Time, It Will Restart the
Display Service.
In order to be compatible with different chips, general Debian will install various differential packages according
to the chip when /etc/init.d/[Link] is started for the first time, 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
handle this part of the difference.
EGL is an extension of OpenGL on the ARM platform for the x window system. 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 that detect the glx environment to fail to start), [Link] will search for the dri implementation
library in the system. However, Xorg 2D acceleration is implemented directly based on DRM and does not
implement the dri library, so during the booting process, [Link] will report the following error.
Based on the same reason, the following errors will be reported during the startup process of some applications,
which do not need to be processed and will not affect the operation of the application.
13.3.11 How to Confirm that the Hardware Mouse Layer is Working in Debian
If there are still problems after steps 1/2, check /var/log/[Link] to see if there are any abnormalities.
13.4.1 Video Playback Freezes and Frame Drop Errors Appear in the log. How to Fix
the Issue?
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
13.4.3 The Playback Screen Jitters after Turning on AFBC, How to Fix the Issue?
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.
13.4.6 If the Screen Jitters or Ripples Appear during Playback, How to Fix the Issue?
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)
13.5.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.
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.
There are interface of drm to query the type of plane. For details, please refer to kmssink method of gstreamer.
13.6.2 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/cn/Linux/*/Rockchip_Developer_Guide_Buildroot_Weston_CN.pdf 2.9 Multi-screen
configuration for details.
13.6.3 What is the Debian Xserver Version?
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
~$ 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.
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.
14.4 Reference Documents