飞凌嵌入式
直播中

华仔stm32

3年用户 2960经验值
擅长:嵌入式技术
私信 关注
[技术]

【飞凌RK3568开发板试用体验】编译ForlinxDesktop镜像

1、下载镜像,百度网盘地址:下载链接:https://pan.baidu.com/s/1DclTp0drvzRI78qhl1aVDQ 提取码: 3tra

2、下载完成后打开\OK3568-C_Forlinx Desktop 20.04_用户资料-20220721\手册 下面的《OK3568-C_Forlinx Desktop 20.04_用户编译手册_V1.0 20220721.pdf》,并认真阅读。

3、按照提示安装好虚拟机。这里特别提醒一下,内存最好设置8G,要不编译时,内存不够就会往写到磁盘里,这样速度就会慢。

4、按照3.1.6安装基本库:

forlinx@ubuntu:~$ sudo apt-get update //更新下载源信息

forlinx@ubuntu:~$ sudo apt-get install build-essential //提供编译程序必须软件包的列表信息

forlinx@ubuntu:~$ sudo apt-get install libncurses* //用于生成基于文本的用户界面

forlinx@ubuntu:~$ sudo apt-get install lzop //基于 Lzo 库的压缩解压工具

forlinx@ubuntu:~$ sudo apt-get install net-tools //网络配置工具

forlinx@ubuntu:~$ sudo apt-get update //更新 apt-get 下

载源

forlinx@ubuntu:~$ sudo apt-get install openssh-server vim git fakeroot //必备工具包的

安装

forlinx@ubuntu:~$ sudo apt-get install repo git ssh make gcc libssl-dev liblz4-tool expect 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 python-pip libncurses5-dev

拷贝源码

程序源码:用户资料\Linux\源码\OK3568-linux-source.tar.bz2,有三个文件,需要一起拷过去:

image.png

创建工作目录:

lugl@lugl-virtual-machine:~$ sudo mkdir -p /forlinx/3568

利用ftp工具把文件拷到虚拟机

image.png

进入到目录3568:

/forlinx/3568$ cat OK3568-linux-source.tar.bz2.a* > OK3568-linux-source.tar.bz2

tar -xvf OK3568-linux-source.tar.bz2

解压出来后删除原来的压缩包,太占工空间了:

lugl@lugl-virtual-machine:~/forlinx/3568$ ls
OK3568-linux-source

进入解压出来的目录:

lugl@lugl-virtual-machine:~/forlinx/3568/OK3568-linux-source$ ls
app        debian  envsetup.sh  Makefile       rkbin       u-boot
buildroot  device  external     mkfirmware.sh  rkflash.sh  ubuntu-20.04-release
build.sh   docs    kernel       prebuilts      tools       yocto

执行编译命./build.sh 对话框输入选择1:

lugl@lugl-virtual-machine:~/forlinx/3568/OK3568-linux-source$ ./build.sh 

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

0. default BoardConfig.mk
1. BoardConfig-ok3568.mk
Which would you like? [0]:1

CPU、内存立马上来了,编译就是吃硬件资源呀,如果你想编译顺利,切记硬盘要留出100G以上的空间,内存留出8G左右的空间,要不会报莫名其妙的错误。

image.png

编译一段时间后会弹出下图界面,需要选择,提取图中信息,VCCIO4 和 VCCIO6 选择 1800000 其余的选择 3300000,使用上下方向按键选择选项,按回车确认选择即可。(不要选错,选错就会报错,停止)

image.png

编译完后会弹出如下:

image.png

接下来出现了报错:

make: Entering directory '/home/lugl/forlinx/3568/OK3568-linux-source/buildroot'
make[1]: *** No rule to make target '/home/lugl/forlinx/3568/OK3568-linux-source/buildroot/output/OK3568/.br-external.mk'.  Stop.
make: *** [Makefile:83: _all] Error 2
make: Leaving directory '/home/lugl/forlinx/3568/OK3568-linux-source/buildroot'
cp: cannot stat '/home/lugl/forlinx/3568/OK3568-linux-source/buildroot/output/OK3568/.config': No such file or directory
Done in 1s  (error code: 2)
log saved on /home/lugl/forlinx/3568/OK3568-linux-source/br.log
2022-11-27T22:42:57 Makefile:7: /home/lugl/forlinx/3568/OK3568-linux-source/buildroot/output/OK3568/Makefile: No such file or directory
2022-11-27T22:42:57 make: *** No rule to make target '/home/lugl/forlinx/3568/OK3568-linux-source/buildroot/output/OK3568/Makefile'.  Stop.
Command exited with non-zero status 1
you take 0:00.13 to build builroot
ERROR: Running build_buildroot failed!
ERROR: exit code 1 from line 563:
    /usr/bin/time -f "you take %E to build builroot" $COMMON_DIR/mk-buildroot.sh $BOARD_CONFIG

然后再编译就是通不过了:

ugl@lugl-virtual-machine:~/forlinx/3568/OK3568-linux-source$ ./build.sh
processing option: allsave
============================================
TARGET_ARCH=arm64
TARGET_PLATFORM=ok3568
TARGET_UBOOT_CONFIG=OK3568-C
TARGET_SPL_CONFIG=
TARGET_KERNEL_CONFIG=OK3568-C-linux_defconfig
TARGET_KERNEL_DTS=OK3568-C-linux
TARGET_TOOLCHAIN_CONFIG=
TARGET_BUILDROOT_CONFIG=OK3568
TARGET_RECOVERY_CONFIG=OK3568-recovery
TARGET_PCBA_CONFIG=
TARGET_RAMBOOT_CONFIG=
============================================
============Start building uboot============
TARGET_UBOOT_CONFIG=OK3568-C
=========================================
## make OK3568-C_defconfig -j16
#
# configuration written to .config
#
/home/lugl/forlinx/3568/OK3568-linux-source/prebuilts/gcc/linux-x86/aarch64/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc
scripts/kconfig/conf  --silentoldconfig Kconfig

*** Error during update of the configuration.

make[2]: *** [scripts/kconfig/Makefile:48:silentoldconfig] 错误 1
make[1]: *** [Makefile:479:silentoldconfig] 错误 2
make: *** No rule to make target 'include/config/auto.conf', needed by 'include/config/uboot.release'.  Stop.
ERROR: Running build_uboot failed!
ERROR: exit code 2 from line 458:
    ./make.sh $RK_UBOOT_DEFCONFIG $UBOOT_COMPILE_COMMANDS

【是不是我用的是ubuntu22.04】环境不对。。。

没办法先去下载一下飞凌提供的环境:百度网盘 (baidu.com)提取码:c2hv

烧硬盘呀。。。

换了飞凌的虚拟机,继续编译:

image.png

昨晚太晚了,让主机在自己编译,早上起来报错如下:

[17/3837] CXX obj/content/browser/browser/network_handler.o
2022-11-27T14:50:45 ninja: build stopped: subcommand failed.
2022-11-27T14:50:46 Makefile.gn_run:398: recipe for target 'run_ninja' failed
2022-11-27T14:50:46 make[5]: *** [run_ninja] Error 1
2022-11-27T14:50:46 Makefile:82: recipe for target 'sub-gn_run-pro-make_first' failed
2022-11-27T14:50:46 make[4]: *** [sub-gn_run-pro-make_first] Error 2
2022-11-27T14:50:46 Makefile:76: recipe for target 'sub-core-make_first' failed
2022-11-27T14:50:46 make[3]: *** [sub-core-make_first] Error 2
2022-11-27T14:50:47 Makefile:48: recipe for target 'sub-src-make_first' failed
2022-11-27T14:50:47 make[2]: *** [sub-src-make_first] Error 2
2022-11-27T14:50:47 package/pkg-generic.mk:228: recipe for target '/home/forlinx/3568/OK3568-linux-source/buildroot/output/OK3568/build/qt5webengine-5.14.2/.stamp_built' failed
2022-11-27T14:50:47 make[1]: *** [/home/forlinx/3568/OK3568-linux-source/buildroot/output/OK3568/build/qt5webengine-5.14.2/.stamp_built] Error 2
2022-11-27T14:50:50 /home/forlinx/3568/OK3568-linux-source/buildroot/output/OK3568/Makefile:16: recipe for target '_all' failed
2022-11-27T14:50:50 make: *** [_all] Error 2
Command exited with non-zero status 1
you take 1:55.38 to build builroot
ERROR: Running build_buildroot failed!
ERROR: exit code 1 from line 563:
    /usr/bin/time -f "you take %E to build builroot" $COMMON_DIR/mk-buildroot.sh $BOARD_CONFIG

搜了一下错误 :

2022-11-27T14:50:45 ninja: build stopped: subcommand failed.
2022-11-27T14:50:46 Makefile.gn_run:398: recipe for target 'run_ninja' failed

查找了一下错误,说是由于服务器进程打开文件数受限制。

1.vim /etc/security/limits.conf 添加如下的行

image.png

2.保存后,再输入ulimit -n 10240回车即可生效。

3、提示 ulimit 命令 执行:

sudo sh -c "ulimit -n 65535 && exec su $LOGNAME"

还是继续报错:

2022-11-27T15:53:44 aarch64-buildroot-linux-gnu-g++.br_real: fatal error: Killed signal terminated program cc1plus
2022-11-27T15:53:44 compilation terminated.
[12/3698] CXX obj/content/browser/browser/navigation_request.o
2022-11-27T15:53:57 ninja: build stopped: subcommand failed.
2022-11-27T15:54:00 Makefile.gn_run:398: recipe for target 'run_ninja' failed
2022-11-27T15:54:00 make[5]: *** [run_ninja] Error 1
2022-11-27T15:54:00 Makefile:82: recipe for target 'sub-gn_run-pro-make_first' failed
2022-11-27T15:54:00 make[4]: *** [sub-gn_run-pro-make_first] Error 2
2022-11-27T15:54:00 Makefile:76: recipe for target 'sub-core-make_first' failed
2022-11-27T15:54:00 make[3]: *** [sub-core-make_first] Error 2
2022-11-27T15:54:00 Makefile:48: recipe for target 'sub-src-make_first' failed
2022-11-27T15:54:00 make[2]: *** [sub-src-make_first] Error 2
2022-11-27T15:54:00 package/pkg-generic.mk:228: recipe for target '/home/forlinx/3568/OK3568-linux-source/buildroot/output/OK3568/build/qt5webengine-5.14.2/.stamp_built' failed
2022-11-27T15:54:00 make[1]: *** [/home/forlinx/3568/OK3568-linux-source/buildroot/output/OK3568/build/qt5webengine-5.14.2/.stamp_built] Error 2
2022-11-27T15:54:04 /home/forlinx/3568/OK3568-linux-source/buildroot/output/OK3568/Makefile:16: recipe for target '_all' failed
2022-11-27T15:54:04 make: *** [_all] Error 2
Command exited with non-zero status 1
you take 1:41.27 to build builroot
ERROR: Running build_buildroot failed!
ERROR: exit code 1 from line 563:
    /usr/bin/time -f "you take %E to build builroot" $COMMON_DIR/mk-buildroot.sh $BOARD_CONFIG

后面发现内存不足引起的错误,后面加了内存到32G终于编译成功了:
adfc1be3a90de7095d827d6ad81b932.png

image.png

然后把生成的update.img下载到开发板,编译的工作就基本结束了。

d2126e5a0d6cac1dbab5cab2a43c6ce.jpg

【总结】全源码编译,第一需要耐心,第二生产力的电脑要给力。3、需要看错误提示,主要是工具包有些没有安装。

开机展示forlinx_desktop

更多回帖

发帖
×
20
完善资料,
赚取积分