User Tools

Site Tools


cross-compiling_and_installing_tslib

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

cross-compiling_and_installing_tslib [2017/01/03 21:27] (current)
admin created
Line 1: Line 1:
 +===== Introduction =====
 +[[http://​tslib.berlios.de/​|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 [[http://​automon.donaloconnor.net/​date/​2009/​01/​|guide]] to cross-compile and run Qt appplications on the TS-739x. I also found [[http://​smcrook.blogspot.com/​2010/​10/​getting-tslib-and-qt-embedded-on-ts-tpc.html|this]] page very helpful, since I had some trouble making everything work fine.
  
 +==== Installing dependencies ====
 +Go ahead and install these dependencies:​
 +
 +<​code>​
 +sudo apt-get install automake libtool autoconf
 +</​code>​
 +
 +==== Getting Tslib ====
 +Download Donald O’connor’s prepatched library:
 +
 +<​code>​
 +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/
 +</​code>​
 +
 +Donald specifies in his TS7390 Configure file to start by typing this in the tslib-1.0 folder:
 +
 +<​code>​
 +echo "​ac_cv_func_malloc_0_nonnull=yes"​ > arm-linux.autogen
 +</​code>​
 +
 +That didn’t seem to work as I was getting errors during the compilation process (you can always try both). Instead, simply (according to [[http://​groups.google.com/​group/​ikarus-users/​browse_thread/​thread/​fd1d101eac32633f?​pli=1|this]] source) type:
 +
 +<​code>​
 +export ac_cv_func_malloc_0_nonnull=yes ​
 +</​code>​
 +
 +==== Setting your cross-compiling environment ====
 +To do this you will have to export your cross-compiler'​s path:
 +
 +<​code>​
 +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
 +</​code>​
 +
 +==== Configuring and installing the library ====
 +Specify the target you are building the library for:
 +
 +<​code>​
 +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
 +</​code>​
 +
 +Once is done, do a make and make install:
 +
 +<​code>​
 +make
 +
 +sudo make install
 +</​code>​
 +
 +==== Moving the library to the SBC ====
 +On the 739x type:
 +
 +<​code>​
 +mkdir /​usr/​local/​linux-arm
 +
 +chown -R eclipse:​eclipse /​usr/​local/​linux-arm
 +</​code>​
 +
 +Back on the development PC, move the library to the SBC:
 +
 +<​code>​
 +scp -r linux-arm/ eclipse@192.168.0.50:/​usr/​local/​
 +</​code>​
 +
 +==== 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:
 +
 +<​code>​
 +nano /​root/​.bashrc
 +</​code>​
 +
 +Add the following lines at the end:
 +
 +<​code>​
 +#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
 +</​code>​
 +
 +Ctrl X out of nano and type:
 +
 +<​code>​
 +$ su $ cd /​usr/​local/​linux-arm/​etc $ cp ts.conf ts.conf.old $ rm ts.conf $ vi ts.conf
 +</​code>​
 +
 +Add the following lines to the new file (do not add any blank lines!):
 +
 +<​code>​
 +module_raw input
 +module pthres pmin=1
 +module variance delta=30
 +module dejitter delta=100
 +module linear  ​
 +</​code>​
 +
 +Save the document, exit and type:
 +
 +<​code>​
 +$ chmod 777 /​dev/​input/​event0 $ cd /​usr/​local/​linux-arm/​bin $ ./​ts_calibrate
 +</​code> ​
 +
 +If it doesn'​t run, you may need to chmod the file so it is executable:
 +
 +<​code>​
 +$ chmod 777 ts_calibrate
 +</​code>​
 +
 +You’re done! Test your configuration:​
 +
 +<​code>​
 +$ cd /​usr/​local/​linux-arm/​bin $ ./ts_test
 +</​code>​
cross-compiling_and_installing_tslib.txt · Last modified: 2017/01/03 21:27 by admin