1) Download Qt from ‘http://qt-project.org/downloads’ the latest stable release of the Qt Libraries for Embedded Linux (e.g. http://releases.qt-project.org/qt4/source/qt-everywhere-opensource-src-4.8.3.tar.gz).
a. mkdir ~/qt
b. cd ~/qt
c. wget http://releases.qt-project.org/qt4/source/qt-everywhere-opensource-src-4.8.3.tar.gz
d. tar -xvzf qt-everywhere-opensource-src-4.8.3.tar.gz
e. Install Necessary Packages:
i. sudo apt-get install libgmp3-dev
ii. sudo apt-get install libmpfr
iii. sudo apt-get install zlib1g-dev
iv. sudo apt-get install libncurses5-dev
f. cd qt-everywhere-opensource-src-4.8.3
g. gedit mkspecs/qws/linux-arm-gnueabi-g++/qmake.conf and change all of the ‘arm-none’ to ‘arm-angstrom’ to match the compiler executables…
h. Including ‘tslib’:
i. Install Necessary Packages:
1. sudo apt-get install autoconf
2. sudo apt-get install libtool
ii. cd ~
iii. git clone https://github.com/kergoth/tslib.git
iv. cd tslib
v. Don’t Forget: . ~/.oe/environment-angstromv2012.05
vi. ./autogen.sh
vii. ./configure --prefix=$HOME/tslib_beaglebone --host=arm-angstrom-linux-gnueabi
viii. make
ix. make install
x. Output files can be found in ~/tslib_beaglebone/
1. Copy the ‘/lib’ directory to ‘/usr/lib’ on the beaglebone.
2. Copy the ‘/bin’ directory to the ‘/usr/bin’ on the beaglebone.
3. Copy ‘/etc/ts.conf’ to ‘/etc’ on the beaglebone.
4. Uncomment line 2 in ts.conf, i.e. ‘module_raw input’
5. Call the following from the Beaglebone command line (or make a script):
a. export QWS_MOUSE_PROTO=tslib:/dev/input/event0
b. export TSLIB_CALIBFILE=/etc/pointercal
c. export TSLIB_CONFFILE=/etc/ts.conf
d. export TSLIB_PLUGINDIR=/usr/lib/ts
6. Run ‘ts_calibrate’ and complete the calibration. Call ‘cat /etc/pointercal’ to verify the calibration file has been written.
xi. Add the following lines to / qt-everywhere-opensource-src-4.8.3/ mkspecs/qws/linux-arm-gnueabi-g++/qmake.conf :
1. QMAKE_INCDIR += /home/bone/tslib/src
2. QMAKE_LIBDIR += /home/bone/tslib_beaglebone/lib
2) Configure and build Qt: LAST USED COMMAND: ./configure -v -opensource -confirm-license -xplatform qws/linux-arm-gnueabi-g++ -embedded arm -little-endian -prefix /opt/qt-arm -no-cups -no-accessibility -reduce-relocations -no-nas-sound -no-sm -no-nis -qt-libjpeg -qt-libpng -qt-zlib -no-sql-ibase -no-sql-mysql -no-sql-odbc -no-sql-psql -no-sql-sqlite -no-sql-sqlite2 -no-pch -no-dbus -no-glib -no-phonon -no-phonon-backend -no-webkit -no-multimedia -no-audio-backend -no-qt3support -nomake docs -nomake translations -exceptions -no-fast -qt-mouse-tslib
3) make
4) make install
5) copy all .so files from ‘/opt/qt-arm/lib/’ on the host ubuntu machine to the same location on the beaglebone:
a. From Ubuntu:
i. cd /opt/qt-arm/lib
ii. tar -cpvzf qt_arm_lib.tar.gz *
b. From the beaglebone:
i. mkdir /opt
ii. mkdir /opt/qt-arm
iii. mkdir /opt/qt-arm/lib
iv. cd /opt/qt-arm/lib
v. scp bo...@10.192.0.115:/opt/qt-arm/lib/qt_arm_lib.tar.gz ./
vi. tar -xvf qt_arm_lib.tar.gz
vii. export LD_LIBRARY_PATH=/opt/qt-arm/lib:$LD_LIBRARY_PATH
6) Install Packages (not sure if absolutely necessary):
a. opkg install libgles-omap3
b. opkg install libstdc++6
c. opkg install libpng12-0
7) Test out an example (on the beaglebone):
a. cd ~
b. mkdir qttest
c. cd qttest
d. scp bo...@10.192.0.115:/opt/qt-arm/examples/animation/stickman/stickman ./
e. ./stickman -qws
Good luck!I've been trying to get my LCD7 to calibrate correctly when running a Qt application, but I have not had any luck. I've tried several approaches and refereced the following links:Here is what I've done so far:1. Downloaded tslib and compiled. No issues here. I verified that ts_calibrate is an ARM executable.2. Downloaded Qt 4.8.4 and modified the mkspecs/qws/linux-arm-gnueabi-g++/qmake.conf file and added the following lines:QMAKE_INCDIR = /home/brent/tslib_arm/include
QMAKE_LIBDIR = /home/brent/tslib_arm/lib
QMAKE_LFLAGS = -lts3. Tried building Qt:
ro...@ubuntu:~/Downloads/qt-everywhere-opensource-src-4.8.4# ./configure -embedded arm -xplatform qws/linux-arm-gnueabi-g++ -qt-kbd-linuxinput -qt-mouse-tslib -qt-gfx-linuxfb -little-endian -prefix-install -depths 16,18,24 -optimized-qmake -release -opensource -confirm-license
Hi Andrew,
Thanks very much for posting a detailed guide. I am, however, stuck on a 'simple' step. When you say "Don’t Forget: . ~/.oe/environment-angstromv2012.05" when making tslib, what exactly do you mean? I am a beginner to linux and am unaware as to what to do there. I've searched online and used trial/error for a few hours for anything that could help me but nothing I found/did works. It looks like it's specifying the build environment so 'make' knows which compiler/linker to use, etc. I tried following your steps but skipping that step, and ts_calibrate (the only one I tried) doesn't run ("cannot execute binary file") on the board. I see when running make that it was using plain old gcc, which I think is wrong (should be arm-angstrom-linux-gnueabi-gcc). I also see when running configure that it's Not cross compiling (I'd assume that check would be Yes). I tried adding CC=arm-angstrom-linux-gnueabi-gcc to the make command which did force it to use the right compiler, but when it gets to the linking steps it reverts to using plain gcc and immediately errors out ("file in wrong format"). I'm unaware of any flags for make (like CC) that will force it to use a certain linker.
I should also mention that I am using the LCD4 with the newest Angstrom release (11-22-12) because it's the only release that supports that newly-released LCD model. That build of Angstrom already has tslib installed. As a result, I originally thought I could skip the whole building tslib steps altogether. I can build Qt with the -qt-mouse-tslib argument and apps can run, but I still have the same problem as the OP: "If I try to run my Qt application without this built into Qt, the touchscreen is terrible. It's like it's configured to only work in a 2"x2" square in the middle of the screen." Also, it's as if the Qt app 'isn't there' because I can click on things on the desktop behind the app - there is a small square around the cursor which shows the desktop through the running app.
I've read this post in which Davide Rondini says he was able to get things working without recompiling Qt by using an export command, but I've tried that already (as well as other suggested similar exports) and it still doesn't work. I'm pretty close to getting tslib compiled myself anyway so I figure it's worth a shot. Does anyone know if it's even necessary with the newest release of Angstrom since the libs are included already? Thanks much!
-Seth