查看完整版本: [-- 有在arm2410s上移植Qtopia-opensource-4.2.x的吗?触摸屏怎么移植的? --]

QTCN开发网 -> Qt嵌入式开发 -> 有在arm2410s上移植Qtopia-opensource-4.2.x的吗?触摸屏怎么移植的? [打印本页] 登录 -> 注册 -> 回复主题 -> 发表主题

xiongcb 2007-05-18 18:12

有在arm2410s上移植Qtopia-opensource-4.2.x的吗?触摸屏怎么移植的?

    我将Qtopia-opensource-4.2.x移植到博创的arm2410s上,触摸屏部分一直不能成功。我采用tslib1.3 来管理触摸屏,在qtopiacore/qconfig-qpe.h里边去掉了QT_NO_QWS_CURSOR,QT_NO_QWS_MOUSE,QT_NO_QWS_MOUSE_AUTO的定义。配置的时候加上了-qt-mouse-tslib,-qt-mouse-pc,-no-mouse-linuxtp选项,能成功编译。
    在板子上运行时,插上USB接口的鼠标能正常运行自带的例子程序。
    但是不用鼠标,采用触摸屏时(触摸屏已用tslib校准),例子程序运行出现Aborted信息,屏幕也没反应,更不能点击屏幕。所需的环境变量都设置了,不知道错误出在哪里!有没有做过的,给点提示啊? 
    另外,如果在配置的时候将-qt-mouse-pc改为-no-mouse-pc(即不使用鼠标),运行例子程序的时候能出来程序运行界面,在屏幕中央还有一个鼠标指针,但点击屏幕没反应。
    实在是不知道怎么弄了,哪位大虾帮一下忙啊?

shiroki 2007-05-21 14:34
QWS_MOUSE_PROTO设置的是什么呢? 触摸屏设备的名字指定得对吗

frankgfz 2007-05-22 16:19
能否把你的./configure 的参数贴出啦看看?

xiongcb 2007-05-24 19:00
不好意思,回复迟了,谢谢各位的回复。

我的配置编译和运行过程如下:

一. 对源码包的修改
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编译器目录arm/3.4.1/arm-linux/include/linux/videodev2.h和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.. */
                                                                                                             
如上内容可参考网页:http://www.cs.fsu.edu/~baker/devices/lxr/http/source/linux/include/linux/videodev2.h?v=2.6.16.18#L305
3.TSLIB_TSDEVICE(我的触摸屏驱动程序 ts-uptech.o 是插入到 /dev/input/event0)
vi qtopiacore/qt/src/gui/embedded/qmousetslib_qws.cpp
将第124行的/dev/ts修改为/dev/input/event0
4.POINTERCAL_FILE(由于其他目录不可写,我把校准文件的存放位置改到了/mnt/yaffs/tmp/目录下)
vi src/settings/calibrate/calibrate.cpp
将第82行的/etc/pointercal改为/mnt/yaffs/tmp/pointercal
5.POINTERCAL_FILE
vi src/server/pda/firstuse.cpp
将第347行的/etc/pointercal改为/mnt/yaffs/tmp/pointercal
6.POINTERCAL_FILE
vi qtopiacore/qt/src/gui/embedded/qmouse_qws.cpp
将所有/etc/pointercal修改为/mnt/yaffs/tmp/pointercal

7.
vi qtopiacore/qconfig-qpe.h
注释掉:
/*
#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
*/
9.
vi qtopiacore/qt/src/corelib/global/qfeatures.h
/*
#if !defined(QT_NO_QWS_CURSOR) && (defined(QT_NO_CURSOR))
#define QT_NO_QWS_CURSOR
#endif
10.
vi qtopiacore/qt/src/corelib/global/qglobal.h
//#    define QT_NO_QWS_CURSOR
11.
cp qtopiacore/qconfig-qpe.h qtopiacore/qt/src/corelib/global/qconfig-qpe.h
12.
vi src/libraries/qtopia/qtimezone.cpp
将114行的/usr/share/zoneinfo改为/mnt/nfs/qtopia4/qtopiatslibtarget/zoneinfo/
(注:我安装的目标目录是/mnt/nfs/qtopia4/qtopiatslibtarget/,在目标目录下建了zoneinfo文件夹,用来放置时区信息,时区信息可以从本机的/usr/share/zoneinfo拷过去)
13.
vi src/settings/systemtime/settime.cpp
将318行的/usr/share/zoneinfo改为/mnt/nfs/qtopia4/qtopiatslibtarget/zoneinfo/

二。配置编译安装过程
1。配置(我用tslib1.3来驱动触摸屏,同时加了pc协议的鼠标)
./configure -silent -debug -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 "-debug -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-pc -qt-mouse-tslib -I/mnt/nfs/tslib1.3-install/include -L/mnt/nfs/tslib1.3-install/lib" 2>../qtopiaconfgureERR.txt

2。编译安装
make 2>../qtopiamakeERR.txt

make install

三。运行例子
采用NFS方式mount到开发板上,编译出来的目标包,没放到开发板上,是mount上取的 ,因为开发板的空间不够。

我的建立运行环境脚本如下:

export TSLIB_TSDEVICE=/dev/input/event0
export TSLIB_CONFFILE=/mnt/nfs/tslib1.3-install/etc/ts.conf
export TSLIB_CONSOLEDEVICE=none
export TSLIB_CALIBFILE=/mnt/yaffs/tmp/pointercal
export TSLIB_PLUGINDIR=/mnt/nfs/tslib1.3-install/share/ts/plugins
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/mnt/nfs/tslib1.3-install/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/mnt/nfs/qtopia4/qtopiatslibtarget/lib
export QWS_SIZE=640x480

export QWS_MOUSE_PROTO=" Tslib:/dev/input/event0 "

export POINTERCAL_FILE=/mnt/yaffs/tmp/pointercal

insmod /mnt/yaffs/touchscreen/ts-uptech.o         

cd /mnt/nfs/tslib1.3-install/bin
./ts_calibrate

cd /mnt/nfs/qtopia4/qtopiatslibtarget/bin

if [ -f "$TSLIB_CALIBFILE" ]; then
./fifteen -qws
else
/mnt/nfs/tslib1.3-install/bin/ts_calibrate
./fifteen -qws
fi

这样运行后,能效准,出现例子程序运行界面后,点击屏幕,在屏幕中央的鼠标指针消失,然后终端也没输出。后来我用qWaring()函数打印信息,发现点击屏幕,程序一直在执行readMouseData()函数。各位看看到底是什么问题?
另外,如果不用触摸屏,插上USB的鼠标直接运行程序:
./fifteen -qws
程序可以正常运行。

shiroki 2007-05-25 23:02
在qte里触摸屏和鼠标是按照一类设备来处理的,所以调用readmousedata是正常的, 不过得看看它调的是哪个driver的readmousedata, 如果是鼠标对应的driver代码里的那就是没有调用到正确的ts driver handler, 本来应该根据QWS_MOUSE_PROTO的设定找到适当的handler的

xiongcb 2007-05-30 13:38
忙于毕设,没来回复。
我的问题已经解决了,原因出在ts.conf这个文件里边。
这个文件的原内容是:

#module mousebuts
module variance xlimit=50 ylimit=50 pthreshold=3
module dejitter xdelta=1 ydelta=1 pthreshold=3
module linear

看这个文件的第一行,module mousebuts这一句被注释掉了,将“# ”去掉,再运行,就支持触摸屏了。module mousebuts好像是跟触摸屏驱动鼠标有关,不是很清楚。
哪位大虾如果对ts.conf了解透彻的,还望指点指点。

gary_123456 2008-09-12 22:44
我也是按照你说的这个方法做, qtoipia 4.2.1編譯安裝後,在開發板上運行./qpe 或例子程序時會出現:
./qpe: error while loading shared libraries: cannot open shared object file:
你没有遇到過嗎?望指點,不勝感激!!是不是它的LIB里缺少某些库呀,可以把你的mnt/nfs/qtopia4/qtopiatslibtarget/下的库传上来,或发给我吗
Wu.Chang-ling@inventec.com 

jhua 2009-03-04 17:15
我移植qtopia4.2.1,在编译时出现这种错误,请问怎么解决呀?
/usr/bin/ld: release-shared/moc.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: release-shared/moc.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: release-shared/moc.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: release-shared/moc.o: Relocations in generic ELF (EM: 40)
release-shared/moc.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make[7]: *** [../../../bin/moc]错误

yingzi 2009-04-30 17:22
上面问题怎么解决的。我还是这个问题

旺旺 2009-08-13 13:57
希望问个问题哈!我用的源码包和你的是一样的,但是我编译出来后,就只能用触摸屏,不能用鼠标,我认真看了你的文档,在这里面./configure -silent -debug -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 "-debug -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-pc -qt-mouse-tslib -I/mnt/nfs/tslib1.3-install/include -L/mnt/nfs/tslib1.3-install/lib" 2>../qtopiaconfgureERR.txt    我没有加上 -qt-mouse-pc  这句, 是不是,不加这句就不能用鼠标了,如果我加上这句,从新编译,是不是就能用鼠标了,其它的还需要改嘛???

旺旺 2009-08-13 15:11
为什么要注释掉这段  /*
#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
*/
这段表示什么??


查看完整版本: [-- 有在arm2410s上移植Qtopia-opensource-4.2.x的吗?触摸屏怎么移植的? --] [-- top --]



Powered by phpwind v8.7 Code ©2003-2011 phpwind
Gzip disabled