基于s3c2410的tslib1.4的编译与移植~

来源:互联网 发布:mini metro mac 编辑:程序博客网 时间:2024/05/22 13:40

网上看到了一篇不错的tslib移植的文章,特别是里面提到的错误和解决方法很有用,转载至此。与各位共享。

原帖地址 http://apps.hi.baidu.com/share/detail/19830498 或 http://www.360doc.com/content/11/0807/01/4171006_138590024.shtml

环境:S3C2410 linux tslib1.4


1.交叉编译tslib
过程如下:

解压;

#./autogen.sh
#./configure --prefix=/home/duancp/mytslib/ --host=arm-linux(这句所选择安装目录,注意) ac_cv_func_malloc_0_nonnull=yes (可以先生成个shell文件)

#make

#make install-strip //生成瘦身应用程序和库 

可能出现的错误及解答过程:(摘自:http://blog.csdn.net/gfocean/archive/2010/01/2/5266847.aspx)
错误1:
./autogen.sh错误提示:
root@ppcst-desktop:/home/ppcst/software/tslib# ./autogen.sh 
Can't exec "aclocal": 没有该文件或目录 at /usr/bin/autoreconf2.50 line 182.
Use of uninitialized value in pattern match (m//) at /usr/bin/autoreconf2.50 line 182.
Can't exec "automake": 没有该文件或目录 at /usr/bin/autoreconf2.50 line 183.
Use of uninitialized value in pattern match (m//) at /usr/bin/autoreconf2.50 line 183.
Can't exec "aclocal": 没有该文件或目录 at /usr/share/autoconf/Autom4te/FileUtils.pm line 290.
autoreconf2.50: failed to run aclocal: 没有该文件或目录
解决方法:apt-get install automake


错误2:
Can't exec "libtoolize": No such file or directory at /usr/bin/autoreconf line 190.

Use of uninitialized value $libtoolize in pattern match (m//) at /usr/bin/autoreconf line 190.

configure.ac:25: error: possibly undefined macro: AC_DISABLE_STATIC

If this token and others are legitimate, please use m4_pattern_allow.

See the Autoconf documentation.

configure.ac:26: error: possibly undefined macro: AC_ENABLE_SHARED

configure.ac:27: error: possibly undefined macro: AC_LIBTOOL_DLOPEN

configure.ac:28: error: possibly undefined macro: AC_PROG_LIBTOOL

autoreconf: /usr/bin/autoconf failed with exit status: 1

解决方法:在ubuntu下安装libtool.deb或者更新用命令:apt-get install libtool



错误3:

ts_test.o(.text+0x218): In function `main':

: undefined reference to `rpl_malloc'

fbutils.o(.text+0x234): In function `open_framebuffer':

: undefined reference to `rpl_malloc'

collect2: ld returned 1 exit status

make[2]: *** [ts_test] Error 1

make[2]: Leaving directory `/home/gfpeak/Desktop/tslib/tests'

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/home/gfpeak/Desktop/tslib'

make: *** [all] Error 2

解决方法是在编译的时候./configure后面的参数没有设置对,正确设置如下:

./configure --prefix=/usr/local/tslib/ --host=arm-linux ac_cv_func_malloc_0_nonnull=yes


错误4:

在开发板上运行校正程序时出现No raw modules loaded

解决方法是把  tslib/etc目录下的ts.conf 的 "#module_raw input"的注释符号“#”去掉。但记住不要在前面留有 空格 ,否则会出现错误4

错误5:
在开发板上运行校正程序时出现Segmentation fault
解决方法是看错误3。

2.tslib的移植
过程如下:
a.到/home/duancp/mytslib/下(你在./configure时设置的目录下)把mytslib下载到开板
/mnt/yaffs/(下载方式可参考文章 下载方式)
b.设置环境变量如下:(或者写成shell形式)
export T_ROOT=/mnt/yaffs/mytslib
export LD_LIBRARY_PATH=$T_ROOT/lib
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_TSDEVICE=/dev/input/event0
export TSLIB_PLUGINDIR=$T_ROOT/lib/ts
export TSLIB_CONFFILE=$T_ROOT/etc/ts.conf
export TSLIB_CALIBFILE=/mnt/yaffs/pointercal( #tslib配置文件内容)我没有到 这 个文件,应该不设置也行

解释:
TSLIB_TSDEVICE //触摸屏设备文件名 
Default (no inputapi): /dev/touchscreen/ucb1x00 
Default (inputapi): /dev/input/event0 
TSLIB_CALIBFILE //校准的数据文件,由ts_calibrate 校准程序生成 
Default: ${sysconfdir}/pointercal 
TSLIB_CONFFILE //配置文件名 
Default: ${sysconfdir}/ts.conf 
TSLIB_PLUGINDIR //插件目录 
Default: ${datadir}/plugins 
TSLIB_CONSOLEDEVICE //控制台设备文件名 
Default: /dev/tty 
TSLIB_FBDEVICE //FrameBuffer设备名 
Default: /dev/fb0 
以上环境变量在实际开发中的实际配置可以根据实际情况决定。 
c.修改mytslib/etc/ts.conf文件,要不会出现错误2
使ts.conf文件如下:
module_raw input
module pthres pmin=1
module variance delta=30
module dejitter delta=100
module linear 
即把tslib/etc目录下的ts.conf 的 "#module_raw input"的注释符号“#”去掉,不要在前面留有空格。
d. cd bin
./ts_test(执行测试程序即可,你可以在屏幕上看到测试点,则成功了)
注意:触摸屏的前提是你的触摸屏驱动已经写好,并加载进了内核.你可以测试有没有加载触摸屏驱动,cat /dev/input/event0(这只是我的板子上的触摸屏) ,手摸触摸屏,看终端有无显示,若有则表明正确。 如无则要加上触摸屏的驱动 insmod touchscreen.o(此驱动自己找)

编译tslib1.4的错误和解决方法:(摘自:http://blog.csdn.net/gfocean/archive/2010/01/28/5266847.aspx)
错误1:

ts_test.o(.text+0x218): In function `main':

: undefined reference to `rpl_malloc'

fbutils.o(.text+0x234): In function `open_framebuffer':

: undefined reference to `rpl_malloc'

collect2: ld returned 1 exit status

make[2]: *** [ts_test] Error 1

make[2]: Leaving directory `/home/gfpeak/Desktop/tslib/tests'

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/home/gfpeak/Desktop/tslib'

make: *** [all] Error 2

解决方法是在编译的时候./configure后面的参数没有设置对,正确设置如下:

./configure --prefix=/usr/local/tslib/ --host=arm-linux ac_cv_func_malloc_0_nonnull=yes


错误2:

在开发板上运行校正程序时出现No raw modules loaded

解决方法是把  tslib/etc目录下的ts.conf 的 "#module_raw input"的注释符号“#”去掉。但记住不要在前面留有 空格 ,否则会出现错误4


错误3:

在开发板上运行校正程序时出现Segmentation fault

解决方法是看错误2

错误4:
ts_open: No such file or directory                                              
环境变量没有设置好

原创粉丝点击