2. 开发环境¶
2.1. 目的¶
此份文件说明Linux开发环境。Linux开发环境的搭建U-boot、Linux内核、根文件系统(rootfs)以及内核和根文件系统的烧写,以及创建网络开发环境和启动 Linux 开发。
本文档提供客户端可以快速搭建Linux环境,并将自行开发的应用程序移植到Linux操作系统上面。
2.2. 如何编译内核¶
在HOST端ubuntu环境要编译SDK,需要安装以下工具
请参阅CV184X SDK 编译使用手册 – Chapter 2 建构CVITEK软件编译环境
设定环境变量(以cv1842hp_wevb_0014a_spinor为例)
$ source build/envsetup_soc.sh
-------------------------------------------------------------------------------------------------------
Usage:
(1) menuconfig - Use menu to configure your board.
ex: $ menuconfig
(2) defconfig $CHIP_ARCH - List EVB boards($BOARD) by CHIP_ARCH.
** cv184x ** -> ['cv184x', 'cv1841c', 'cv1842cp', 'cv1842hp', 'cv1843hp']
ex: $ defconfig cv184x
(3) defconfig $BOARD - Choose EVB board settings.
ex: $ defconfig cv1842hp_wevb_0014a_spinor
ex: $ defconfig cv1842cp_wevb_0015a_spinand
选定EVB cv1842hp_wevb_0014a_spinor
$ defconfig cv1842hp_wevb_0014a_spinor
====== Environment Variables =======
PROJECT: cv1842hp_wevb_0014a_spinor, DDR_CFG=ddr3_2133_x16
CHIP_ARCH: CV184X, DEBUG=0
SDK VERSION: musl_arm, RPC=0
ATF options: ATF_KEY_SEL=default, BL32=1
Linux source folder:linux_5.10, Uboot source folder: u-boot-2021.10
ENABLE_DUAL_OS: y
CROSS_COMPILE_PREFIX: arm-none-linux-musleabihf-
ENABLE_BOOTLOGO: 0
Flash layout xml: build/boards/cv184x/cv1842hp_wevb_0014a_spinor/partition/partition_spinor.xml
Sensor tuning bin: cvsens_cv2003
Output path: install/soc_cv1842hp_wevb_0014a_spinor
编译linux kernel
$ build_kernel
Run build_kernel() function
......
[TARGET] kernel-dts
......
[TARGET] kernel-build
......
产生刻录档 boot.{spinor, spinand, emmc}
$ ls install/soc_cv1842hp_wevb_0014a_spinor/boot.spinor
install/soc_cv1842hp_wevb_0014a_spinor/boot.spinor