qtopia4.4.3手机版在mini2440上的移植
编者:原来也移植过QT,对这个还是总结了些经验的。因为mini2440开发板自带的是PDA版本的QTOPIA,所以我决定移植一个手机版本试试。为什么选择这个版本的,其实我没有进行特意选择,在百度上搜了下,发下这个版本有人在mini2440上成功移植,也就是说有案列,这样可以参考人家的案例,在出问题时候,解决能快点。因为这个必定没作为项目开发,要是搞了很长一段时间还没搞定,打击自己不说,会花掉大把的时间,影响其他工作。百度文库就有一个文章,我参照来移植的,但是里面还是很多问题。估计原因,可能是这样的,这篇文章的作者可能用的是友善自带的文件系统,而我没有使用这个文件系统,用了我自己移植的文件系统,可以说是纯净的系统,这样可能会在运行时候少很多东西,需要自己添加。另外一点需要注意的是,在配置编译qtopia的时候一定要小心,因为这个一旦出错,重新编译的时间很长很长,所以尽量避免低级错误的出现。
SORRY to tell you that ,I have finished only a little part(above)yestoday night,but today ,I unfortunate to find that I can't input anythings with chinese ,I tried my best to repair the conputer ,but I failed in the last.I want to finish this paper today,so I decide to write in english.oh,my english is very poor,God bless me to finish this smoothly.
ONE、prepare the source code and the development ervironment
1、source code
qt-extended-opensource-src-4.4.3.tar.gz
tslib-1.4.1.tar.bz2
2、development environment:
Fedora10—linux-2.6.27
arm-linux-gcc(FrienflyArm support)
如果只是想移植到开发板看看,可以不装X86版本的,这里我还是安装了。我这里移植时候目录整理的有点乱,但还是按照我的这个顺序来吧。
if you only transplant the qtopia to hte mini2440,you don't need to install the qtopia(x86).
create a new dir /opt/app/phone.
TWO、install x86 qtopia phone version
#cd /opt/app/phone
uncompress
#tar -zxvf qt-extended-opensource-src-4.4.3.tar.gz
change the name
#mv qt-extended-4.4.3 qt-extended-4.3.3-src
#mkdir target
#mkdir build
set variable environment
[root@localhost qt-extended-4.4.3-src]# export QPEDIR=/opt/app/phone/build
[root@localhost qt-extended-4.4.3-src]# export QTOPIA_DEPOT_PATH=/opt/app/phone/qt-extended-4.4.3-src
[root@localhost qt-extended-4.4.3-src]# echo $QPEDIR
/opt/app/phone/build
[root@localhost qt-extended-4.4.3-src]# echo $QTOPIA_DEPOT_PATH
/opt/app/phone/qt-extended-4.4.3-src
configure
[root@localhost build]# ../qt-extended-4.4.3-src/configure -build-qt -image /opt/app/phone/target/ -prefix /opt/app/phone/target/ (等几分钟到十几分钟这样子)
compile
[root@localhost build]# bin/qbuild (note:is not /bin,is the current dir)(about several hours)
isntall:
[root@localhost build]# bin/qbuild image (need about 10mins depends on your pc)
install SDK:
[root@localhost build]# bin/qbuild sdk (about several mins)
now you can run the qtopia(x86) and see the picture.it looks nice.you can push the button by the mouse.When the qtopia is running ,you can scan,run video game.now input bin/runqtopia
[root@localhost build]# bin/runqtopia
THREE、uncompress and compile the tslib-1.4.1.tar.bz2
#cd /opt/app/phone
#tar jxvf tslib-1.4.1.tar.bz2
now you can see a new dir nammed opt in the current dir
#cd opt/EmbedSky/Qte/tslib-1.4.1
run the shell script autogen.sh,this step is use to generate the configure file.
#./autogen.sh
configure
[root@localhost tslib-1.4.1]# ./configure -enable -inputapi=no --host=arm-linux -prefix=/opt/app/phone/mytslib ac_cv_func_malloc_0_nonnull=yes
[root@localhost tslib-1.4.1]# ./make
[root@localhost tslib-1.4.1]# ./make install
now cd the /opt/app/phone,then ls ,you can see the new dir mytslib
FOUR、COMPILE &INATALL QTOPIA(PHONE)
creat the new dir
#cd /opt/app/phone
#mkdir qtopia_arm
copy qt-extended-opensource-src-4.4.3.tar.gz to qtopia_arm
#cp qt-extended-opensource-src-4.4.3.tar.gz qtopia_arm
uncompress the file qt-extended-opensource-src-4.4.3.tar.gz
#tar -zxcf qt-extended-opensource-src-4.4.3.tar.gz
change the filename qt-extended-4.4.3 to qt-extended-4.4.3-src-arm
#mv qt-extended-4.4.3 qt-extended-4.4.3-src-arm
create the new dir
#mkdir target_arm
#mkdir build_arm
#cd build_arm
configure
# ../qt-extended-4.4.3-src-arm/configure -verbose -release -image /opt/app/phone/qtopia_arm/target_arm -prefix /opt/app/phone/qtopia_arm/target_arm -no-pkg-config -no-dbus -xplatform linux-arm-g++ -arch arm -displaysizes 320*240 -build-qt -qtopia-sqlite -v4l2 -remove-module modem -remove-module bluetooth -remove-module drm -remove-module infrared -extra-qt-embedded-config "-xplatform qws/linux-arm-g++ -embedded arm -qconfig qpe -shared -little-endian -webkit -qt-kbd-usb -qt-libpng -qt-libjpeg -qt-gif -depths 4,8,16,32 -qt-mouse-tslib -I/opt/app/phone/mytslib/include -L/opt/app/phone/mytslib/lib"
(need about thirty miniutes)
compile
#bin/qbuild
(need several hours )
install and install the sdk
#bin/qbuild image
#bin/qbuild sdk
FIVE、move the data and library to mini2440 and test it
1) I create a new dir in the development board ,as same as my PC,is opt/app/phone/qtopia_arm/target_arm.Then I copy all the data in the target_arm in my PC to same dir in the development board.
2) creat a new file in the /bin ,the name is qtopia4,edit the file with vi ,the contents is as folllows:
#!/bin/sh
export TSLIB_TSDEVICE=/dev/event0
export TSLIB_CONFFILE=/usr/local/mytslib/etc/ts.conf
export TSLIB_PLUGINDIR=/usr/local/mytslib/lib/ts
export TSLIB_CALIBFILE=/etc/pointercal
export QPEDIR=/opt/app/phone/qtopia_arm/target_arm
export PATH=$QPEDIR/bin:$PATH
export LD_LIBRARY_PATH=$QPEDIR/lib:/usr/local/mytslib/lib:/usr/local/lib:$LD_LIB
export QWS_SIZE=320*240
export HOME=/opt/app/phone/qtopia_arm
export QWS_DISPLAY=LinuxFb:/dev/fb0
export QWS_DISPLAY=LinuxFb:mmWidth130:mmHeight100:0
#export QWS_KEYBOARD=TTY:/dev/tty1
export QWS_MOUSE_PROTO=Tslib:/dev/event0
export QT_PLUGIN_PATH=$QPEDIR/plug
save it and input the command
#resource qtopia4
then some environment valiables will be set.
we can try the run the qtopia with/qpe -qws
it failed with error:can not find the libts-0.0.so.0 library.........................................
................................................................
oh,it must be absent of some libraries.but what is the libraries?the datasheet that I refer to does not mention it.
I think for several minutes,when I transplant the qtopia to the development board fot the first time ,I transplant the tslib(touchscreen library) ,but this time
I didn't do that .this must be the reason.so I look up some books,I copy the mytslib(include all the contents in the dir)to the mini2440,the location is /usr/local/
and I adjust the qtopia.It should be note that we must modify the /usr/local/mytslib/etc/ts.conf,find the "# module_raw_input",change to " module_raw_input",it means to delete a"#" and a backspace. We go to the dir /usr/local/mytislib/bin,here ,there are some little tools,we can test the touchscreen ,they are extremely useful.
When we finish the work above,the qtopia should be work suceffuly on the board.During the transplant period,we would encounter so many problems ,but keep in mind that ,you will overcome in the last.
the pictures about the transplant are as follows:
I summarize severals problems ,and the solutions to the problem.
1>problems: QWSTslibMouseHandlerPrivate: ts_open() failed with error: 'No such file or directory' Please check your tslib installation! Segmentation fault
solutions: edit the qtopia4 find" export QWS_MOUSE_PROTO=tslib:/dev/event0"
2>problems: Unable to open '/usr/share/zoneinfo/America/New_York' QTimeZone::data Can't create a valid data object for 'America/New_York'
solutions: cp the /usr/local/share/zoneinfo in the PC to the same path in the mini2440.
3>another severals problems as follow screenshot picture: