天天看点

Tslib-1.4的移植

PC系统: ubuntu14.04

嵌入式系统内核: linux3.0.35

嵌入式交叉编译工具:arm-linux-gcc-4.5.1(之前的文章有安装包)

tslib-1.4下载链接:http://download.csdn.net/detail/MKNDG/3291565

tslib-1.4的安装路径:/tool/tslib-1.4

  • 下载并解压tslib-1.4 ,进去其目录
  • 编写配置脚本Tslibconfig.sh:

    vi Tslibconfig.sh,内容如下:

#!/bin/sh
 echo “ac_cv_func_malloc_0_nonnull=yes”>arm-linux.cache
CC=/usr/local/arm/fsl-linaro-toolchain/bin/arm-none-linux-gnueabi-gcc ./configure –host=arm-none-linux-gnueabi –prefix=/work/Qt/Qt_Install/tslib1 –cache-file=arm-none-linux-gnueabi.cache
make && make install
           
  • 修改文件权限chmod 777 Tslibconfig.sh
  • 修改原目录下的 文件autogen.sh的权限

    chmod 777 autogen.sh

  • 先执行autogen.sh再执行Tslibconfig.sh
  • 如果出现以下报错信息:

    ts_test.o: In function

    main': ts_test.c:(.text+0x3b4): undefined reference to

    rpl_malloc’

    fbutils.o: In function

    open_framebuffer': fbutils.c:(.text+0x2f8): undefined reference to

    rpl_malloc’

    collect2: ld returned 1 exit status

    解决方法:

    执行# ./configure –host=mipsel-linux –prefix=/TSLIB后,在config.h中将“#define malloc rpl_mallo”注释掉,编译通过。

  • 设置环境变量

    vi /etc/profile

    在文件尾添加以下内容:

export  TSLIB_TSDEVICE=/dev/input/event0
export  TSLIB_CALIBFILE=tool/tslib-/etc/pointercal
export  TSLIB_CONFFILE=tool/tslib-/etc/ts.conf
export  TSLIB_PLUGINDIR=/tool/tslib-/lib/ts
export  TSLIB_CONSOLEDEVICE=none
export  TSLIB_FBDEVICE=/dev/fb0
           
  • 修改ts.conf : vi /tool/tslib-1.4/etc/ts.conf

    去掉第二行前面的#号和空格

    更新下soucre /etc/profile

  • 下面只要制作成根文件系统烧入arm板就行,并再 cd进去目录tslib的bin目录下,执行./ts_calibrate 校准

    在执行./ts_test测试划线