准备

虚拟机既能ping通开发板,又能ping通外网,还要能ping通Windows主机(如果你有上位机通信(tftp、vsftp、ssh)的需求)

VMware

添加网络适配器2用作桥接网卡,原有的网络适配器保持为NAT模式

img

打开虚拟网络编辑器,配置VMnet0为桥接模式,外部连接设置为Realtek PCIe GbE Family Controller

img

Ubuntu

虚拟机配置ip

1
sudo ifconfig ens37 192.168.137.33 netmask 255.255.255.0

其中ens33为NAT模式分配的网卡,它可以通过笔记本的无线网卡上网;ens37为桥接网卡,通过有线网卡跟开发板通信

img

Board

开发板端配置IP

1
ifconfig eth0 192.168.137.22 netmask 255.255.255.0

Windows

手动配置IP

img

连接

1)需要准备一些工具(交叉编译),gdb和gdbserver的移植可以参考文章

  • ssh:openssh或者dropbear,开发板端部署sshd、宿主机端部署ssh
  • sftp:一般跟ssh配套的,这个也放开发板端
  • arm-gdb:放在宿主机端
  • gdbserver:放在开发板端

2)在QtCreator添加Remote Device,保证ssh连接上

3)在Build & Run里边配置Kits

  • Device
  • Sysroot
  • Compiler
  • Debugger
  • Qt version

rk3399-kit配置参考

远程部署

cmake

cmake需要写一个部署文件:QtCreatorDeployment.txt,写法参考如下:

1
2
远程绝对路径
宿主文件路径:远程相对路径

添加开发板所需要的文件到/root目录(相对路径不填写就是放到默认的远程绝对路径下)

1
2
/root
/home/topeet/workspace/harvester/build/harvester:

添加文件到指定的目录下

1
2
3
/root
/home/topeet/workspace/harvester/build/harvester:
/home/topeet/workspace/harvester/simulator.sh:/can

qmake

qmake pro文件写法:local.path表示本地路径,target.path表示远程路径,通过addFiles的属性赋值添加要部署的目录或文件(file1、file2)

1
2
3
4
5
6
local.path = $$OUT_PWD
local.path ~= s/builds.*/
target.path = /root
addFiles.path = $$target.path
addFiles.files += file1
addFiles.files += file2

示例:部署app放到/root目录下

1
2
3
4
local.path = $$OUT_PWD
local.path ~= s/builds.*/
target.path = /root
INSTALLS += target

运行配置

部署配置

img

运行配置

img

运行环境变量配置,以wayland-egl为例

img

可以通过Batch Edit方式批量配置

1
2
QT_QPA_PLATFORM=wayland-egl
XDG_RUNTIME_DIR=/tmp/.xdg

© 2025 hywing 使用 Stellar 创建
总访问 113701 次 | 本页访问 326