вторник, 27 декември 2011 г.

New videos

Finally I succeeded setting up the development environment for building QtEmbedded 4.6.3 application using QtCreator. My intention was to make complete video tutorial on all the process from installing the tools to compiling a "hello world" application and running it on FriendlyARM. Lack of time doesn't allow me to complete it. That's why I decided to publish my video "notes". They have been on YouTube for some time. They are just record of my desktop with no comment. Also here are my text notes I made during the installation process. Hope somebody might find them usefull.

Here are the videos:
How to install the cross-copiler for mini2440 on host PC (Video 1)

How to compile QtEmbedded 4.6.3 for mini2440 (Video 2)

Install QtCreator and set it up for QtEmbedded. (Video 3)


-------------------------------------------------------------------------
**** PC Installation ****
1. Install the cross-compiler to  /usr/local/arm/4.3.2
 In  PATH variable add folder /usr/local/arm/4.3.2/bin

2. Compile QtEmbedded 4.6.3 on PC. The result of the compilation are the libraries for ARM (libQtCore.so.4.6.3, libQtGui.so.4.6.3 и т.н) and tools for PC like qmake, uic, moc etc. Do it as root
    3.1 Unzip arm-qte-463-20100802tar.gz
    3.2 Enter the  arm-qte-4.6.3 folder and run configuration script (config-options file shown in Video 2):

./configure -prefix /qtbuild/ -release -shared -fast -pch -no-qt3support -qt-sql-sqlite -no-libtiff -no-libmng -qt-libjpeg -qt-zlib -qt-libpng -qt-freetype -no-openssl -nomake examples -nomake demos -nomake tools -optimized-qmake -no-phonon -no-nis -no-opengl -no-cups -no-xcursor -no-xfixes -no-xrandr -no-xrender -no-xkb -no-sm -no-xinerama -no-xshape -no-separate-debug-info -xplatform qws/linux-arm-g++ -embedded arm -depths 16 -no-qvfb -qt-gfx-linuxfb -no-gfx-qvfb -no-kbd-qvfb -no-mouse-qvfb-qt-kbd-usb -confirm-license -qt-mouse-tslib

    The -prefix option determines location of the compiled files. I this case it is /qtbuild
Important: Use exactly this version!

    3.3 Compile (takes more than an hour):
        $ make (or gmake)
        $ make install (or gmake install)

3. Install IDE QtCreator
Make qt-sdk-linux-x86-opensource-2009.05.bin executable:

    LinuxHost>chmod +x qt-sdk-linux-x86-opensource-2009.05.bin
    LinuxHost>./qt-sdk-linux-x86-opensource-2009.05.bin

4. Configure QtCreator with path to qmake. The qmake tool uses the project file .pro to generate  Makefile
    From Tools-Options in QMake location add path /qtbuild/bin/qmake and click  rebuild

5. Examples - in folder arm-qte-4.6.3/qt-everywhere-opensource-src-4.6.3 there is en example. Open the  .pro file in QtCreator  and  build it.

------------------------------------------------------------
*** Configure FriendlyARM ***
The last FriendlyARM came with QtEmbedded 4.6.3 и tslib. If the board is older instead just install the file system rootfs_qtopia_qt4_20110305.img (option "y" in DWN) Doing this you don't have to upload the libraries to FriendlyARM.

This is done in Windows. Next step is to configure IP address and password with passwd command from console.
------------------------------------------------------------
*** GLOBAL VARIABLES ***

For applications to be abble to access the libraries global variables have to be set. Set them to use already installed in the file system libraries so you do not have to upload compiled QtEmbedded and tslib libraries. That's why using exactly 4.6.3 version is important.

Remark: check the fluidlauncher to see how you can make variables set on start

export USER LOGNAME PS1 PATH
export QTDIR=/usr/local/Trolltech/QtEmbedded-4.6.3-arm
export LD_LIBRARY_PATH=$QTDIR/lib
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_TSDEVICE=/dev/input/event0
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_CONFFILE=/usr/local/etc/ts.conf
export QWS_SIZE=800x480
export QWS_DISPLAY="LinuxFb:mmWidth135:mmHeight155"
export QWS_MOUSE_PROTO="Tslib:/dev/input/event0"
export TSLIB_PLUGINDIR=/usr/local/lib/ts 

Remark:Change the display size if necessary. This settings is for 7".
------------------------------------------------------------
*** fonts **
transfer from PC from /qtbuild/lib/fonts/ fonts to
 FriendlyARM  /usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/fonts
------------------------------------------------------------
*** TSLIB ***
When try to run Qt4 application from console if there is no link to tslibrary an error mesage is shown:
error while loading shared libraries: libts-0.0.so.0: cannot open shared object file: No such file or directory

Make symbol link:
ln -s /usr/local/lib/libts-0.0.so.0 /usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libts-0.0.so.0


------------------------------------------------------------
*** Screen Calibration ***
/usr/local/bin/ts_calibrate - this is the application for calibration
//it can be run from qtopia
------------------------------------------------------------
*** runnin the application ***
Diasble the Qtopia and run the application with qws option. It makes the application responsible for writing to the frame buffer. 
/myapp -qws

------------------------------------------------------------