rv1126 SDK编译【2020-0912版本SDK包】

一、原材料说明

rv1126_1109.tar.gz,购买自某宝,版本为2020-0912版本。其他版本sdk包可能会遇到不同的问题,以下记录仅供参考。
2020-0912版本,rkmedia库好像没有完成类海思接口封装,至少VO部分还没有封装。
另外,在此鄙视一下某宝rk sdk包商家。海思sdk购买后,免费更新,rk却每个新版本都要重新购买。
备注:后续重新购买了2020-1212版本的SDK包,编译除了下面说的找不到3个库(错误三)外,没有其他问题。


二、编译步骤

1. 解压压缩包

user@PC:~/work/sdk/rv1126$ tar xzf rv1126_1109.tar.gz -C ~/work/sdk/rv1126
user@PC:~/work/sdk/rv1126$ ls
CBuild  Makefile  app  build.sh  buildroot  device  docs  envsetup.sh  external  kernel  mkfirmware.sh  prebuilts  rkbin  rkflash.sh  rockdev  tools  u-boot

docs目录下有相关说明文档,docs\doc.txtdocs\docs_list.txt2个文档说明了docs目录结构,可以参考、查阅相关手册。
可以执行./build.sh --help查看帮助说明:

user@PC:~/work/sdk/rv1126$ ./build.sh --help
Usage: build.sh [OPTIONS]
Available options:
BoardConfig*.mk    -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 debian9 stretch rootfs
distro             -build debian10 buster 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
save               -save images, patches, commands used to debug
allsave            -build all & firmware & updateimg & save

Default option is 'allsave'.

2. 编译uboot、内核

这部分按说明文档编译,没有遇到问题。
编译u-boot:./build.sh uboot
编译内核:./build.sh kernel


3. 编译rootfs

a. 选择目标单板,输入对应编号:
user@PC:~/work/sdk/rv1126$ ./envsetup.sh 
This script is executed directly...
Top of tree: /home/user/work/sdk/rv1126

You're building on Linux
Lunch menu...pick a combo:

0. non-rockchip boards
1. rockchip_px30_32
2. rockchip_px30_64
3. rockchip_px30_64_opensource
......
64. rockchip_rv1126_robot
65. rockchip_rv1126_robot_recovery
66. rockchip_rv1126_rv1109
67. rockchip_rv1126_rv1109_facial_gate
68. rockchip_rv1126_rv1109_libs
69. rockchip_rv1126_rv1109_ramboot_uvcc
70. rockchip_rv1126_rv1109_recovery
71. rockchip_rv1126_rv1109_sl
72. rockchip_rv1126_rv1109_spi_nand
73. rockchip_rv1126_rv1109_systemd
74. rockchip_rv1126_rv1109_tb
75. rockchip_rv1126_rv1109_tinyrootfs
76. rockchip_rv1126_rv1109_toolchain
77. rockchip_rv1126_rv1109_uvcc
Which would you like? [0]: 67
b. 编译:
user@PC:~/work/sdk/rv1126$ ./build.sh rootfs
processing board option: rootfs
processing option: rootfs
==========Start build buildroot==========
TARGET_BUILDROOT_CONFIG=rockchip_rv1126_rv1109
=========================================
Top of tree: /home/user/work/sdk/rv1126
===========================================

#TARGET_BOARD=rv1126
#OUTPUT_DIR=output/rockchip_rv1126_rv1109
#CONFIG=rockchip_rv1126_rv1109_defconfig

===========================================
make: Entering directory '/home/user/work/sdk/rv1126/buildroot'

错误一:

错误:

2020-12-08T20:10:30 umask 0022 && make -C /home/user/work/sdk/rv1126/buildroot O=/home/user/work/sdk/rv1126/buildroot/output/rockchip_rv1126_rv1109
2020-12-08T20:10:46 
2020-12-08T20:10:46 You seem to have the current working directory in your
2020-12-08T20:10:46 LD_LIBRARY_PATH environment variable. This doesn't work.
2020-12-08T20:10:46 make[1]: *** [support/dependencies/dependencies.mk:25: core-dependencies] Error 1
2020-12-08T20:10:47 make: *** [/home/user/work/sdk/rv1126/buildroot/output/rockchip_rv1126_rv1109/Makefile:16: _all] Error 2
Command exited with non-zero status 1
you take 0:18.89 to build builroot
====Build buildroot failed!====

解决:
需要先清空系统环境变量中的LD_LIBRARY_PATHexport LD_LIBRARY_PATH=


错误二:

错误:

2020-12-08T18:42:19 CMake Error at rkisp_api/CMakeLists.txt:12 (PROJECT):
2020-12-08T18:42:19 The CMAKE_CXX_COMPILER:
2020-12-08T18:42:19 
2020-12-08T18:42:19 /home/ubuntu/Develop/rockchip/rv1109/external/camera_engine_rkaiq/../../prebuilts/gcc/linux-x86/arm/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++

解决:
买的sdk包中,external/camera_engine_rkaiq/目录下cmake配置的交叉编译工具目录错误,用指令进行替换``:

sed -i "s/\/home\/ubuntu\/Develop\/rockchip\/rv1109/\/home\/user\/work\/sdk\/rv1126/g" `grep "/home/ubuntu/Develop/rockchip/rv1109" -rl ./`
sed -i "s/原字符串/新字符串/g" `grep 原字符串 -rl 所在目录`

错误三:

错误:
编译camera_engine_rkaiq,最后链接生成动态库时,提示缺少下面3个库:

/lib/libc.so.6
/lib/ld-linux-armhf.so.3
/usr/lib/ibc_nonshared.a

解决:
检查external/camera_engine_rkaiq/目录下CMakeLists.txt,好像没有找到sysroot设置错误,这个问题没发现最终原因。解决办法是在PC的Linux系统的对应目录里,建了3个软链接,链接到交叉编译工具目录下这3个库文件。


错误四:

错误及解决:
编译libIPCProtocol编译问题。
购买的这个sdk包,开始提示dbus.c中的dbus_signal_func_t没有定义。如果这时修改app/libIPCProtocol/dbus.c文件,增加头文件包含"#include dbus_signal.h",然后删除buildroot/output/rockchip_rv1126_rv1109/build/lib IPCProtocol目录,重新执行:

user@PC:~/work/sdk/rv1126$ .export LD_LIBRARY_PATH=
user@PC:~/work/sdk/rv1126$ ./build.sh rootfs

这时dbus_signal_func_t没有定义的问题解决了,但编译到最后链接时,会提示很多函数重复定义了,仔细看是dbus.cdbus_signal.c两个文件实现了两套同样接口的函数。暂时解决是直接删除了dbus.cdbus.h,然后再次删除buildroot/output/rockchip_rv1126_rv1109/build/libIPCProtocol目录,重新编译。

你可能感兴趣的:(rockchip)