mini2440 tslib1.4移植

tslib版本:tslib-1.4

交叉编译器版本: arm-linux-gcc 4.3.2

操作系统平台:  ubuntu10.10

开发板平台: Mini2440 

 开始移植:

 

 

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)

 

出现错误0:possible undefined macro: AS_HELP_STRING

可能是因为系统自带的autoconf工具里面没有定义这个宏,查看一下autoconf的版本

#autoconf V 2.57版的,

那么就从网上下一个比这个新一点的版本

http://download.chinaunix.net/download/0001000/648.shtml找到了2.64

又出现错误:no acceptable m4 could be found in $PATH

原因是安装autoconf工具,需要GNUm4工具,但是系统里没有这个工具,所以还要从网上down

http://ftp.gnu.org/gnu/m4/找到m4-1.14.13.tar.bz2

下载完后,进入m4-1.14.13目录,执行

 

新安装的autoconf工具就把/usr/bin下的可执行程序覆盖了,然后执行

#source /etc/profile

使环境变量生效,再查看 autoconf版本,确保是2.64

 

进入tslib目录,执行

# ./autogen.sh

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


#make

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



错误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                                             
环境变量没有设置好

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值