User Tools

Site Tools


cross-compiling_and_installing_tslib

Introduction

Tslib is an abstraction layer for touchscreen panel events, as well as a filter stack for the manipulation of those events. In order to display graphics using the TS-739x, Tslib has to be cross-compiled in a normal PC and then moved to the SBC. After you successfully install Tslib, you'll be able to calibrate your touchscreen and test it! I based this work on Donnal Oconnor's guide to cross-compile and run Qt appplications on the TS-739x. I also found this page very helpful, since I had some trouble making everything work fine.

Installing dependencies

Go ahead and install these dependencies:

sudo apt-get install automake libtool autoconf

Getting Tslib

Download Donald O’connor’s prepatched library:

mkdir -p ~/project/downloads

cd ~/project/downloads

wget http://automon.donaloconnor.net/files/tslib-1.0.zip

mkdir -p ~/project/sysapps

cd ~/project/sysapps/

mkdir tslib

cd tslib/

unzip ../../downloads/tslib-1.0.zip

cd tslib-1.0/

Donald specifies in his TS7390 Configure file to start by typing this in the tslib-1.0 folder:

echo "ac_cv_func_malloc_0_nonnull=yes" > arm-linux.autogen

That didn’t seem to work as I was getting errors during the compilation process (you can always try both). Instead, simply (according to this source) type:

export ac_cv_func_malloc_0_nonnull=yes 

Setting your cross-compiling environment

To do this you will have to export your cross-compiler's path:

export CC=/usr/local/opt/crosstool/arm-linux/gcc-3.3.4-glibc-2.3.2/bin/arm-linux-gcc

export CXX=/usr/local/opt/crosstool/arm-linux/gcc-3.3.4-glibc-2.3.2/bin/arm-linux-g++

export CONFIG_SITE=arm-linux.autogen

Configuring and installing the library

Specify the target you are building the library for:

chmod 755 autogen.sh

./autogen.sh

./configure CC=arm-linux-gcc CXX=arm-linux-g++ PLUGIN_DIR=/usr/local/linux-arm/plugins -prefix=/usr/local/linux-arm -host=arm-linux

Once is done, do a make and make install:

make

sudo make install

Moving the library to the SBC

On the 739x type:

mkdir /usr/local/linux-arm

chown -R eclipse:eclipse /usr/local/linux-arm

Back on the development PC, move the library to the SBC:

scp -r linux-arm/ eclipse@192.168.0.50:/usr/local/

Configuring Tslib

You need to configure the library in order for it to work (I followed the instructions available [http://opentom.org/Tslib here]). Start by opening this file:

nano /root/.bashrc

Add the following lines at the end:

#added this for tslib
export TSLIB_TSEVENTTYPE=H3600
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_TSDEVICE=/dev/input/event0
export TSLIB_CALIBFILE=/usr/etc/pointercal
export TSLIB_CONFFILE=/usr/etc/ts.conf
export TSLIB_PLUGINDIR=/usr/local/linux-arm/lib/ts

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/linux-arm/lib/:/usr/local/lib:/usr/local/Trolltech/QtEmbedded-4.5.3-arm/lib/
export QWS_MOUSE_PROTO=Tslib

Ctrl X out of nano and type:

$ su $ cd /usr/local/linux-arm/etc $ cp ts.conf ts.conf.old $ rm ts.conf $ vi ts.conf

Add the following lines to the new file (do not add any blank lines!):

module_raw input
module pthres pmin=1
module variance delta=30
module dejitter delta=100
module linear  

Save the document, exit and type:

$ chmod 777 /dev/input/event0 $ cd /usr/local/linux-arm/bin $ ./ts_calibrate

If it doesn't run, you may need to chmod the file so it is executable:

$ chmod 777 ts_calibrate

You’re done! Test your configuration:

$ cd /usr/local/linux-arm/bin $ ./ts_test
cross-compiling_and_installing_tslib.txt · Last modified: 2017/01/03 21:27 by admin