您的位置:首页 > 其它

BeagleBoneblack 使用心得

2014-09-16 16:31 316 查看
BeagleBoneblack
使用心得:(http://www.cloud-rocket.com/2013/07/building-qt-for-beaglebone/)

一、连接BBB板

方法一:使用USB—OTG连接电脑:使用shh连接192.168.7.2登陆到板子上,初始用户名为root,初始秘密为空。

方法二:使用串口,这种方法需要接线,可以参考相关手册;串口连接之后可以看到bbb板的启动信息,

其他方法貌似不可以

方法三:使用vnc,启动vnc,如果板子没有安装,需要连上internet之后下载该软件包,进行安装,

x11vnc启动方式为:x11vnc-bg -o %HOME/.x11vnc.log.%VNCDISPLAY
-auth/var/run/gdm/auth-for-gdm*/database -display :0 -forever (在angstrom系统下联网后使用命令下载:opkgupdate
opkg install x11vnc)

二、BBB板系统升级

bbb有多个linux系统支持,下载地址:http://beagleboard.org/latest-images

镜像分两种:withoutflashing the eMMC和eMMCflasher

eMMCflasher:该种镜像烧入SD卡时,在按住uBOOT键并加点后,大约45分钟左右可以烧入eMMCflasher;

withoutflashing the eMMC:这种镜像只能烧入SD卡中,不会烧入eMMCflasher中。

三、编译环境安装

1、系统环境:

1.1、PC环境:

OS:ubuntu12.04

1.2、编译环境:Qt4.8.5

OS:Angstrom
(使用最新版本)

2、下载相关软件

2.1、ARM编译器:angstrom-2011.03-i686-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2

2.2、QT源码:qt-everywhere-opensource-src-4.8.5.tar.gz

3、设置交叉编译环境

安装交叉编译器

cd/usr/local

$tar -C / -xjfangstrom-2011.03-i686-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2

开始使用上面安装的交叉编译器来编译qt库

解压:tar-xzf qt-everywhere-opensource-src-4.8.5.tar.gz到/usr/local/qt-4.8.5-beagle

执行以下操作:

$cd /usr/local/qt-4.8.5-beagle

$mkdir ./mkspecs/qws/linux-am335x-g++

$cp ./mkspecs/qws/linux-arm-g++/qplatformdefs.h./mkspecs/qws/linux-am335x-g++

$touch ./mkspecs/qws/linux-am335x-g++/qmake.conf

编辑qmake.conf文件:复制下面内容到该文件

######################################

#

#qmake configuration for building with arm-linux-g++

#

include(../../common/linux.conf)

include(../../common/gcc-base-unix.conf)

include(../../common/g++-unix.conf)

include(../../common/qws.conf)

#modifications to g++.conf

#Toolchain

#CompilerFlags to take advantage of the ARM architecture

QMAKE_CFLAGS_RELEASE= -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp

QMAKE_CXXFLAGS_RELEASE= -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp

QMAKE_CC= /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/gcc

QMAKE_CXX= /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++

QMAKE_LINK= /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++

QMAKE_LINK_SHLIB= /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++

#modifications to linux.conf

QMAKE_AR= /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/ar cqs

QMAKE_OBJCOPY= /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/objcopy

QMAKE_STRIP= /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/strip

load(qt_config)

############################################

配置嵌入式QT

./configure-v -opensource -confirm-license -prefix /opt/qt -embedded arm-platform qws/linux-x86-g++ -xplatform qws/linux-am335x-g++ -depths16,24,32 -no-mmx -no-3dnow
-no-sse -no-sse2 -no-glib -no-cups-no-largefile -no-accessibility -no-openssl -no-gtkstyle -qt-mouse-pc-qt-mouse-linuxtp -qt-mouse-linuxinput -plugin-mouse-linuxtp-plugin-mouse-pc -fast -little-endian -host-big-endian -no-pch-no-sql-ibase -no-sql-mysql -no-sql-odbc
-no-sql-psql -no-sql-sqlite-no-sql-sqlite2 -no-webkit -no-qt3support -nomake examples -nomakedemos -nomake docs -nomake translations

构建并安装

$make -j 4

$sudo make install

4、安装qt库到BBB板上

在bbb板上执行:

root@beaglebone:/#mkdir /opt

root@beaglebone:/#mkdir /opt/qt

PC上执行:

$scp -r /opt/qt/lib
root@192.168.7.2:"/opt/qt"

在BBB板上操作:

编辑/etc/profile文件添加QT库路径到PATH环境变量中去:

PATH="...:/opt/qt/lib"

5、配置QTCreatorIDE环境:

运行Angstrom工具链环境设置

$. /usr/local/angstrom/arm/environment-setup

5.1、配置QT版本:工具--》选项--》构建和运行

注:选择正确的针对arm版本的qmake

5.2、配置目标设备连接:工具--》选项--》设备--》添加

5.3、配置编译器:工具--》选项--》构建和运行--》编译器

注:选择正确的编译器路径

5.4、配置构建套间KIT

至此QTCreator配置完毕!

可以建立qt工程进行测试:

工程建立之后编辑.pro文件,在“TARGET=…”行后添加如下:

target.files=
此处为你工程的名字

target.path= /home/root

INSTALLS= target
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: