• 正文
  • 相關(guān)推薦
申請(qǐng)入駐 產(chǎn)業(yè)圖譜

瑞芯微RK3506開發(fā)板必備攻略之Qt應(yīng)用開發(fā)手冊(cè)(下),觸覺智能工控嵌入式方案商

05/10 15:10
150
加入交流群
掃碼加入
獲取工程師必備禮包
參與熱點(diǎn)資訊討論

文基于觸覺智能RK3506星閃開發(fā)Buildroot系統(tǒng)進(jìn)行演示,配套R(shí)K3506核心板(3核A7+M0多核異構(gòu))寬溫級(jí)59元/工業(yè)級(jí)68元,一片也是含稅批量價(jià)~

?

Buildroot SDK安裝與環(huán)境搭建

  • SDK安裝
網(wǎng)盤下載路徑:Linux>4.軟件資料>QT-SDK/Buildroot
資料鏈接請(qǐng)進(jìn)入觸覺智能官網(wǎng),或聯(lián)系客服13423856106獲取。
注意:
1. QT-SDK采用交叉編譯,所以要在X86_64電腦上使用SDK,不要將 SDK 下載到板子上。
2. 編譯環(huán)境請(qǐng)使用 Ubuntu22.04(真機(jī)或docker容器),如果使用其他版本可能導(dǎo)致編譯出錯(cuò)。
3. 不要在虛擬機(jī)共享文件夾以及非英文目錄存放、解壓QT-SDK。
下載SDK后,首先校驗(yàn)MD5值,命令如下:

?

$?md5sum?arm-buildroot-linux-gnueabihf_sdk-buildroot.tar.gz
解壓QT-SDK,命令如下:

?

$?tar -xvf arm-buildroot-linux-gnueabihf_sdk-buildroot.tar.gz -C ./
  • 交叉編譯環(huán)境搭建
進(jìn)入qt sdk目錄下,執(zhí)行install_sdk.sh腳本,進(jìn)行安裝和搭建交叉編譯環(huán)境,具體如下:

?

$?cd?./arm-buildroot-linux-gnueabihf_sdk-buildroot$?./relocate-sdk.sh

搭建環(huán)境后,查看qmake版本和交叉編譯工具鏈版本:

?

$ ./bin/arm-buildroot-linux-gnueabihf-gcc -v?使用內(nèi)建 specs。COLLECT_GCC=/mnt//rk3506/rk3506_linux-250211/rk3506_linux6.1/buildroot/output/rockchip_rk3506-emmc/images/tmp/arm-buildroot-linux-gnueabihf_sdk-buildroot/bin/arm-buildroot-linux-gnueabihf-gcc.br_realCOLLECT_LTO_WRAPPER=/mnt/rk3506/rk3506_linux-250211/rk3506_linux6.1/buildroot/output/rockchip_rk3506-emmc/images/tmp/arm-buildroot-linux-gnueabihf_sdk-buildroot/bin/../libexec/gcc/arm-buildroot-linux-gnueabihf/12.4.0/lto-wrapper目標(biāo):arm-buildroot-linux-gnueabihf配置為:./configure --prefix=/mnt/rk3506/rk3506_linux-250211/rk3506_linux6.1/buildroot/output/rockchip_rk3506-emmc/host --sysconfdir=/mnt/rk3506/rk3506_linux-250211/rk3506_linux6.1/buildroot/output/rockchip_rk3506-emmc/host/etc?--enable-static --target=arm-buildroot-linux-gnueabihf --with-sysroot=/mnt/rk3506/rk3506_linux-250211/rk3506_linux6.1/buildroot/output/rockchip_rk3506-emmc/host/arm-buildroot-linux-gnueabihf/sysroot?--enable-__cxa_atexit --with-gnu-ld --disable-libssp --disable-multilib --disable-decimal-float --enable-plugins --enable-lto --with-gmp=/mnt/rk3506/rk3506_linux-250211/rk3506_linux6.1/buildroot/output/rockchip_rk3506-emmc/host?--with-mpc=/mnt/rk3506/rk3506_linux-250211/rk3506_linux6.1/buildroot/output/rockchip_rk3506-emmc/host --with-mpfr=/mnt/rk3506/rk3506_linux-250211/rk3506_linux6.1/buildroot/output/rockchip_rk3506-emmc/host --with-pkgversion='Buildroot -g0b15601a4-dirty'?--with-bugurl=https://gitlab.com/buildroot.org/buildroot/-/issues --without-zstd --disable-libquadmath --disable-libquadmath-support --enable-tls --enable-threads --without-isl --without-cloog --with-abi=aapcs-linux --with-cpu=cortex-a7 --with-fpu=neon-vfpv4?--with-float=hard --with-mode=arm --enable-languages=c,c++ --with-build-time-tools=/mnt/rk3506/rk3506_linux-250211/rk3506_linux6.1/buildroot/output/rockchip_rk3506-emmc/host/arm-buildroot-linux-gnueabihf/bin --enable-shared --disable-libgomp線程模型:posixSupported LTO compression algorithms: zlibgcc 版本 12.4.0 (Buildroot -g0b15601a4-dirty)
$ ./bin/qmake -v?QMake version 3.1Using Qt version 5.15.11?in?/mnt/rk3506/rk3506_linux-250211/rk3506_linux6.1/buildroot/output/rockchip_rk3506-emmc/images/tmp/arm-buildroot-linux-gnueabihf/sysroot/usr/lib
注意:根據(jù)安裝路徑的不同,導(dǎo)致qmake和arm-none-linux-gnueabihf-gcc的路徑也是不同的。

Qt交叉編譯

  • Qt源碼demo
將Qt demo 解壓到當(dāng)前路徑下,命令如下:

?


$?mkdir?-p ./qt-demo && tar -xvf moveblocks.tar.gz -C ./qt-demo$?cd?qt-demo$?lsmain.cpp ?moveblocks.pro
  • 交叉編譯
命令如下:

?

$?/home/rk3506/rk3506_linux-250211/rk3506_linux6.1/buildroot/output/rockchip_rk3506-emmc/images/tmp/arm-buildroot-linux-gnueabihf_sdk-buildroot/bin/qmake ./$?make$?make install$?lsmain.cpp ?Makefile ?moveblocks ?moveblocks.pro
由此可見編譯后生成moveblocks可執(zhí)行程序,可以通過ssh等方式將可執(zhí)行程序傳到開發(fā)板中運(yùn)行。

Qt驗(yàn)證

將demo傳到開發(fā)板上,命令如下:
  • ?
$?adb push Z:moveblocks /tmp
運(yùn)行demo,命令如下:

?

$?chmod? a+x /tmp/moveblocks$?/tmp/moveblocks
結(jié)果展示

相關(guān)推薦