Tslib-1.4的嵌入式移植

来源:互联网 发布:seo分享ppt 编辑:程序博客网 时间:2024/05/14 04:30

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.cacheCC=/usr/local/arm/fsl-linaro-toolchain/bin/arm-none-linux-gnueabi-gcc ./configure –host=arm-none-linux-gnueabi –prefix=/work/Qt/Qt_Install/tslib1.4 –cache-file=arm-none-linux-gnueabi.cachemake && make install
  • 1
  • 2
  • 3
  • 4
  • 修改文件权限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/event0export  TSLIB_CALIBFILE=tool/tslib-1.4/etc/pointercalexport  TSLIB_CONFFILE=tool/tslib-1.4/etc/ts.confexport  TSLIB_PLUGINDIR=/tool/tslib-1.4/lib/tsexport  TSLIB_CONSOLEDEVICE=noneexport  TSLIB_FBDEVICE=/dev/fb0
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 修改ts.conf : vi /tool/tslib-1.4/etc/ts.conf
    去掉第二行前面的#号和空格
    更新下soucre /etc/profile

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

原创粉丝点击