Post-transplantation of QTE + tslib on ARM Linux

Source: Internet
Author: User

Preface:
The mood at this moment can be described with excitement and sorrow. Excited because after two weeks of "unremitting efforts" and "persistent" pursuit

The expected goal is sadly because, as an IT wage earners, they can only silently pray for the capitalists all day. Financial storms, making sure that

Maybe it's better ...... There are too many things you want to talk about, but there is no place to express them.
:) Let's start our migration journey. Here we go!

1. Development Environment
PC + VMware + red flag + Cross Compiler
PS:
VMware: vmware6.0
Red Flag: Red Flag desktop 6.0
Cross-compiler: Arm-Linux-gcc/arm-Linux-G ++ (cross-compiler path:/opt/Magus/ARM/3.4.6/bin /)

2. Port tslib.
Currently, the tslib version has tslib-1.3, tslib-1.4. At the beginning I used a tslib-1.3, but eventually on the target machine running timeliness does not matter

Think, ts_calibrate and ts_test cannot run normally, and there are problems with the sensitivity and response of the touch screen. So I took one from the project partner.

Tslib versions, after several twists and turns, can finally make tslib work normally on the target machine. The following is the migration process of tslib:

(1) set the environment
[~ #] Export cc =/opt/Magus/ARM/3.4.6/bin/ARM-Linux-gcc
(2) Configure Configuration
[~ #] Echo "ac_cv_func_malloc_0_nonnull = yes"> arm-linux.cache
// If this sentence is not found, the error rpl_malloc cannot be found during make. Cause: # define malloc rpl_malloc is in configure. In this case

You only need to write ac_cv_func_malloc_0_nonnull = yes to the. cache file, and allow configure to read this configuration from the file to bypass # define

Malloc rpl_malloc
[~ #]./Configure -- prefix = $ PWD/release -- Host = arm-Linux -- target arm-Linux -- cache-file = arm-

Linux. cache cflags = '-L/opt/Magus/ARM/3.4.6/ARM-Linux/lib'
Note: For more information about configure options, see./configure -- help)
(3) Compile
[~ #] Make clean
[~ #] Make
[~ #] Make install
In the $ PWD/release directory, tslib is generated with related libraries and configuration files.
(4) Compile the ts_calibrate (screen calibration program) script ts_calibrate.sh. The details are as follows:
Export qtdir =/Media/usrdata/stock/QTE
Export qpedir =/Media/usrdata/stock/QTE
Export qpedir =/Media/usrdata/stock/QTE
Export qt_qws_fontdir = $ qtdir/lib/Fonts

# Set the frame buffer of qtqpedir =/Media/usrdata/stock/qtopia
Export qws_display = linuxfb:/dev/fb0
# Export qws_display = linuxfb:/dev/fb0: mmwidth = 320: mmheight = 240
Export qws_size = 320x240

# Set the controller of input (touch screen or keypad)
Insmod/lib/modules/ak4182.ko
Insmod/lib/modules/evdev. Ko

# Export tslib_tseventtype = "ucb1x00" # Default Value
# Export tslib_tseventtype = "mk712"
# Export tslib_tseventtype = "arctic2"
# Export tslib_tseventtype = "Collie"
# Export tslib_tseventtype = "corgi"
# Export tslib_tseventtype = "h3600"

Export v_root =/Media/usrdata/stock/ts-release
# Export tslib_consoledevice = none
Export tslib_fbdevice =/dev/fb0
Export tslib_tsdevice =/dev/event0
Export tslib_calibfile = $ v_root/etc/pointercal
Export tslib_conffile = $ v_root/etc/ts. conf
Export tslib_plugindir = $ v_root/lib/TS/
Export qws_mouse_proto = tslib:/dev/event0
# Export LD_LIBRARY_PATH = $ tslib_rootdir/lib: $ LD_LIBRARY_PATH
Mm W 4 0x8005054 0x2d00
Export Path = $ qpedir/bin: $ path
Export

LD_LIBRARY_PATH = $ qtdir/lib: $ qpedir/lib: $ v_root/lib/TS:/Media/usrdata/Stock:/lib:/usr/lib: $

LD_LIBRARY_PATH
/Media/usrdata/stock/ts-release/bin // ts_calibrate
At this point, the tslib compilation is complete, but it does not mean that there will be no problems when running on the target.
(5) modify the Ts. conf configuration file
Add the following module configuration items at the end of the $ PWD/release/etc/ts. conf file:
Module_raw Input
Configure the touch event Input Source-Touch Screen
(6) create a directory ts-release on the target machine and copy all the files in the $ PWD/release directory on the PC to the Ts-release directory. Run

Ts_calibrate.sh.
[~ #]./Ts_calibrate.sh
The input. So plug-in module in tslib is loaded and the segement fault error is thrown. After carefully analyzing the tslib source code, we know that

In input. So, the _ ts_attach_raw () function in ts_attach.c uses a null pointer, resulting in segement fault. Modified and Retried

Compile tslib and run ts_calibrate.sh again. Everything is normal. Modify _ ts_attach_raw () in ts_attach.c as follows:
# If 0
For (next = ts-> list, Prev = next; next! = NULL & next! = Prev_list; next = Prev-> next, Prev =

Next)
{
Debug ("liuhao: % S % s: Count = % d prev_list = % x Prev = % x next = % x Prev-> next = % x/N ",

_ File __, _ FUNCTION __, count ++, prev_list, Prev, next, Prev-> next );
;
}
# Else
For (next = ts-> list, Prev = next; next! = NULL & next! = Prev_list ;)
{
Debug ("liuhao: % S % s: Count = % d prev_list = % x Prev = % x next = % x Prev-> next = % x/N ",

_ File __, _ FUNCTION __, count ++, prev_list, Prev, next, Prev-> next );
Next = Prev-> next;
If (next = NULL)
Break;
Else
Prev = next;
}
# Endif
So far, all tslib work has been completed, and ts_calibrate will be in ~ The/ts-release/etc/directory generates a pointercal file. Pointercal is a trigger

Touch screen calibration files generated to ensure that the touch screen works properly during QT operation.
2. QTE porting
There are too many articles on porting QTE and qtopia on the Internet, and the QTE and qtopia versions involved are also inconsistent, and there are also qtopia Core

. According to relevant sources, qtopia core is a combination of QTE and qtopia. Therefore, I can take qtopia core as the tool, and the version is qtopia-core-

Opensource-src-4.3.1, running results are not ideal. So, and changed the qt-embedded-linux-opensource-src-4.5.0. Okay.

It is.
(1) set the environment
[~ #] Export Path =/opt/Magus/ARM/3.4.6/bin: $ PWD/bin: $ path
[~ #] Export LD_LIBRARY_PATH =/lib:/usr/lib:/opt/Magus/ARM/3.4.6/ARM-Linux/lib:/opt/qt_space/tslib-

1.3/release/lib: $ LD_LIBRARY_PATH
(2) Configure Configuration
[~ #]./Configure-Prefix/Media/usrdata/stock/QTE-xplatform qws/Linux-arm-G ++-largefile-no-

Exceptions-no-Accessibility-STL-plugin-SQL-SQLite-no-qt3support-no-xmlpatterns-no-phonon

-Phonon-backend-no-SVG-no-WebKit-no-scripttools-no-MMX-no-3dnow-no-SSE-no-sse2-QT

-Zlib-QT-GIF-QT-LibTIFF-QT-libpng-QT-libmng-QT-libjpeg-no-Nis-depths

8, 16, 24, 32-Embedded ARM-QT-mouse-tslib-no-feature-QWS_CURSOR-little-Endian-

I $ PWD/../tslib/release/include-L $ PWD/../tslib/release/lib
Note: For more information about configure options, see./configure -- help)
(3) Compile
[~ #] Gmake
[~ #] Gmake install
Compilation errors and solutions:
When gmake install is executed, example in the examples/draganddrop/directory is compiled. When compiling delayedencoding,
(1) An error related to qsvgwidget is reported.
Solution: the most direct method is not to compile delayedencoding. Delete the delayedencoding of the subdirs entry in draganddrop. Pro.

You can.
(2) svgtextobject. cpp: 52: Error: 'qsvgrenderer' was not declared in this scope
Solution: Delete the textobject of the subdirs item in the. Pro file under the examples/richtext/directory.

OK. QTE compilation is also completed, and the final release is in/Media/usrdata/stock/QTE.
Note: The installation path of-Prefix/Media/usrdata/stock/QTE in configure must be consistent with that in QTE storage on the target machine.

Otherwise, no error is returned during QT running.
(4) Compile the Script test. Sh for running the QT test program. The specific content is as follows:
Export qtdir =/Media/usrdata/stock/QTE
Export qpedir =/Media/usrdata/stock/QTE
Export qpedir =/Media/usrdata/stock/QTE
Export qt_qws_fontdir = $ qtdir/lib/Fonts

# Set the frame buffer of qtqpedir =/Media/usrdata/stock/qtopia1
Export qws_display = linuxfb:/dev/fb0
# Export qws_display = linuxfb:/dev/fb0: mmwidth = 71: mmheight = 53
Export qws_size = 320x240

# Set the controller of input (touch screen or keypad)
Insmod/lib/modules/ak4182.ko
Insmod/lib/modules/evdev. Ko

# Export tslib_tseventtype = "ucb1x00" # Default Value
# Export tslib_tseventtype = "mk712"
# Export tslib_tseventtype = "arctic2"
# Export tslib_tseventtype = "Collie"
# Export tslib_tseventtype = "corgi"
# Export tslib_tseventtype = "h3600"

Export v_root =/Media/usrdata/stock/ts-release
Export tslib_consoledevice = none
Export tslib_fbdevice =/dev/fb0
Export tslib_tsdevice =/dev/event0
Export tslib_calibfile = $ v_root/etc/pointercal
Export tslib_conffile = $ v_root/etc/ts. conf
Export tslib_plugindir = $ v_root/lib/TS
Export qws_mouse_proto = tslib:/dev/event0
# Export LD_LIBRARY_PATH = $ tslib_rootdir/lib: $ LD_LIBRARY_PATH
Mm W 4 0x8005054 0x2d00
Export Path = $ qpedir/bin: $ path
Export

LD_LIBRARY_PATH = $ qtdir/lib: $ qpedir/lib: $ v_root/lib:/Media/usrdata/Stock:/lib:/usr/lib: $ LD_LIBRARY_PATH
/Media/usrdata/stock/QTE/examples/widgets/calculator-qws #-geometry 320x240 + 0 + 0
(5) Run test. Sh.
[~ #]./Test. Sh
Godness. That is QT.
Finally, we can see that QT is running on the target machine and can respond to touch screen events normally ~ :)
However, QT display is still a bit flawed: the size of the QT program exceeds the actual display range of the LCD. The problem arises. You may need to modify the QT source code. Ah

You have to continue fighting again. You can only cheer yourself up !~
Due to the rush of time, I just sorted it out and it was inevitable that there were errors. I hope my colleagues who browsed this article will forgive me!

First, you have to take a rest...

Best regards

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.