赞
踩
以下都是为了实现这个场景。
我的RV1126的SDK上面有两个交叉编译器
sdk/prebuilts/gcc/linux-x86/arm/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf
是用于编译上层应用的
sdk/prebuilts/gcc/linux-x86/arm/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf
是用于编译uboot和linux kernel的
需要的路径信息:
/home/liefyuan/rv1126/rp_rv1126_sdk/prebuilts/gcc/linux-x86/arm/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
/home/liefyuan/rv1126/rp_rv1126_sdk/prebuilts/gcc/linux-x86/arm/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++
sdk/buildroot/output/rockchip_rv1126_rv1109_facial_gate/host/bin/qmake
Buildroot 系统默认是支持 ssh 的,用户名是 root,密码是 rockchip。
首先对开发板进行上电,开发板正常启动后,使用命令“vi /etc/inittab”对文件进行修改,如下图所示:
# Startup the system ::sysinit:/bin/mount -t proc proc /proc ::sysinit:/bin/mount -o remount,rw / ::sysinit:/bin/mkdir -p /dev/pts ::sysinit:/bin/mkdir -p /dev/shm ::sysinit:/bin/mount -a 2>/dev/null ::sysinit:/bin/hostname -F /etc/hostname # now run any rc scripts #::respawn:-/bin/sh ::sysinit:/etc/init.d/rcS # Put a getty on the serial port ttyFIQ0::respawn:/sbin/getty -L ttyFIQ0 0 vt100 # GENERIC_SERIAL # Stuff to do for the 3-finger salute #::ctrlaltdel:/sbin/reboot # Stuff to do before rebooting ::shutdown:/etc/init.d/rcK ::shutdown:/sbin/swapoff -a ::shutdown:/bin/umount -a -r
root
rockchip
插上网线,编辑文件vi /etc/init.d/rcS
最后一行添加
udhcpc -i eth0
这样就可以使用DHCP动态分配IP地址了。
使用命令ifconfig
查看以确保与虚拟机ubuntu在同一个网段。
编译的时候出错了!
2023-04-21T01:05:46 gzip: /home/liefyuan/rv1126/rp_rv1126_sdk/buildroot/dl/popt-1.16.tar.gz: not in gzip format 2023-04-21T01:05:46 tar: This does not look like a tar archive 2023-04-21T01:05:46 tar: Exiting with failure status due to previous errors 2023-04-21T01:05:46 package/pkg-generic.mk:159: recipe for target '/home/liefyuan/rv1126/rp_rv1126_sdk/buildroot/output/rockchip_rv1126_rv1109_facial_gate/build/popt-1.16/.stamp_extracted' failed 2023-04-21T01:05:46 make[1]: *** [/home/liefyuan/rv1126/rp_rv1126_sdk/buildroot/output/rockchip_rv1126_rv1109_facial_gate/build/popt-1.16/.stamp_extracted] Error 2 2023-04-21T01:05:46 /home/liefyuan/rv1126/rp_rv1126_sdk/buildroot/output/rockchip_rv1126_rv1109_facial_gate/Makefile:16: recipe for target '_all' failed 2023-04-21T01:05:46 make: *** [_all] Error 2 2023-04-21T22:17:47 umask 0022 && make -C /home/liefyuan/rv1126/rp_rv1126_sdk/buildroot O=/home/liefyuan/rv1126/rp_rv1126_sdk/buildroot/output/rockchip_rv1126_rv1109_facial_gate 2023-04-21T22:17:53 /usr/bin/make -j1 O=/home/liefyuan/rv1126/rp_rv1126_sdk/buildroot/output/rockchip_rv1126_rv1109_facial_gate HOSTCC="/usr/bin/gcc" HOSTCXX="/usr/bin/g++" silentoldconfig 2023-04-21T22:17:53 GEN /home/liefyuan/rv1126/rp_rv1126_sdk/buildroot/output/rockchip_rv1126_rv1109_facial_gate/Makefile 2023-04-21T22:17:53 >>> popt 1.16 Extracting 2023-04-21T22:17:53 gzip -d -c /home/liefyuan/rv1126/rp_rv1126_sdk/buildroot/dl/popt-1.16.tar.gz | tar --strip-components=1 -C /home/liefyuan/rv1126/rp_rv1126_sdk/buildroot/output/rockchip_rv1126_rv1109_facial_gate/build/popt-1.16 -xf - 2023-04-21T22:17:53 2023-04-21T22:17:53 gzip: /home/liefyuan/rv1126/rp_rv1126_sdk/buildroot/dl/popt-1.16.tar.gz: not in gzip format 2023-04-21T22:17:53 tar: This does not look like a tar archive 2023-04-21T22:17:53 tar: Exiting with failure status due to previous errors 2023-04-21T22:17:53 package/pkg-generic.mk:159: recipe for target '/home/liefyuan/rv1126/rp_rv1126_sdk/buildroot/output/rockchip_rv1126_rv1109_facial_gate/build/popt-1.16/.stamp_extracted' failed 2023-04-21T22:17:53 make[1]: *** [/home/liefyuan/rv1126/rp_rv1126_sdk/buildroot/output/rockchip_rv1126_rv1109_facial_gate/build/popt-1.16/.stamp_extracted] Error 2 2023-04-21T22:17:53 /home/liefyuan/rv1126/rp_rv1126_sdk/buildroot/output/rockchip_rv1126_rv1109_facial_gate/Makefile:16: recipe for target '_all' failed 2023-04-21T22:17:53 make: *** [_all] Error 2 Command exited with non-zero status 1 you take 0:10.18 to build builroot ERROR: Running build_buildroot failed! ERROR: exit code 1 from line 557: /usr/bin/time -f "you take %E to build builroot" $COMMON_DIR/mk-buildroot.sh $BOARD_CONFIG
通过查看这个文件是有问题的,popt-1.16.tar.gz格式都不对!
~/rv1126/rp_rv1126_sdk/buildroot/dl$ file popt-1.16.tar.gz
popt-1.16.tar.gz: HTML document, UTF-8 Unicode text, with very long lines
文件系统里面的文件是错误的,需要替换下载地址:
把这个地址替换进去:http://ftp.rpm.org/popt/releases/historical/popt-1.16.tar.gz
替换:buildroot/package/popt/popt.mk文件里面的下载地址!
如下:
################################################################################ # # popt # ################################################################################ POPT_VERSION = 1.16 POPT_SITE = http://ftp.rpm.org/popt/releases/historical/popt-1.16.tar.gz POPT_INSTALL_STAGING = YES POPT_LICENSE = MIT POPT_LICENSE_FILES = COPYING POPT_AUTORECONF = YES POPT_GETTEXTIZE = YES POPT_DEPENDENCIES = $(TARGET_NLS_DEPENDENCIES) POPT_CONF_ENV = ac_cv_va_copy=yes ifeq ($(BR2_PACKAGE_LIBICONV),y) POPT_CONF_ENV += am_cv_lib_iconv=yes POPT_CONF_OPTS += --with-libiconv-prefix=$(STAGING_DIR)/usr POPT_DEPENDENCIES += libiconv endif $(eval $(autotools-package)) $(eval $(host-autotools-package))
在地址:http://ftp.rpm.org/popt/releases/historical/
下载源文件
为了快速,直接下载源文件拷贝到sdk/buildroot/dl
目录下
$ cp popt-1.16.tar.gz ./buildroot/dl/
安装好rsync的文件系统可以在命令行里这样:
[root@RV1126_RV1109:/]# rsync
rsync version 3.1.3 protocol version 31
Copyright (C) 1996-2018 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
Capabilities:
64-bit files, 64-bit inums, 32-bit timestamps, 64-bit long ints,
no socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
append, no ACLs, xattrs, iconv, symtimes, prealloc
rsync comes with ABSOLUTELY NO WARRANTY. This is free software, and you
are welcome to redistribute it under certain conditions. See the GNU
General Public Licence for details.
打开 Ubuntu 的 Qtcreator,依次点击“工具”,“选项”,如下图所示:
在弹出的对话框中依次点击“kits”,“编译器”,“添加”,“GCC”,“C++”,如下图所示:
在弹出的界面中依次填写名称,编译器路径,编译器路径为 Buildroot 交叉编译器路径,点击“浏览”,根据实际情况填写“/home/liefyuan/rv1126/rp_rv1126_sdk/prebuilts/gcc/linux-x86/arm/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc”,填写完后点击“apply”,如下图所示
然后点击“添加”,“GCC”,“ C”,依照上面添加gcc的步骤添加 g++ 的交叉编译工具。
最后结果如下:
qmake工具地址是:/home/liefyuan/rv1126/rp_rv1126_sdk/buildroot/output/rockchip_rv1126_rv1109_facial_gate/host/bin/qmake
打开工具栏Tools里面的Options,如下图:
点击Devices添加设备,如下图:
点击选择Generic Linux Device然后点击start Wizard按钮,如下图:
下一个界面填下如下信息:
创建私钥秘钥然后部署,地址一般默认是:/home/liefyuan/.ssh/
点击Create New Key Pair按钮来创建私钥公钥
选择如下图配置:
生成以后,点击Deplay Public Key按钮进行部署公钥。
这时候弹出对话框,输入开发板的用户密码:rockchip
部署完成如下:
还可以点击Test进行测试
最后记得点击Apply按钮进行保存设置。
最后在Kits里面,根据下图选择好运行的设备。
打开要编译的 QT 代码的 pro 文件,在里面添加以下代码,这俩行代码的意思是说把编译的可执行程序下载到开发板的/opt 目录下并执行。
target.path=/opt
INSTALLS+=target
否则在部署的时候可能会出现
21:53:56: Starting ...
21:53:56: Cannot run: No command given.
运行左下角的点击:
然后开发板上就运行起来了。
在目录:/home/liefyuan/.ssh/
如果在私钥、公钥配置好的情况下有三个文件:
配置设备失败,可以删除qtc_id和qtc_id.pub文件,清空known_hosts文件里面的内容。
然后重新生成秘钥私钥,配置ssh。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。