测试平台

宿主机平台:Ubuntu 12.04.4 LTS

目标机:Easy-ARM IMX283

目标机内核:Linux 2.6.35.3

tslib 1.4 下载  https://gitlab.com/tslib/tslib/-/archive/1.4/tslib-1.4.tar.gz

备注:建议用 tslib 1.0(测试正常)

tslib 1.4编译移植

1.tslib编译

tslib编译依赖

sudo apt-get install autoconf automake autogen libtool libsysfs-dev

解压,automake生成makefile

tar xzf tslib-1.4.tar.gz
cd tslib-1.4
./autogen.sh

出现以下问题

反映的是一些宏定义没有定义,aclocal是个扫描程序, 负责扫描configure.ac中所有的宏定义并展开;

出现上述应该是相关宏定义工具没有安装(但所有依赖工具均安装OK)或者 aclocal 出现问题;

查询 aclocal 路径

aclocal --print-ac-dir

但在对应目录却发现没有次目录 ,应该是不同版本安装、或系统升级导致文件夹丢失

chmod 777 /usr/local/share

将 usr/share/aclocal 文件夹拷贝到 /usr/local/share 下;

在此运行 ./autogen.sh

2. 编译配置、编译及安装

新建安装文件目录

mkdir -p install
chmod 777 install

编译配置

./configure --prefix=$(pwd)/install --host=arm-linux ac_cv_func_malloc_0_nonnull=yes CC=arm-fsl-linux-gnueabi-gcc

然后编译 make,出现错误

input-raw.c: In function 'check_fd':
input-raw.c:188: error: 'ABS_MT_PRESSURE' undeclared (first use in this function)
input-raw.c:188: error: (Each undeclared identifier is reported only once
input-raw.c:188: error: for each function it appears in.)
input-raw.c:199: error: 'ABS_MT_SLOT' undeclared (first use in this function)
input-raw.c: In function 'ts_input_read_mt':
input-raw.c:515: error: 'ABS_MT_PRESSURE' undeclared (first use in this function)
input-raw.c:520: error: 'ABS_MT_TOOL_X' undeclared (first use in this function)
input-raw.c:525: error: 'ABS_MT_TOOL_Y' undeclared (first use in this function)
input-raw.c:540: error: 'ABS_MT_DISTANCE' undeclared (first use in this function)
input-raw.c:577: error: 'ABS_MT_SLOT' undeclared (first use in this function)
make[2]: *** [input-raw.lo] 错误 1
make[2]:正在离开目录 `/home/vmuser/wtools/tslib-1.4/plugins'
make[1]: *** [all-recursive] 错误 1
make[1]:正在离开目录 `/home/vmuser/wtools/tslib-1.4'
make: *** [all] 错误 2

这主要是 tslib 1.4 的 input与 linux 内核的不匹配,使用高版本 linux 内核应该没有该问题

首先 交叉编译工具的 input.h 应该 与 使用Linux 内核 的 input,h 的 ENV_VERSION 一致;

tslib-1.4/plugins/input-raw.h

#ifndef ABS_MT_POSITION_X
#define ABS_MT_SLOT 0x2f /* MT slot being modified */
#define ABS_MT_TOUCH_MAJOR 0x30 /* Major axis of touching ellipse */
#define ABS_MT_TOUCH_MINOR 0x31 /* Minor axis (omit if circular) */
#define ABS_MT_WIDTH_MAJOR 0x32 /* Major axis of approaching ellipse */
#define ABS_MT_WIDTH_MINOR 0x33 /* Minor axis (omit if circular) */
#define ABS_MT_ORIENTATION 0x34 /* Ellipse orientation */
#define ABS_MT_POSITION_X 0x35 /* Center X touch position */
#define ABS_MT_POSITION_Y 0x36 /* Center Y touch position */
#define ABS_MT_TOOL_TYPE 0x37 /* Type of touching device */
#define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */
#define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */
#define ABS_MT_PRESSURE 0x3a /* Pressure on contact area */
#define ABS_MT_DISTANCE 0x3b /* Contact hover distance */
#define ABS_MT_TOOL_X 0x3c /* Center X tool position */
#define ABS_MT_TOOL_Y 0x3d /* Center Y tool position */
#endif

而 Linux 2.6.35的内核的 也就是常用的 linux/input

#define ABS_MT_TOUCH_MAJOR    0x30    /* Major axis of touching ellipse */
#define ABS_MT_TOUCH_MINOR 0x31 /* Minor axis (omit if circular) */
#define ABS_MT_WIDTH_MAJOR 0x32 /* Major axis of approaching ellipse */
#define ABS_MT_WIDTH_MINOR 0x33 /* Minor axis (omit if circular) */
#define ABS_MT_ORIENTATION 0x34 /* Ellipse orientation */
#define ABS_MT_POSITION_X 0x35 /* Center X ellipse position */
#define ABS_MT_POSITION_Y 0x36 /* Center Y ellipse position */
#define ABS_MT_TOOL_TYPE 0x37 /* Type of touching device */
#define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */
#define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */

不支持某些触摸类型的定义,因此需要手动添加到顶层头文件中,因为后面的 ts_test_mt.c 也会使用


#define ABS_MT_SLOT             0x2f    /* MT slot being modified */
#define ABS_MT_PRESSURE         0x3a    /* Pressure on contact area */
#define ABS_MT_DISTANCE 0x3b /* Contact hover distance */
#define ABS_MT_TOOL_X 0x3c /* Center X tool position */
#define ABS_MT_TOOL_Y 0x3d /* Center Y tool position */

我们将这些添加到 tslib-1.4/config.h 中,后面编译出错的文件 在头部添加 #include "config.h" 即可

我这里主要在以下文件添加

tslib-1.4/tools/ts_uinput.c

tslib-1.4/tests/ts_test_mt.c

tslib-1.4/tests/ts_print_mt.c

tslib-1.4/tests/ts_print_raw_mt.c

然后 make 正常

make inatall

可以看到该指定的安装目录instal下l有4 个文件夹 /bin 、 /etc 、 /lib 、 /include

3. tslib移植及测试

先将上面安装 install 文件见 拷贝到 nfs 调试目录 并命名为 tslib

通过nfs挂载将 tslib 下载到开发板的 /usr/local/下

root@EasyARM-iMX28x /mnt/vm_tools# cp -r tslib /usr/local/

修改开发板的环境变量文件,添加如下内容

vi /etc/profile
#指定 tslib 目录路径
export TSLIB_ROOT=/usr/local/tslib
#指定 tslib 插件文件的路径
export TSLIB_PLUGINDIR=$TSLIB_ROOT/lib/ts
#指定 tslib 配置文件的路径
export TSLIB_CONFFILE=$TSLIB_ROOT/etc/ts.conf
#指定触摸屏设备
export TSLIB_TSDEVICE=/dev/input/ts0
#指定校准文件的存放位置
export TSLIB_CALIBFILE=/etc/pointercal
#指定鼠标设备
export QWS_MOUSE_PROTO=/dev/input/ts0
#指定帧缓冲设备
export TSLIB_FBDEVICE=/dev/fb0
#添加 tslib 库
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TSLIB_ROOT/lib

tslib测试:校准测试

cd /usr/local/tslib/bin
# ./ts_calibrate

开发板出现校准界面,则至此, tslib 的安装和移植已经成功完成。

触摸设备检测

hexdump /dev/input/event0

tslib移植arm及使用的更多相关文章

  1. tslib移植笔记(1)【转】

    本文转载自:https://blog.csdn.net/zijie_xiao/article/details/50740950 tslib移植笔记(1)2016-04-25 tslib背景[摘自百度] ...

  2. Tslib移植与分析【转】

    转自:http://blog.csdn.net/water_cow/article/details/7215308 目标平台:LOONGSON-1B开发板(mips32指令集)编译平台:x86PC-- ...

  3. tslib移植中环境变量编辑

    (1)将/usr/local/tslib下的所有文件复制到移植系统文件中/usr/local(2)编辑移植系统中/etc/profile添加触摸屏支持内容:在/etc/profile文件中设置tsli ...

  4. 移植ARM linux下远程连接工具dropbear

    移植ARM linux下远程连接工具dropbear 原文地址:http://www.cnblogs.com/NickQ/p/9010529.html 移植zlib 下载地址:https://gith ...

  5. 最新QT4.8+kernel_3.2.5+uboot_2010.06+tslib移植成功-问题小结

    2012-02-19 21:34:13 都是从源码下载然后自己修改,使用与TQ2440,之前uboot其实已经完成了.但是yaffs2没带起来.现在回头看来是很简单的了.bootargs参数中我设置成 ...

  6. 【转载】tslib移植_freescale imx6

    本文来自网络:http://blog.csdn.net/xishuang_gongzi/article/details/49422879 环境:host:Ubuntu12.04target:frees ...

  7. tslib 移植问题与解决方法

    问题一.执行脚本.提示出错,错误有"cann't exec aclocal" ,错误提示最多的是关于aclocal的问题,查资料显示这个文件是automake必备一个文件,好吧,那 ...

  8. Tensorflowlite移植ARM平台iMX6

    一.LINUX环境下操作: 1.安装交叉编译SDK (仅针对该型号:i.MX6,不同芯片需要对应的交叉编译SDK) 编译方法参考:手动编译用于i.MX6系列的交叉编译SDK 2.下载Tensorflo ...

  9. Tensorflow模型移植Arm之一:C与Python互相调用

    一.C调用Python 1.新建一个Python文件,名称为py_multipy.py: #import numpy as np def multiply(a=1,b=2): print('Funct ...

随机推荐

  1. 自学linux——6.安全外壳协议(ssh服务)

    ssh服务 ssh(secure shell)安全外壳协议:远程连接协议,远程文件传输协议 1.协议使用端口号默认:22 若要修改,则修改ssh服务的配置文件/etc/ssh/ssh_config a ...

  2. Nginx 解析漏洞

    目录 漏洞复现 漏洞成因 修复方案 参考链接 该漏洞与Nginx.php版本无关,属于用户配置不当造成的解析漏洞. 漏洞复现 访问http://172.17.0.1/uploadfiles/nginx ...

  3. BUUCTF-[网鼎杯 2018]Fakebook(SSRF+联合注入绕Waf)

    记一道SSRF配合SQL注入的题. 喜欢在做题之前扫一下网站的目录,扫到了robots.txt文件可以访问,拿到user.php.bak的源码.同时还有flag.php. <?php class ...

  4. C++ 1 (只在源文件)//点和圆的关系 //设计一个圆形类 和一个点类 计算点和圆的关系 //点到圆心的距离 == 半径 点在圆上 //点到圆心的距离 > 半径 点在圆外 //点到圆心的距离 < 半径 点在圆内 //点到圆心的距离 获取 ....... (x1 -x2)^2 + (y1-y2)^2 开根号 和半径对比 // 计算 可以 两边同时 平方

    1 //点和圆的关系 2 //设计一个圆形类 和一个点类 计算点和圆的关系 3 //点到圆心的距离 == 半径 点在圆上 4 //点到圆心的距离 > 半径 点在圆外 5 //点到圆心的距离 &l ...

  5. 为什么大部分的Android开发成为不了架构师

    小团队一般 10 人左右,其中常常是技术最牛的人做架构师(或TL).所以,架构师在广大码农中的占比大概平均不到 10%.而架构师也可以分为初级.中级.高级三档,江湖上真正高水平的软件架构师就更少了. ...

  6. 易语言效率与C++究竟差多少(质数和计算)

    文本首发bIlibili,cnblogs为作者补发,如在其他平台看见本文,均为经允许的盗窃 易语言作为款主打 中文 易用 编程的开发软件.但是很多人都在批评易语言的效率. 我们今天通过 质数和计算 来 ...

  7. 去掉文件中的^M

    一般情况下用:set ff=unix就可以解决问题,如果无效,用下面的方法手工完成: :%s/[ctrl+v] [ctrl+m]//g ctrl+v表示按住Ctrl键再按下v键.

  8. Required request body is missing-请求接口报错

    一.问题由来 自己目前在做一个小程序的后台,已经写好了项目中的很多的接口,同时也在进行一些修改,比如添加拦截器,统一校验一个固定的参数是否正确. 在自己添加拦截器之前,这些接口都可以正常访问,可是在添 ...

  9. Sqli-Labs less46-53

    less-46 前置基础知识: select * from users order by 1 desc ;使用降序(倒序)排列 select * from users order by 1 asc ; ...

  10. 博客CSS样式 二

    预览 可自行更改颜色 背景图 页面定制 CSS 代码中加入: url为背景图地址,可下载心仪背景图后上传到博客园相册后获取地址 body { color: #000; background: url( ...