Sunday, October 24, 2010

Getting TSLIB and QT Embedded on TS-TPC-7395 Debian Lenny EABI Howto

Getting everything working on Lenny/EABI is a totally different ballgame than getting it running on Etch/OABI. This guide is assuming that you are doing your development on a Ubuntu 10.10 machine (either actual hardware or in a VirtualBox VM).

The first thing you need to do is get an EABI cross compiler. Technologic provides one on it's website but it really didn't work well for me. Much better is this one:

http://freaknet.org/martin/crosstool/packages/arm-ep9312-linux-gnueabi-gcc-g++-4.1.1-glibc-2.4-crosstool_0.42-1_i686.deb

Once you download it, go ahead and double click to install via Ubuntu's software center software. Once you have the compiler installed you need a few other packages from the repositories if you don't already have them. To get what you need run the following in your terminal:

$ sudo apt-get install automake libtool build-essential

The stock TSLIB won't work for the 7390/95. You need to get a patched version. You can also run the patch on a stock version yourself. See my post http://smcrook.blogspot.com/2010/10/tslib-patchfile-text-and-link-to.html for more details.

I'm going to assume that you've downloaded the prepatched TSLIB for the rest of the guide.

Unzip Patched TSLIB in ~/Downloads

Edit ~/.bashrc and /root/.bashrc add the following
export PATH=$PATH:/usr/arm-ep9312-linux-arm-gnueabi/bin
alias arm-ep9312-linux-gnueabi-gcc='/usr/arm-ep9312-linux-arm-gnueabi/bin/gcc'
alias arm-ep9312-linux-gnueabi-g++='/usr/arm-ep9312-linux-arm-gnueabi/bin/g++'
alias arm-ep9312-linux-gnueabi-ar='/usr/arm-ep9312-linux-arm-gnueabi/bin/ar'
alias arm-ep9312-linux-gnueabi-objcopy='/usr/arm-ep9312-linux-arm-gnueabi/bin/objcopy'
alias arm-ep9312-linux-gnueabi-strip='/usr/arm-ep9312-linux-arm-gnueabi/bin/strip'

In terminal (Note: The patched TSLIB comes in a .zip file so when you unzip it it creates a second tslib-1.0 folder in the hierarchy)

$ cd ~/Downloads/tslib-1.0/tslib-1.0
$ sudo sh configure CC=arm-ep9312-linux-gnueabi-gcc CXX=arm-ep9312-linux-gnueabi-g++ PLUGIN_DIR=/usr/local/linux-arm-eabi/plugins -prefix=/usr/local/linux-arm-eabi -host=arm-linux

Edit config.h and comment out rpc_malloc near the end of the file

$ sudo make
$ sudo make install

Download QT Everywhere 4.5.3 from nokia

$ cd ~/Downloads
$ tar -xzvf qt-embedded-linux-src-4.5.3.tar.gz
$ cd qt-embedded-linux-src-4.5.3/
$ export QTDIR=$PWD
$ export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
$ cd /src/gui/embedded
$ gedit qscreenlinuxfb_qws.cpp

Apply TS7390/95 Color patch Per Donal's guide

$ cd $QTDIR/mkspecs/qws/linux-arm-gnueabi-g++
$ gedit qmake.conf

Replace the contents of the file with this:
#
# qmake configuration for building with arm-none-linux-gnueabi-g++
#

include(../../common/g++.conf)
include(../../common/linux.conf)
include(../../common/qws.conf)

QMAKE_INCDIR += /usr/local/linux-arm-eabi/include
QMAKE_LIBDIR += /usr/local/linux-arm-eabi/lib

# modifications to g++.conf
QMAKE_CC                = arm-ep9312-linux-gnueabi-gcc
QMAKE_CXX               = arm-ep9312-linux-gnueabi-g++
QMAKE_LINK              = arm-ep9312-linux-gnueabi-g++
QMAKE_LINK_SHLIB        = arm-ep9312-linux-gnueabi-g++

# modifications to linux.conf
QMAKE_AR                = arm-ep9312-linux-gnueabi-ar cqs
QMAKE_OBJCOPY           = arm-ep9312-linux-gnueabi-objcopy
QMAKE_STRIP             = arm-ep9312-linux-gnueabi-strip

load(qt_config)

Save the file and quit your text editor.

Back in your terminal:

$ cd $QTDIR
$ ./configure -embedded arm -xplatform qws/linux-arm-g++ -no-qvfb -depths all -qt-mouse-tslib -qt-kbd-usb -I/usr/local/arm/tslib/include -L/usr/local/arm/tslib/lib
$ make
$ sudo make install
As with the Etch/OABI guides, this will install the ARM compiled QT Embedded in /usr/local/Trolltech. For details on loading QT Embedded on the 7395 check out another of Donal's Guides

Before you can use TSLIB you need to run ts_calibrate on your board and set up the proper environment variables. For more information I have a step by step guide here (This was originally for Etch/OABI but it will work for Lenny as well) http://smcrook.blogspot.com/2010/10/getting-tslib-working.html

No comments:

Post a Comment