Port qtembedded 4.6.3 tslib1.4 to S3C2440

Source: Internet
Author: User

1. Download the source code package:

Download the latest QT for Embedded from the official QT website.

Download the latest tslib1.4 version.

 

2. Configure the cross-compilation environment

Download the cross-compilation tool arm-Linux-GCC 4.3.2 (the version of the Cross-compilation tool depends on the version used during system kernel compilation in the Development Board, I used this version of the mini2440 kernel for cross-compiler compilation, so this compiler is used)

Run

Export Path =/usr/local/ARM/4.3.2/bin: $ path

It is recommended to write the script setcrossenv. Sh for later execution.

 

3. Cross-compile tslib1.4

A. Install the program required for the compilation process
Root @ hrixin-desktop:/home/hrixin # apt-Get install Autoconf (or autoconf2.13)
Root @ hrixin-desktop:/home/hrixin # apt-Get install automake
Root @ hrixin-desktop:/home/hrixin # apt-Get install libtool

 

B. Configure Compilation
Root @ hrixin-desktop:/work/Qt # tar xzvf tslib-1.4.tar.gz
Root @ hrixin-desktop:/work/Qt # cd tslib
Generate./configure
Root @ hrixin-desktop:/work/QT/tslib # source autogen. Sh

Note: This step will cause invalid cross-compiler environment variables. Check whether the cross-compiler environment variables are set. If not, perform step 2.
Root @ hrixin-desktop:/work/QT/tslib #./configure -- prefix =/usr/local/tslib/-- Host = arm-Linux ac_cv_func_malloc_0_nonnull = Yes
Root @ hrixin-desktop:/work/QT/tslib # Make

 

Error: Call to '_ open_missing_mode' declared with attribute error: open with o_creat in second argument needs 3 arguments

The solution is as follows:

When using the open function, if o_creat is used in the second parameter, you must add the third parameter: initial permission granted when creating the file. While in the gcc-3.3.6/GCC/collect2.c file there is an error missing the third parameter, while the gcc-4.3 check for syntax errors is strictly out of the name (4.1 won't exit due to this error ), so I quit.

Row 227,229 cal_fd = open ("/etc/pointercal", o_creat | o_rdwr, 0777 );

 

C. Installation
Root @ hrixin-desktop:/work/QT/tslib # make install-strip // generate slimming applications and libraries

Tip: After the installation is complete, go to the/usr/local/tslib/bin directory and run the file command to check whether the application version is arm. If the display shows that arm indicates that the cross-compilation is successful, otherwise, x86 is displayed, in this case, you need to reset the environment variable, reconfigure it, generate makefile, and make again.

Modify/usr/local/tslib/etc/ts. conf and remove the comments before the second line.
Package


Root @ hrixin-desktop:/usr/local # tar czvf tslib.tar.gz tslib

D. copy to the USB flash drive.
For copying to the Development Board

 

E. Set environment variables and calibrate the touch screen.
Create a script file on the open-board terminal and execute:
Export tslib_root =/usr/local/tslib # path of tslib
Export tslib_tsdevice =/dev/input/event0 # specify the node file of the touch screen device
Export tslib_conffile = $ tslib_root/etc/ts. conf # specify the location of the tslib configuration file
Export tslib_plugindir = $ tslib_root/lib/TS # specifies the path of the touch screen plug-in.
Export tslib_calibfile =/etc/pointercal # specify the storage location of the touch screen calibration file pintercal
Export tslib_fbdevice =/dev/fb0 # specify the Frame Buffer Device
Export qws_mouse_proto = tslib:/dev/input/event0

Note: The premise of the touch screen is that your touch screen driver has been written and loaded into the kernel.
You can test whether the touch screen driver is loaded, CAT/dev/input/event0 (this is just the touch screen on my board ),
Click the touch screen to check whether the terminal is displayed. If yes, the display is correct.

Run the calibration touch screen program in the Development Board/usr/local/tslib/bin directory:
[Root @ friendlyarm bin] #./ts_calibrate
You can run other programs in this directory for testing.

So far, the touch screen program can run smoothly, then transplant QtEmbedded-4.5.2, set environment variables.

 

 

 

 


6. Compile and install the QtEmbedded-4.5.2-arm version

A. decompress the package
Root @ hrixin-desktop:/work/QTE # tar xjvf qt-embedded-linux-opensource-src-4.5.2.tar.bz2
Root @ hrixin-desktop:/work/QTE # Music qt-embedded-linux-opensource-src-4.5.2 qt-embedded-linux-opensource-src-4.5.2-arm
Root @ hrixin-desktop:/work/QTE # qt-embedded-linux-opensource-src-4.5.2-arm CD

B. Configuration Compilation:

./Configure-H view the configuration options.

./Configure-Prefix/usr/local/qtembedded-arm/

-Embedded ARM/

-Release/

-Opensource/

-Fast/

-No-accessibility/

-No-scripttools/

-No-MMX/

-No-multimedia/

-No-SVG/

-No-WebKit/

-No-3dnow/

-No-SSE/

-No-sse2/

-Silent/

-QT-libpng/

-QT-libjpeg/

-No-libmng/

-No-LibTIFF/

-No-multimedia/

-Make libs-nomake tools-nomake examples-nomake docs-nomake demo/

-No-Nis-no-cups-no-iconv-no-signature-no-OpenSSL/

-Xplatform qws/Linux-arm-G ++/

-Little-Endian/

-QT-FreeType-Depths 16, 18-QT-GFX-linuxfb-no-GFX-transformed-no-GFX-multiscreen/

-No-GFX-VNC/

-No-GFX-qvfb/

-QT-KBD-linuxinput/

-No-glib/

-QT-mouse-tslib/

-I/usr/local/tslib/include/

-L/usr/local/tslib/lib/

Note that this directory must be the same as your tslib installation directory !!!

 

Root @ hrixin-desktop:/work/QTE/qt-embedded-linux-opensource-src-4.5.2-arm # Make

C. Install it under the/usr/local/trolltech/QtEmbedded-4.5.2-arm directory:
Root @ hrixin-desktop:/work/QTE/qt-embedded-linux-opensource-src-4.5.2-arm # make install

Create a script file in the directory/usr/local/qtembedded-arm.


Create a script file

Root @ hrixin-desktop:/work/root_qtopia/usr/local/trolltech/QtEmbedded-4.5.2-arm # Vim setenv. Sh

Enter the following content: (add the content of the script file that sets tslib environment variables)

#! /Bin/sh

Export tslib_root =/usr/local/tslib # path of tslib

Export tslib_tsdevice =/dev/input/event0 # specify the node file of the touch screen device

Export tslib_conffile = $ tslib_root/etc/ts. conf # specify the location of the tslib configuration file

Export tslib_plugindir = $ tslib_root/lib/TS # specifies the path of the touch screen plug-in.

Export tslib_calibfile =/etc/pointercal # specify the storage location of the touch screen calibration file pintercal

Export tslib_fbdevice =/dev/fb0 # specify the Frame Buffer Device

Export qws_mouse_proto = tslib:/dev/input/event0 # the first one, indicating to use the tslib driver>. The corresponding device name is/dev/ts.

Export tslib_consoledevice = none # console required for running tslib, which is the LCD screen and configuration control.

The system device is none. Otherwise, the default value is/dev/tty.

Export qtdir =/usr/local/qtembedded-arm

Export qpedir =/usr/local/qtembedded-arm

Export LD_LIBRARY_PATH = $ qtdir/lib: $ tslib_root/lib:/usr/local/lib: $ LD_LIBRARY_PATH

 

D. Package and compile the installed qtembedded library file:
Root @ hrixin-desktop:/usr/local/# tar czvf QtEmbedded-arm.tar.gz qtembedded-arm

E. Create a script file: setenv_arm.sh. Enter the following content:
Export qtedir =/usr/local/qtembedded-arm
Export Path =/usr/local/qtembedded-arm/bin/: $ path
Export LD_LIBRARY_PATH =/usr/local/qtembedded-arm/lib/: $ LD_LIBRARY_PATH

F. Run the script file before compiling the arm QT application:
Root @ hrixin-desktop:/usr/local/trolltech/QtEmbedded-4.5.2-arm # source setenv-arm.sh

Compile Calculator
Root @ hrixin-desktop:/work/QT/qt-embedded-linux-opensource-src-4.5.2-arm/examples/widgets/calculator # qmake

Root @ hrixin-desktop:/work/QT/qt-embedded-linux-opensource-src-4.5.2-arm/examples/widgets/calculator # Make

 

7. Use a USB flash drive to copy the compiled library file to the relevant directory.

A. omitted here (USB flash drive mounting and copying)

 

B. Copy the packaged library file: QtEmbedded-arm.tar.gz to the/work/root_qtopia/usr/local/directory.

Root @ hrixin-desktop:/work/root_qtopia/usr/local/trolltech # tar xzvf QtEmbedded-arm.tar.gz

Root @ hrixin-desktop:/work/root_qtopia/usr/local/trolltech # cd qtembedded-arm/

 

C. Upload the calculator executable file compiled in 6-F to the Development Board:

 

 

D. After the startup, run the script file (/usr/local/qtembedded-arm/setenv. Sh) on the serial port of the Development Board to set the environment variables.

Check whether the environment variable is successful:

[Root @ friendlyarm QtEmbedded-4.5.2-arm] # echo $ qtdir

/Usr/local/qtembedded-arm

Successful!

If no output is available, the operation fails. Check the other two environment variables in the same way.

 

E. Run calculator.

[Root @ friendlyarm QtEmbedded-4.5.2-arm] #./calculator-qws &

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.