【RV1126 学习】SDK/ U-Boot/kernel/rootfs 编译学习

RV1126芯片介绍

RV1126 是 Rockchip 推出的一款编解码芯片,CPU 为 4 核 ARM Cortex-A7 32 位,专用于面向人工智能的机械视觉领域,支持 4K 编解码,支持 8 路 1080P 同时进行编解码,内置 2.0TOPS的 NPU。像这种专用芯片,芯片厂商都会给出芯片的 SDK 包进行二次开发,用它来开发有很多好处,比如:不用安装一下特殊的软件和库,自带交叉工具链、文件系统和第三方库,可以直接编译出系统镜像,开发环境搭建比较容易等等。但是开发自由度不够高,更新软件版本很麻烦,代码里有很多私货(芯片厂商自己定义的代码)等等
在这里插入图片描述

在这里插入图片描述

⚫ app : 存放上层应用程序的目录。
⚫ buildroot :SDK 包使用的文件系统为 buildroot。
⚫ build.sh :编译用的脚本,使用方法后面会教。
⚫ device/rockchip :存放每个平台的一些编译和打包固件的脚步和预备文件。
⚫ docs :存放 RK 开发指导文件、平台支持列表、工具使用文档、Linux 开发指南等。
⚫ envsetup.sh :要修改文件系统时候要设置的环境脚本。
⚫ external : 存放相关的库,包括音频,视频等。
⚫ kernel :kernel 源码。
⚫ makefile :整个 SDK 包编译的 Makefile。
⚫ mkfirmware.sh :固件打包使用的脚本,默认在当前路径下的 rockdev 目录。
⚫ prebuilts : 存放交叉编译工具链。
⚫ rkbin: 存放固件和工具。
⚫ rkflash.sh : linux 下的系统烧录脚本。
⚫ tools :存放固件和工具的目录。
⚫ u-boot :U-boot 源码目录。
⚫ rockdev:存放编译输出固件的目录(整个 SDK 包编译完成后就会创建

rv1126 模块代码目录相关说明

什么叫做模块代码?一个完整的 SDK 包除了 kernel、u-boot、buildroot 之外,还需要提供上层的第三方库和 APP,第三方库和 APP 合起来叫做模块代码。

SDK 包下的脚本使用

build.sh 脚本使用

查看 build.sh 使用帮助

morgan@morgan-machine:~/Work/rv1126$ ./build.sh lunch -h
Usage: build.sh [OPTIONS]
Available options:
BoardConfig*.mk    -switch to specified board config
lunch              -list current SDK boards and switch to specified board config
uboot              -build uboot
spl                -build spl
loader             -build loader
kernel             -build kernel
modules            -build kernel modules
toolchain          -build toolchain
rootfs             -build default rootfs, currently build buildroot as default
buildroot          -build buildroot rootfs
ramboot            -build ramboot image
multi-npu_boot     -build boot image for multi-npu board
yocto              -build yocto rootfs
debian             -build debian10 buster/x11 rootfs
distro             -build debian10 buster/wayland rootfs
pcba               -build pcba
recovery           -build recovery
all                -build uboot, kernel, rootfs, recovery image
cleanall           -clean uboot, kernel, rootfs, recovery
firmware           -pack all the image we need to boot up system
updateimg          -pack update image
otapackage         -pack ab update otapackage image (update_ota.img)
sdpackage          -pack update sdcard package image (update_sdcard.img)
save               -save images, patches, commands used to debug
allsave            -build all & firmware & updateimg & save
check              -check the environment of building
info               -see the current board building information
app/<pkg>          -build packages in the dir of app/*
external/<pkg>     -build packages in the dir of external/*

实际编译测试使用耗时

morgan@morgan-machine:~/Work/rv1126$ time ./build.sh
processing board option: allsave
processing option: allsave
.....
vccio7-supply 
regulator-min-microvolt =  1800mV
regulator-max-microvolt =  1800mV
Running build_allsave succeeded.

real	116m26.217s
user	244m36.079s
sys		41m30.641s

envsetup.sh 脚本使用

envsetup.sh 脚本主要的作用是,使能 buildroot 的配置文件。在 RV1126 这个芯片里,一共可以选择的配置文件有 3 种分别为:文件系统的配置文件,recovery 分区的配置文件(此分区主要是用作升级和复原的文件系统,它也是一个文件系统)和 libs 的配置文件(生成一些库,方便
我们写应用层代码做测试,导出文件系统的库文件)。

mkfirmware.sh 脚本使用

mkfirmware.sh 脚本主要的作用是,把 uboot、kernel、文件系统等等进行打包和生成镜像。

rkflash.sh 脚本使用

rkflash.sh 脚本主要的作用是,在 linux 系统下进行固件的烧录

U-Boot 编译和配置

RK 官方提供了很方便的编译方法,直接运行以下./build.sh uboot 命令可以编译 uboot。

morgan@
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值