“Buildroot 系统使用”的版本间的差异
Tangdapeng(讨论 | 贡献) |
Tangdapeng(讨论 | 贡献) |
||
第35行: | 第35行: | ||
<br /> | <br /> | ||
'''添加Qt Versions'''<br /> | '''添加Qt Versions'''<br /> | ||
− | Tools --> Options --> Build & Run --> Qt Versions --> Add | + | Tools --> Options --> Build & Run --> Qt Versions --> Add --> 选中qmake路径 --> Apply<br /> |
− | 选中qmake路径<br /> | ||
[[文件:Qt Versions.png]]<br /> | [[文件:Qt Versions.png]]<br /> | ||
+ | <br /> | ||
+ | <br /> | ||
'''添加Compilers'''<br /> | '''添加Compilers'''<br /> | ||
− | Tools --> Options --> Build & Run --> Compilers --> Add --> GCC<br /> | + | Tools --> Options --> Build & Run --> Compilers --> Add --> GCC -- 选中g++路径 --> Apply<br /> |
注意:选中g++路径,并修改ABI一栏明确指示平台架构为arm<br /> | 注意:选中g++路径,并修改ABI一栏明确指示平台架构为arm<br /> | ||
[[文件:Compilers.png]]<br /> | [[文件:Compilers.png]]<br /> | ||
+ | <br /> | ||
<br /> | <br /> | ||
'''添加Debuggers(可选项)'''<br /> | '''添加Debuggers(可选项)'''<br /> | ||
− | Tools --> Options --> Build & Run --> Debuggers --> Add --> | + | Tools --> Options --> Build & Run --> Debuggers --> Add --> 选中gdb路径 --> Apply<br /> |
[[文件:Debuggers.png]]<br /> | [[文件:Debuggers.png]]<br /> | ||
+ | <br /> | ||
<br /> | <br /> | ||
'''添加Devices(可选项)'''<br /> | '''添加Devices(可选项)'''<br /> | ||
第51行: | 第54行: | ||
[[文件:Devices.png]]<br /> | [[文件:Devices.png]]<br /> | ||
<br /> | <br /> | ||
− | 并点击"Test"测试设备联通 | + | 并点击"Test"测试设备联通'''<br /> |
− | [[文件: | + | [[文件:Device Test.png]]<br /> |
+ | <br /> | ||
<br /> | <br /> | ||
'''添加Kits'''<br /> | '''添加Kits'''<br /> | ||
− | Tools --> Options --> Build & Run --> Kits --> Qt Versions --> Add<br /> | + | Tools --> Options --> Build & Run --> Kits --> Qt Versions --> Add --> Apply<br /> |
[[文件:Kits.png]]<br /> | [[文件:Kits.png]]<br /> | ||
<br /> | <br /> | ||
− | '''打开 | + | <br /> |
+ | '''打开 hellowindow 工程并选择Kits'''<br /> | ||
Welcome --> Open Porject --> 选择工程路径 /home/lin/trash/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib/qt/examples/opengl/hellowindow/hellowindow.pro --> Configure Project<br /> | Welcome --> Open Porject --> 选择工程路径 /home/lin/trash/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib/qt/examples/opengl/hellowindow/hellowindow.pro --> Configure Project<br /> | ||
[[文件:Configure Project.png]]<br /> | [[文件:Configure Project.png]]<br /> | ||
<br /> | <br /> | ||
− | '''编译运行 | + | <br /> |
+ | '''编译运行 hellowindow'''<br /> | ||
Build --> Build Project "hellowindow" --> 重启qtcreator --> Build --> Run<br /> | Build --> Build Project "hellowindow" --> 重启qtcreator --> Build --> Run<br /> | ||
− | [[文件:Projects 1.png]]<br /> | + | [[文件:Projects 1.png|1560px]]<br /> |
+ | <br /> | ||
+ | [[文件:Projects 2.jpg|1560px]]<br /> | ||
<br /> | <br /> | ||
− | |||
<br /> | <br /> | ||
'''配置debug模式'''<br /> | '''配置debug模式'''<br /> | ||
Projects --> buildroot-kit --> Build<br /> | Projects --> buildroot-kit --> Build<br /> | ||
− | [[文件:Projects 3.png]]<br /> | + | 注意:找到 Build Steps --> qmake --> Details --> Additional arguments --> 添加 QMAKE_CXXFLAGS+=-g |
+ | [[文件:Projects 3.png|1560px]]<br /> | ||
<br /> | <br /> | ||
Projects --> buildroot-kit --> Run<br /> | Projects --> buildroot-kit --> Run<br /> | ||
− | [[文件:Projects 4.png]]<br /> | + | 注意:找到 Run Environment --> Details --> 点击 Fetch Device Environment |
+ | [[文件:Projects 4.png|1560px]]<br /> | ||
+ | <br /> | ||
<br /> | <br /> | ||
+ | '''重新编译并调试运行'''<br /> | ||
Build --> Clean Project "hellowindow"<br /> | Build --> Clean Project "hellowindow"<br /> | ||
Debug --> Start Debugging --> Start Debugging<br /> | Debug --> Start Debugging --> Start Debugging<br /> | ||
− | [[文件:Projects 5.png]]<br /> | + | [[文件:Projects 5.png|1560px]]<br /> |
<br /> | <br /> | ||
− | [[文件:Projects 6. | + | [[文件:Projects 6.jpg|1560px]]<br /> |
<br /> | <br /> | ||
<br /> | <br /> | ||
− | |||
− | |||
− |
2020年6月22日 (一) 15:04的版本
该buildroot系统是基于wayland显示协议的嵌入式系统。系统集成的qt支持wayland、wayland-egl、eglfs显示插件。
获取开发SDK
SDK中包含交叉编译工具链、qmake、与目标板系统的rootfs。解压SDK到任意目录,并运行开发环境配置脚本
$ tar xxx.tar.gz -C $TOP_DIR
$ cd $TOP_DIR/host
$ ./relocate-sdk.sh
搭建qt开发环境
方法一
使用终端通过命令行编译SDK中的qt5 examples例程
$ export PATH=$TOP_DIR/host/bin:$PATH
$ cd $TOP_DIR/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib/qt/examples/opengl/hellowindow
$ qmake
$ make
生成hellowindow程序,可通过scp拷贝到目标板中直接运行 拷贝程序并登录目标板系统运行qt程序
$ scp hellowindow root@10.168.1.247:
$ ssh root@10.168.1.247
$ ./hellowindow
显示结果
方法二
在PC ubuntu16.04上搭建qtcreator开发环境,打开qtcreator IDE,依次设置
安装qtcreator
$ sudo apt-get install qtcreator
添加Qt Versions
Tools --> Options --> Build & Run --> Qt Versions --> Add --> 选中qmake路径 --> Apply
添加Compilers
Tools --> Options --> Build & Run --> Compilers --> Add --> GCC -- 选中g++路径 --> Apply
注意:选中g++路径,并修改ABI一栏明确指示平台架构为arm
添加Debuggers(可选项)
Tools --> Options --> Build & Run --> Debuggers --> Add --> 选中gdb路径 --> Apply
添加Devices(可选项)
Tools --> Options --> Devices --> Add --> General Linux Device --> start Wizard
并点击"Test"测试设备联通
添加Kits
Tools --> Options --> Build & Run --> Kits --> Qt Versions --> Add --> Apply
打开 hellowindow 工程并选择Kits
Welcome --> Open Porject --> 选择工程路径 /home/lin/trash/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib/qt/examples/opengl/hellowindow/hellowindow.pro --> Configure Project
编译运行 hellowindow
Build --> Build Project "hellowindow" --> 重启qtcreator --> Build --> Run
配置debug模式
Projects --> buildroot-kit --> Build
注意:找到 Build Steps --> qmake --> Details --> Additional arguments --> 添加 QMAKE_CXXFLAGS+=-g
Projects --> buildroot-kit --> Run
注意:找到 Run Environment --> Details --> 点击 Fetch Device Environment
重新编译并调试运行
Build --> Clean Project "hellowindow"
Debug --> Start Debugging --> Start Debugging