qtopia-opensource-src-4.2.3成功移植到mini2440上
2008-09-14 17:35
501 查看
2009-05-22 此文章参考http://blog.csdn.net/hongjiujing/archive/2007/08/09/1733126.aspx
一.硬件平台
1.主机: PC机,512M内存以上。
2.目标机:mini2440实验平台。
二.移植软件资源
1.Red Hat Linux 5.1(主机操作系统)
2.gcc-4.1.2.tar.gz(主机编译器)(交叉編譯與此編譯器無關)
3.arm-linux-gcc-4.3.2.tar.bz2(或使用arm-linux-gcc-3.4.1交叉编译器,特别注意:编译Rootfilesystem 、busybox、APP(QT)要使用同一版本因为这些程序都要使用动态链接库即/lib下的SO,不同版的交叉编译器编译的程序使用不同的加载器即 ld.so.x )
4.tslib-1.3.tar.bz2(管理目标平台的触摸屏)
5.qtopia-opensource-src-4.2.3.tar.gz(包含Qt,Qtopia core)
2. GUI(QT)的移植过程
编译前的约定:
1)我的工作目录为:/home/2440qtopia4.2.3。
2)qtopia-opensource-src-4.2.3.tar.gz 软件包放在/home/2440qtopia4.2.3/qtopia4目录下。
一.安装交叉编译器 arm-linux-gcc-4.3.2.tar.bz2
步骤如下:
export PATH=$PATH:/home/armlinux/toolchain/4.3.2/bin
保存退出,执行:
# source /etc/profile
三.编译tslib-1.3.tar.bz2
详细步骤如下:
# tar jxvf tslib-1.3.tar.bz2
解压后的目录为tslib-1.3。
# cd tslib-1.3
# export CC=arm-linux-gcc
# export CXX=arm-linux-g++
# ./autogen.sh
# ./configure --prefix=/home/2440qtopia4.2.3/tslib1.3-install --host=arm-linux
( 配置目标平台为ARM-linux,在主机上的安装目录为/home/2440qtopia4.2.3/tslib1.3-install 当编译QTOPIA时如下的环境变量不可以用,要换一个终端
export CC=arm-linux-gcc
export CXX=arm-linux-g++)
修改/tslib/plugins/Makefile 裡面找rpath.将LDFLAGS :=$(LDFLAGS) -rpath $(PLUGIN_DIR)
修改为:LDFLAGS :=$(LDFLAGS) -rpath `cd $(PLUGIN_DIR) && pwd`
(REFER TO http://blog.chinaunix.net/u/27094/showart_491556.html)
# make
# make install
Qtopia4移植过程(二)2007-06-27 22:24四.编译 qtopia-opensource-src-4.2.3.tar.gz
编译前约定:
安装目录为:/home/2440qtopia4.2.3/qtopia4/qtopiatslibinstall
目标目录为:/home/2440qtopia4.2.3/qtopia4/qtopiatslibtarget
下面解压软件包:
# tar zxvf qtopia-opensource-src-4.2.3.tar.gz
然后重命名解压后的包:
# mv qtopia-opensource-4.2.3 qtopiatslibinstall
# cd qtopiatslibinstall
在此目录下,文件夹为qtopiacore的目录即是Qt,QtopiaCore所在目录,里边包含了开发所需的Designer,qmake,uic,moc等工具,也包含了面向嵌入式平台的Qt库。
编译前,首先建立定位到安装目录和目标目录的环境变量:
# export QTOPIAINST=/home/2440qtopia4.2.3/qtopia4/qtopiatslibinstall
# export QTOPIATARG=/home/2440qtopia4.2.3/qtopia4/qtopiatslibtarget
为了让编译适应于目标平台和去除编译中将出现的错误,我们需要对源码进行修改和裁减。因此,编译的详细过程如下:
1. 修改源码包
1)
# cd src/libraries/qtopiabase/
# cp custom-linux-cassiopeia-g++.h custom-linux-arm-g++.h
# cp custom-linux-cassiopeia-g++.cpp custom-linux-arm-g++.cpp
2)修改3.4.1版的arm编译器的文件如果使用4.3.2则不需修改
# cd /usr/local/arm/3.4.1/
# vi arm-linux/include/linux/videodev2.h
在其中添加如下内容:
#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B','A','8','1')
/* 8 BGBG.. GRGR.. */
保存退出。
# vi arm/3.4.1/arm-linux/sys_include/linux/videodev2.h
在其中添加如下内容:
#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B','A','8','1')
/* 8 BGBG.. GRGR.. */
保存退出。
3) 修改时区信息
# vi src/libraries/qtopia/qtimezone.cpp
将114行的 /usr/share/zoneinfo/ 改为/home/2440qtopia4.2.3/qtopia4/qtopiatslibtarget/zoneinfo/ ,保存退出。注意:/home/2440qtopia4.2.3/..這樣設置後運行QPE時會從此處取時間信息。此位置可再編譯,不要MAKE CLEAN,否則會很長時間。
# vi src/settings/systemtime/settime.cpp
将318行的 /usr/share/zoneinfo/ 改为/home/2440qtopia4.2.3/qtopia4/qtopiatslibtarget/zoneinfo/ ,保存退出。
4) 裁减Qtopia core的库
# vi qtopiacore/qconfig-qpe.h
首先注释掉关于鼠标光标的宏定义,让程序运行时,触摸屏中央有光标出现:QFILE DIALOG也是在这里配置的注释掉的那个部分恰会使QTOPIA支持此功能
// Qtopia Core
/*
#ifndef QT_NO_QWS_CURSOR
# define QT_NO_QWS_CURSOR
#endif
*/
/*
#ifndef QT_NO_QWS_MOUSE
# define QT_NO_QWS_MOUSE
#endif
#ifndef QT_NO_QWS_MOUSE_AUTO
# define QT_NO_QWS_MOUSE_AUTO
#endif
*/
其它宏定义根据需要进行注释。
保存后将qconfig-qpe.h拷贝到global目录。
# cp qtopiacore/qconfig-qpe.h qtopiacore/qt/src/corelib/
global/qconfig-qpe.h
5)注释掉其他文件里的QT_NO_QWS_CURSOR的定义
# vi qtopiacore/qt/src/corelib/global/qfeatures.h
注释掉如下内容:
/*
#if !defined(QT_NO_QWS_CURSOR) && (defined(QT_NO_CURSOR))
#define QT_NO_QWS_CURSOR
#endif
*/
保存退出。
# vi qtopiacore/qt/src/corelib/global/qglobal.h
注释掉以下内容:
//# define QT_NO_QWS_CURSOR
Qtopia4移植过程(三)2007-06-27 22:252.配置源码包
首先,确定目录为:home/2440qtopia4.2.3/qtopia4/qtopiatslibinstall
然后进行配置,执行如下命令 :
# ./configure -silent -release
-image /mnt/nfs/qtopia4/qtopiatslibtarget
-prefix /mnt/nfs/qtopia4/qtopiatslibtarget
-xplatform linux-arm-g++ -arch arm -no-qvfb
-displaysize 640x480 -no-modem
-extra-qtopiacore-config "-release -xplatform qws/linux-arm-g++ -embedded arm -opengl -qconfig qpe -qt-sql-sqlite
-depths 4,8,16,32 -qt-kbd-usb -no-kbd-tty -no-mouse-linuxtp
-qt-mouse-tslib -I/home/2440qtopia4.2.3/tslib1.3-install/include -L/home/2440qtopia4.2.3/tslib1.3-install/lib -big-endian" 2>../qtopiaconfgureERR.txt
主要配置选项解说如下:配置时要小心空格和下划线容易出错。容易出现:big-endian or -little-endian大小端问题;找不到TSLIB,要确认 tslib-1.3使用与QT相同版本的编译器并确认make install.
-xplatform linux-arm-g++ -arch arm
目标平台为arm-linux,体系结构为arm。
-no-qvfb
目标平台已支持framebuffer,因而不使用虚拟帧缓冲。
-extra-qtopiacore-config
为Qtopia core 配置选项。
-xplatform qws/linux-arm-g++ -embedded arm
目标平台编译配置文件使用qtopiacore/qt/mkspecs/qws/linux-arm-g++目录下的配置文件,嵌入式平台为arm。
-qconfig qpe
使用配置文件qconfig-qpe.h,若使用qconfig-large.h配置文件,则使用-qconfig large选项。
-qt-sql-sqlite
数据库支持Sqlite。
-qt-kbd-usb
键盘支持usb协议。
-no-mouse-linuxtp -qt-mouse-tslib
-I/home/2410nfs/tslib1.3-install/include -L/home/2410nfs/tslib1.3-install/lib
触摸屏协议不支持linuxtp,支持tslib,并在后面添加上刚才编译的tslib的头文件和库。
-big-endian 使用4.3.2编译会有此选项,用3.4.1不需要。
2>../qtopiaconfgureERR.txt
最后将配置过程中的错误输出到qtopiaconfgureERR.txt文件中。
3.编译源码包
执行如下命令:
# make 2>../qtopiamakeERR.txt
4.安装编译后源码包
# make install
编译安装完成后,在/home/2410nfs/qtopia4/qtopiatslibtarget目录下产生各个目标文件。
5.建立时区信息
# cd $QTOPIATARG
# mkdir zoneinfo
# cp -a /usr/share/zoneinfo/* $QTOPIATARG/zoneinfo/
五.编译后的处理
完成上面的步骤后,所有软件包已编译完成。下面建立环境变量,进行后期处理,建立开发环境。
1)将designer,qmake 等工具拷贝到$QTOPIATARG/bin/目录下。
# cp $QTOPIAINST/qtopiacore/host/bin/* $QTOPIATARG/bin/
2)建立环境变量:
# vi /etc/profile
添加如下内容:
QTOPIA="/home/2440qtopia4.2.3/qtopia4/qtopiatslibtarget"
LD_LIBRARY_PATH="/usr/lib:/usr/local/lib:/usr/X11R6/lib"
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$QTOPIA/lib"
PATH="$PATH:$QTOPIA/bin"
QMAKESPEC=/home/2440qtopia4.2.3/qtopia4/qtopiatslibinstall/qtopiacore/qt/mkspecs/qws/linux-arm-g++
export QTOPIA PATH LD_LIBRARY_PATH QMAKESPEC
保存退出。
#source /etc/profile
3)修改ts.conf
# cd /home/2440qtopia4.2.3/tslib1.3-install/etc
# vi ts.conf
原文件内容如下:
#module mousebuts
module variance xlimit=50 ylimit=50 pthreshold=3
module dejitter xdelta=1 ydelta=1 pthreshold=3
module linear
将第一行的“#”去掉,让触摸屏起作用。
到此为止,开发环境建立完毕。
3 移植成果演示
以下的环境变量都是在ARM开发板上这部分仅共参考,触摸屏有点问题,可以先运行它的示例程序,可以使用NFS挂载。mount -o nolock -t nfs 192.168.1.111:/home/2440qtopia4.2.3 /home/2440qtopia4.2.3
在这里,我们以Qtopia自带的例子程序为例,来演示应用程序运行步骤。首先用VI编辑器建立qtopiatslib.sh文件:
export TSLIB_TSEVENTTYPE=event0
export TSLIB_TSDEVICE=/dev/input/event0
export TSLIB_CONFFILE=/home/2440qtopia4.2.3/tslib1.3-install/etc/ts.conf
export TSLIB_CONSOLEDEVICE=none
export TSLIB_CALIBFILE=/home/2440qtopia4.2.3/tmp/pointercal
export TSLIB_PLUGINDIR=/home/2440qtopia4.2.3/tslib1.3-install/share/ts/plugins
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/2440qtopia4.2.3
/tslib1.3-install/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/2440qtopia4.2.3
/qtopia4/qtopiatslibtarget/lib
export QWS_SIZE=800x600
export QWS_MOUSE_PROTO="Tslib:/dev/input/event0"
export POINTERCAL_FILE=/home/2440qtopia4.2.3/tmp/pointercal
insmod /mnt/yaffs/touchscreen/ts-uptech.o
cd /home/2440qtopia4.2.3/tslib1.3-install/bin
./ts_calibrate
cd /home/2440qtopia4.2.3/qtopia4/qtopiatslibtarget/bin
if [ -f "$TSLIB_CALIBFILE" ]; then
./qpe -qws
else
home/2440qtopia4.2.3/tslib1.3-install/bin/ts_calibrate
./qpe -qws
fi
保存退出,修改用户使用权限:
# chmod 777 qtopiatslib.sh
然后启动目标平台,打开minicom终端,进入目标平台的系统。在主机上启动NFS服务,将主机的/home/2440qtopia4.2.3目录挂载到目标机的/home/2440qtopia4.2.3目录。
在终端里执行:
# ifconfig eth0 192.168.1.230
#mkdir /home/2440qtopia4.2.3
# mount -t nfs (主机IP地址):/home/2440qtopia4.2.3 /home/2440qtopia4.2.3
# cd /home/2440qtopia4.2.3
# mkdir tmp
# cd /home/2440qtopia4.2.3/qtopia4
# ./qtopiatslib.sh
执行qtopiatslib.sh文件,首先校准触摸屏,依次点击屏幕上出现的五个点,完成后,会在/mnt/yaffs/tmp目录下生成pointercal校准文件。接下来就会启动qpe应用程序,进入Qtopia Phone的界面。
在实验的过程中可能会出现下面的错误:
“在make的时候,遇到了一个错误。/usr/bin/ld .....debug-shared/moc.o提示could't read symbols :File in wrong format”
只要重新用新的源代码来做才能通过。
在運行qpe的時候有可能會出現在一些動態庫找不到,些時要把你的arm-linux/LIB下面的一些SO拷入開發板的的根文件系統的LIB下。可以在ARM下用LDD命令查看程序依懶哪些SO 如果缺少可將其拷入根目錄的LIB 下或QTOPIA的LIB 下
LD_LIBRARY_PATH 的設置很重要。ldd 的运行也是有条件的,使用那个版本的编译器就要选择对应的LDD,它只是一个脚本,/lib库可以从交叉编译器下面拷过来,版本不同,对应的LD.SO也不同,它对程序的运行非常关键,請理解它的用法及整個程序的加載過程。
一.硬件平台
1.主机: PC机,512M内存以上。
2.目标机:mini2440实验平台。
二.移植软件资源
1.Red Hat Linux 5.1(主机操作系统)
2.gcc-4.1.2.tar.gz(主机编译器)(交叉編譯與此編譯器無關)
3.arm-linux-gcc-4.3.2.tar.bz2(或使用arm-linux-gcc-3.4.1交叉编译器,特别注意:编译Rootfilesystem 、busybox、APP(QT)要使用同一版本因为这些程序都要使用动态链接库即/lib下的SO,不同版的交叉编译器编译的程序使用不同的加载器即 ld.so.x )
4.tslib-1.3.tar.bz2(管理目标平台的触摸屏)
5.qtopia-opensource-src-4.2.3.tar.gz(包含Qt,Qtopia core)
2. GUI(QT)的移植过程
编译前的约定:
1)我的工作目录为:/home/2440qtopia4.2.3。
2)qtopia-opensource-src-4.2.3.tar.gz 软件包放在/home/2440qtopia4.2.3/qtopia4目录下。
一.安装交叉编译器 arm-linux-gcc-4.3.2.tar.bz2
步骤如下:
export PATH=$PATH:/home/armlinux/toolchain/4.3.2/bin
保存退出,执行:
# source /etc/profile
三.编译tslib-1.3.tar.bz2
详细步骤如下:
# tar jxvf tslib-1.3.tar.bz2
解压后的目录为tslib-1.3。
# cd tslib-1.3
# export CC=arm-linux-gcc
# export CXX=arm-linux-g++
# ./autogen.sh
# ./configure --prefix=/home/2440qtopia4.2.3/tslib1.3-install --host=arm-linux
( 配置目标平台为ARM-linux,在主机上的安装目录为/home/2440qtopia4.2.3/tslib1.3-install 当编译QTOPIA时如下的环境变量不可以用,要换一个终端
export CC=arm-linux-gcc
export CXX=arm-linux-g++)
修改/tslib/plugins/Makefile 裡面找rpath.将LDFLAGS :=$(LDFLAGS) -rpath $(PLUGIN_DIR)
修改为:LDFLAGS :=$(LDFLAGS) -rpath `cd $(PLUGIN_DIR) && pwd`
(REFER TO http://blog.chinaunix.net/u/27094/showart_491556.html)
# make
# make install
Qtopia4移植过程(二)2007-06-27 22:24四.编译 qtopia-opensource-src-4.2.3.tar.gz
编译前约定:
安装目录为:/home/2440qtopia4.2.3/qtopia4/qtopiatslibinstall
目标目录为:/home/2440qtopia4.2.3/qtopia4/qtopiatslibtarget
下面解压软件包:
# tar zxvf qtopia-opensource-src-4.2.3.tar.gz
然后重命名解压后的包:
# mv qtopia-opensource-4.2.3 qtopiatslibinstall
# cd qtopiatslibinstall
在此目录下,文件夹为qtopiacore的目录即是Qt,QtopiaCore所在目录,里边包含了开发所需的Designer,qmake,uic,moc等工具,也包含了面向嵌入式平台的Qt库。
编译前,首先建立定位到安装目录和目标目录的环境变量:
# export QTOPIAINST=/home/2440qtopia4.2.3/qtopia4/qtopiatslibinstall
# export QTOPIATARG=/home/2440qtopia4.2.3/qtopia4/qtopiatslibtarget
为了让编译适应于目标平台和去除编译中将出现的错误,我们需要对源码进行修改和裁减。因此,编译的详细过程如下:
1. 修改源码包
1)
# cd src/libraries/qtopiabase/
# cp custom-linux-cassiopeia-g++.h custom-linux-arm-g++.h
# cp custom-linux-cassiopeia-g++.cpp custom-linux-arm-g++.cpp
2)修改3.4.1版的arm编译器的文件如果使用4.3.2则不需修改
# cd /usr/local/arm/3.4.1/
# vi arm-linux/include/linux/videodev2.h
在其中添加如下内容:
#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B','A','8','1')
/* 8 BGBG.. GRGR.. */
保存退出。
# vi arm/3.4.1/arm-linux/sys_include/linux/videodev2.h
在其中添加如下内容:
#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B','A','8','1')
/* 8 BGBG.. GRGR.. */
保存退出。
3) 修改时区信息
# vi src/libraries/qtopia/qtimezone.cpp
将114行的 /usr/share/zoneinfo/ 改为/home/2440qtopia4.2.3/qtopia4/qtopiatslibtarget/zoneinfo/ ,保存退出。注意:/home/2440qtopia4.2.3/..這樣設置後運行QPE時會從此處取時間信息。此位置可再編譯,不要MAKE CLEAN,否則會很長時間。
# vi src/settings/systemtime/settime.cpp
将318行的 /usr/share/zoneinfo/ 改为/home/2440qtopia4.2.3/qtopia4/qtopiatslibtarget/zoneinfo/ ,保存退出。
4) 裁减Qtopia core的库
# vi qtopiacore/qconfig-qpe.h
首先注释掉关于鼠标光标的宏定义,让程序运行时,触摸屏中央有光标出现:QFILE DIALOG也是在这里配置的注释掉的那个部分恰会使QTOPIA支持此功能
// Qtopia Core
/*
#ifndef QT_NO_QWS_CURSOR
# define QT_NO_QWS_CURSOR
#endif
*/
/*
#ifndef QT_NO_QWS_MOUSE
# define QT_NO_QWS_MOUSE
#endif
#ifndef QT_NO_QWS_MOUSE_AUTO
# define QT_NO_QWS_MOUSE_AUTO
#endif
*/
其它宏定义根据需要进行注释。
保存后将qconfig-qpe.h拷贝到global目录。
# cp qtopiacore/qconfig-qpe.h qtopiacore/qt/src/corelib/
global/qconfig-qpe.h
5)注释掉其他文件里的QT_NO_QWS_CURSOR的定义
# vi qtopiacore/qt/src/corelib/global/qfeatures.h
注释掉如下内容:
/*
#if !defined(QT_NO_QWS_CURSOR) && (defined(QT_NO_CURSOR))
#define QT_NO_QWS_CURSOR
#endif
*/
保存退出。
# vi qtopiacore/qt/src/corelib/global/qglobal.h
注释掉以下内容:
//# define QT_NO_QWS_CURSOR
Qtopia4移植过程(三)2007-06-27 22:252.配置源码包
首先,确定目录为:home/2440qtopia4.2.3/qtopia4/qtopiatslibinstall
然后进行配置,执行如下命令 :
# ./configure -silent -release
-image /mnt/nfs/qtopia4/qtopiatslibtarget
-prefix /mnt/nfs/qtopia4/qtopiatslibtarget
-xplatform linux-arm-g++ -arch arm -no-qvfb
-displaysize 640x480 -no-modem
-extra-qtopiacore-config "-release -xplatform qws/linux-arm-g++ -embedded arm -opengl -qconfig qpe -qt-sql-sqlite
-depths 4,8,16,32 -qt-kbd-usb -no-kbd-tty -no-mouse-linuxtp
-qt-mouse-tslib -I/home/2440qtopia4.2.3/tslib1.3-install/include -L/home/2440qtopia4.2.3/tslib1.3-install/lib -big-endian" 2>../qtopiaconfgureERR.txt
主要配置选项解说如下:配置时要小心空格和下划线容易出错。容易出现:big-endian or -little-endian大小端问题;找不到TSLIB,要确认 tslib-1.3使用与QT相同版本的编译器并确认make install.
-xplatform linux-arm-g++ -arch arm
目标平台为arm-linux,体系结构为arm。
-no-qvfb
目标平台已支持framebuffer,因而不使用虚拟帧缓冲。
-extra-qtopiacore-config
为Qtopia core 配置选项。
-xplatform qws/linux-arm-g++ -embedded arm
目标平台编译配置文件使用qtopiacore/qt/mkspecs/qws/linux-arm-g++目录下的配置文件,嵌入式平台为arm。
-qconfig qpe
使用配置文件qconfig-qpe.h,若使用qconfig-large.h配置文件,则使用-qconfig large选项。
-qt-sql-sqlite
数据库支持Sqlite。
-qt-kbd-usb
键盘支持usb协议。
-no-mouse-linuxtp -qt-mouse-tslib
-I/home/2410nfs/tslib1.3-install/include -L/home/2410nfs/tslib1.3-install/lib
触摸屏协议不支持linuxtp,支持tslib,并在后面添加上刚才编译的tslib的头文件和库。
-big-endian 使用4.3.2编译会有此选项,用3.4.1不需要。
2>../qtopiaconfgureERR.txt
最后将配置过程中的错误输出到qtopiaconfgureERR.txt文件中。
3.编译源码包
执行如下命令:
# make 2>../qtopiamakeERR.txt
4.安装编译后源码包
# make install
编译安装完成后,在/home/2410nfs/qtopia4/qtopiatslibtarget目录下产生各个目标文件。
5.建立时区信息
# cd $QTOPIATARG
# mkdir zoneinfo
# cp -a /usr/share/zoneinfo/* $QTOPIATARG/zoneinfo/
五.编译后的处理
完成上面的步骤后,所有软件包已编译完成。下面建立环境变量,进行后期处理,建立开发环境。
1)将designer,qmake 等工具拷贝到$QTOPIATARG/bin/目录下。
# cp $QTOPIAINST/qtopiacore/host/bin/* $QTOPIATARG/bin/
2)建立环境变量:
# vi /etc/profile
添加如下内容:
QTOPIA="/home/2440qtopia4.2.3/qtopia4/qtopiatslibtarget"
LD_LIBRARY_PATH="/usr/lib:/usr/local/lib:/usr/X11R6/lib"
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$QTOPIA/lib"
PATH="$PATH:$QTOPIA/bin"
QMAKESPEC=/home/2440qtopia4.2.3/qtopia4/qtopiatslibinstall/qtopiacore/qt/mkspecs/qws/linux-arm-g++
export QTOPIA PATH LD_LIBRARY_PATH QMAKESPEC
保存退出。
#source /etc/profile
3)修改ts.conf
# cd /home/2440qtopia4.2.3/tslib1.3-install/etc
# vi ts.conf
原文件内容如下:
#module mousebuts
module variance xlimit=50 ylimit=50 pthreshold=3
module dejitter xdelta=1 ydelta=1 pthreshold=3
module linear
将第一行的“#”去掉,让触摸屏起作用。
到此为止,开发环境建立完毕。
3 移植成果演示
以下的环境变量都是在ARM开发板上这部分仅共参考,触摸屏有点问题,可以先运行它的示例程序,可以使用NFS挂载。mount -o nolock -t nfs 192.168.1.111:/home/2440qtopia4.2.3 /home/2440qtopia4.2.3
在这里,我们以Qtopia自带的例子程序为例,来演示应用程序运行步骤。首先用VI编辑器建立qtopiatslib.sh文件:
export TSLIB_TSEVENTTYPE=event0
export TSLIB_TSDEVICE=/dev/input/event0
export TSLIB_CONFFILE=/home/2440qtopia4.2.3/tslib1.3-install/etc/ts.conf
export TSLIB_CONSOLEDEVICE=none
export TSLIB_CALIBFILE=/home/2440qtopia4.2.3/tmp/pointercal
export TSLIB_PLUGINDIR=/home/2440qtopia4.2.3/tslib1.3-install/share/ts/plugins
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/2440qtopia4.2.3
/tslib1.3-install/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/2440qtopia4.2.3
/qtopia4/qtopiatslibtarget/lib
export QWS_SIZE=800x600
export QWS_MOUSE_PROTO="Tslib:/dev/input/event0"
export POINTERCAL_FILE=/home/2440qtopia4.2.3/tmp/pointercal
insmod /mnt/yaffs/touchscreen/ts-uptech.o
cd /home/2440qtopia4.2.3/tslib1.3-install/bin
./ts_calibrate
cd /home/2440qtopia4.2.3/qtopia4/qtopiatslibtarget/bin
if [ -f "$TSLIB_CALIBFILE" ]; then
./qpe -qws
else
home/2440qtopia4.2.3/tslib1.3-install/bin/ts_calibrate
./qpe -qws
fi
保存退出,修改用户使用权限:
# chmod 777 qtopiatslib.sh
然后启动目标平台,打开minicom终端,进入目标平台的系统。在主机上启动NFS服务,将主机的/home/2440qtopia4.2.3目录挂载到目标机的/home/2440qtopia4.2.3目录。
在终端里执行:
# ifconfig eth0 192.168.1.230
#mkdir /home/2440qtopia4.2.3
# mount -t nfs (主机IP地址):/home/2440qtopia4.2.3 /home/2440qtopia4.2.3
# cd /home/2440qtopia4.2.3
# mkdir tmp
# cd /home/2440qtopia4.2.3/qtopia4
# ./qtopiatslib.sh
执行qtopiatslib.sh文件,首先校准触摸屏,依次点击屏幕上出现的五个点,完成后,会在/mnt/yaffs/tmp目录下生成pointercal校准文件。接下来就会启动qpe应用程序,进入Qtopia Phone的界面。
在实验的过程中可能会出现下面的错误:
“在make的时候,遇到了一个错误。/usr/bin/ld .....debug-shared/moc.o提示could't read symbols :File in wrong format”
只要重新用新的源代码来做才能通过。
在運行qpe的時候有可能會出現在一些動態庫找不到,些時要把你的arm-linux/LIB下面的一些SO拷入開發板的的根文件系統的LIB下。可以在ARM下用LDD命令查看程序依懶哪些SO 如果缺少可將其拷入根目錄的LIB 下或QTOPIA的LIB 下
LD_LIBRARY_PATH 的設置很重要。ldd 的运行也是有条件的,使用那个版本的编译器就要选择对应的LDD,它只是一个脚本,/lib库可以从交叉编译器下面拷过来,版本不同,对应的LD.SO也不同,它对程序的运行非常关键,請理解它的用法及整個程序的加載過程。
相关文章推荐
- Devkit8000(omap3530) tslib1.4+qtopia-core-opensource-src-4.3.5移植全记
- qt-embedded-linux-opensource-src-4.5.1成功移植到micro2440
- Qt-embedded-linux-opensource-src-4.5.1移植到mini2440
- qt-embedded-linux-opensource-src-4.8.6 + tslib-1.4 + qwt-6.0.2 编译和移植到mini2440开发板
- qtopia-core-opensource-src-4.3.3移植到QQ2440
- 移植 Qtopia-core-opensource-src-4.3.0beta 到 PXA270
- qt-embedded-linux-opensource-src-4.5.3在飞凌2440上的成功移植
- Qt-embedded-linux-opensource-src-4.5.1移植到mini2440
- 移植Qtopia-opensource-src-4.3.2
- 交叉移植tesseract过程记述以及总结(在mini2440开发板上运行成功)
- Ubuntu9.10+qt-embedded-linux-opensource-src-4.5.0+tslib-1.4.1+gcc-4.3.3+gcc-4.1移植经验
- Fedora8上交叉编译qtopia4移植成功到s3c2410开发板
- Qtopia OpenSource 4.2.0 在s3c2410上的移植(参考修改)
- 编译及安装最新的qt/x11 4.3.4,qtopia 4.3.1 ,qtopia-core-opensource-src-4.3.3以及使用方法
- qt-embedded-linux-opensource-src-4.5.3移植 (转载)
- 成功在mini2440上移植ffmpeg
- Fedora8上交叉编译qtopia4移植成功到s3c2410开发板
- uboot-2009.03成功移植到mini2440
- 转 MINIGUI成功移植到MINI2440详解
- Qtopia-core-opensource-4.2.2安装及Hello world移植到AT91SAM9261EK