This paper is based on the HD-RK3568-IoT evaluation board.
Create a rk356x-amp-sdk directory in the virtual machine, and then run commands in this directory to run the **amp SDK in the rockchip git repository.
At present, a total of 4 modes of 1Linux+3HAL, 1Linux+3RTT, 3Linux+1HAL, and 3Linux+1RTT have been verified on the RK3568. The four modes are modified on the basis of the original SDK, and then different patches are generated for the modifications, and users can add different patches according to their own needs
After patching, use it directly in the SDK directory. /build.The SH command compiles the SDK, and after the compilation is successful, burn the generated img file to the board, and you can see the Linux kernel and HAL or RTT related prints on UART2 & UART4 respectively.
Figure 21 amp 1linux+3rtt rtt serial port printing.
Figure 22 amp 1linux+3rtt linux serial port printing.
Figure 23 amp 1linux+3hal linux serial printing.
Figure 24 amp 1linux+3hal hal serial port printing.
Figure 25 3linux+rtt linux serial port printing.
Figure 26 3Linux+1RTT RTT serial port printing.
Figure 27 3linux+1hal linux serial port printing.
Figure 28 3linux+1hal hal serial port printing.
Compile the HAL firmware under the HAL Project RK3568 GCC path, and the HAL compilation command is as follows:
cdhal/project/rk3568/gcc
build.shcpu_id
After the compilation is complete, generate hal0. in the HAL Project rk3568 gcc directorybin、hal1.bin、hal2.bin、hal3.bin。
Compile the 32-bit RT-Thread firmware in the RT-Thread BSP Rockchip RK3568-32 path. The CPU running the firmware can be configured via menuconfig.
Set rt run mem base to specify, the default configuration is as follows, running on cpu0, please modify it according to the actual situation of the project
rt-thread/bsp/rockchip/rk3568-32/rtconfig.h
#definert_run_mem_base 0x12000000
After the compilation is complete, generate the firmware rtthread in the rt-thread bsp rockchip rk3568-32 directorybin。
The kernel compilation command is as follows:
cdkernel
makearch=arm64 rockchip_linux_defconfig
makearch=arm64 rk3568-evb1-ddr4-v10-linux-amp.img -j16
After the compilation is complete, boot. will be generated in the kernel directoryimg
Modify the config file configs rk3568 defconfig in the uboot project, add the configuration to enable the amp function, and use the following command to compile after the amp function is enabled:
cd u-boot
make.sh rk3568
After the compilation is completed, the rk356x spl loader***bin and uboot. will be generated in the u-boot directoryimg。
Taking RK3568 as an example, modify the ITS file used for AMP packaging in the HAL project, and there is AMP Linux in the Project RK3568 Image pathits and ampIt is recommended to use AMP LinuxITS configuration. Each CPU can be individually configured with parameters such as the loaded firmware, architecture, instruction set, running address, and startup delay.
The RK3568 supports the AMP hybrid architecture design of Linux + HAL, which enables different CPUs to run different systems to meet flexible product design needs. The SDK currently supports the Linux + HAL + HAL + HAL hybrid structure model by default, where the CPU running Linux is the master core and the rest of the CPU running HAL are slave cores. The specific configuration is as follows:
The unified compilation and configuration script of the SDK is located in the device rockchip rk3568 directory, and the content of the compilation and configuration script includes the configuration of U-Boot, Kernel, HAL, RT-Thread, as well as AMP-related CPU allocation, memory allocation, and other configurations. Users can add or modify configuration script files according to their needs to meet their own compilation requirements. Currently, the following profiles are supported:
boardconfig-rk3568-evb1-ddr4-v10.The MK EVB development board corresponds to the configuration script.
parameter-rk3568-amp.The txt EVB board corresponds to the parameters file.
rk3568_amp.The configuration file corresponding to the cfg burning tool.
rk3568_amp_linux.its amp configuration file.
The unified compilation script tool supports one-click compilation and packaging of u-boot, kernel, hal, rt-thread, rootfs, etc., and generates corresponding image images. When compiling for the first time, you need to select a compilation configuration script, as follows:
user@host:~/root$./build.sh lunch
you're building on linux
lunchmenu...pick a combo:
0.default boardconfig.mk
1. boardconfig-rk3568-evb1-ddr4-v10.mk
whichwould you like? [0]: 1
After the configuration is complete, run the one-click compilation command, as follows:
user@host:~/root$./build.sh
The compilation result is located in the rockdev directory and is as follows.
rockdev/
amp.img amp image.
miniloaderall.bin #loader
parameter.txt partition table information.
rootfs.img root file system.
misc.img for recovery to save some upgrade information.
uboot.img u-boot image.
update.img full firmware image.
The unified compilation script tool can also support the compilation of all modules separately, such as u-boot, kernel, rt-thread, hal, etc., and the specific use can be viewed by the help command
user@host:~/root$./build.sh --help