V3s移植 tslib1.0

开发环境
PC系统:ubuntu-16.04-desktop-amd64.iso
交叉编译器:gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf
硬件平台:V3s
linux版本:zero-4.14.y分支

tslib源码下载
https://github.com/libts/tslib/releases 下载 tslib-1.0.tar.gz

安装tslib相关依赖

sudo apt-get install autoconf
sudo apt-get install automake
sudo apt-get install libtool

开始移植

开始前请先安装交叉编译工具gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf 。

1、解压 tslib-1.0.tar.gz ,进入解压后的路径

tar xzf tslib-1.0.tar.gz
cd tslib-1.0

2、配置、编译和安装tslib,安装成功后可以在/usr/tslib4arm下看到bin、lib、include等目录

./autogen.sh
echo "ac_cv_func_malloc_0_nonnull=yes" > arm-linux.cache
./configure --host=arm-linux-gnueabihf --prefix=/usr/tslib4arm  --cache-file=arm-linux.cache
mkdir -p /usr/tslib4arm
make
make install

3、在你要制作的根文件系统usr目录下创建tslib4arm目录,将PC机/usr/tslib4arm目录下的bin、lib和etc目录复制到你要制作的根文件系统的/usr/tslib4arm目录下

cd  /opt/rootfs/usr/tslib4arm/(进入你根文件系统下的/usr/tslib4arm/目录)
cp  /usr/tslib4arm/bin  /usr/tslib4arm/etc  /usr/tslib4arm/lib   ./ -dr     (复制bin、lib和etc)

4、创建tslib环境变量设置脚本,命名为ts_init,放入你创建的根文件系统的sbin/目录
注意是sbin目录,不是usr/sbin。

#!/bin/sh
export T_ROOT=/usr/tslib4arm                        #目录
export TSLIB_TSDEVICE=/dev/event1                     #触摸屏设备文件
export TSLIB_CALIBFILE=/etc/pointercal                #指定触摸屏校准文件pintercal的存放位置
export TSLIB_CONFFILE=$T_ROOT/etc/ts.conf             #tslib模块配置文件
export TSLIB_PLUGINDIR=$T_ROOT/lib/ts/                #tslib插件库目录
export TSLIB_CONSOLEDEVICE=/dev/tty
export TSLIB_FBDEVICE=/dev/fb0                        #framebuffer设备文件
echo "tslib init success!"

把ts_init添加入根文件系统etc/profile文件中,以便开机时加载这些环境变量。

cd ./rootfs
vim  ./etc/profile
#在后面加入. ts_init,前面有个点是保证ts_init脚本中设置的变量成为全局变量。
. ts_init
#生效
source /etc/profile

5、修改你创建的根文件系统etc/目录下的ts.conf(由tslib编译自动生成的)

vim ./etc/ts.conf
编辑ts.conf去掉module_raw  input 前面的注释,注意前面不能有空格,否则会报“Segmentation fault”错误。

6、测试
#cd /usr/tslib4arm/bin
#./ts_calibrate

在这里插入图片描述
出现以上错误,selected device is not a touchscreen I understand

问题未解决!最后用buildroot构建的tslib成功。。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Yfw&武

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值