HiSilicon 3520D Transplant Qt4.5.3 One

Source: Internet
Author: User
First, transplant Qt4.5.3
1. Obtain Qt4.5.3 source Code Qt4.5.3 original package qt-embedded-opensource-src-4.5.3.tar.gz copy it to/opt,
Then enter the following command on the Linux terminal (without typing #), unzip the Qt4.5.3 source package under/opt/
# cd/opt/
# tar Xvzf/opt/qt-embedded-opensource-src-4.5.3.tar.gz


2. Cross-compiling Qt4.5.3
2.1, #vim mkspecs/qws/linux-arm-g++/qmake.conf, change all the arm-linux-** to arm-hisiv100nptl-linux-**


2.2, #vim Examples/examples.pro,
Delete Row
Contains (Qt_config, WebKit): Subdirs + = WebKit
Otherwise compile example WebKit will error


2.3, #vim Demos/demos.pro,
Delete two rows
Contains (Qt_config, WebKit): Contains (Qt_config, SVG): Subdirs + = Demos_browser
Demos_browser.subdir = Browser
Otherwise compiling the demo browser will make an error


Problem:
The Tslib functionality Test failed! You might need to modify the Include and library search paths by editing Qmake_incdir and Qmake_libdir in ...


2.4, Tslib installation path, note that tslib need cross-compilation success
In.. Add Tslib installation path to the/qt-embedded-linux-opensource-src-4.5.3/mkspecs/qws/linux-arm-g++/qmake.conf file
Qmake_incdir =/home/littlecc/qt/tslib/tmp/include//This is my Tslib installation path
Qmake_libdir =/home/littlecc/qt/tslib/tmp/lib


Of course, you can also join-i/=/usr/local/tslib/include-l=/usr/local/tslib/lib to solve the problem in./configure.
Add-verbose to the./configure option to tell you more about the cause of the error

Note: This path is used when setting environment variables later/opt/qt4.5.3

2.5, the implementation of configure configuration
./configure--prefix=/opt/qt4.5.3-no-pch-xplatform qws/linux-arm-g++-arch arm-embedded arm-no-freetype-qt-mouse-pc -no-webkit-no-largefile-fast-release-no-qt3support-no-cups-no-opengl-no-phonon-phonon-backend-no-scripttools-n O-libtiff-no-gif-no-libmng-no-nis-no-cups-no-svg


Choose:
O
Yes

The meaning of the main parameters above is described below:
-prefix/opt/qt4.5.3: Indicates that Qt4.5.3 final installation path is/opt/qt4.5.3, note that the part is set to open
When the hair plate, also need to put Qt4.5.3 on this path;
-no-pch
-xplatform qws/linux-arm-g++: means compiling with the arm-linux cross compiler;
-arch Arm
-embedded arm: Indicates that the embedded version will be compiled for the arm platform;
-no-freetype
-qt-mouse-pc
-no-webkit


-qt-mouse-tslib: Indicates that the touch screen will be driven using Tslib;
-opensource
-qt-libtiff
-qt-libmng
-qt-mouse-tslib
-no-mouse-linuxtp
-no-neon


Execute the following command to compile and install Qt4.5.3:
# Make && make install
The && symbol shown in the above command indicates that only the make command on the left is successful (return 0)
Install command.
After compilation, Qt4.5.3 is installed in the/opt/qt4.5.3 directory


Improve compilation Speed:
Use the option-nomake Examples–nomake Demos–nomaketools to filter out examples, demos, and tools catalogs that they do not compile.


3. Environment Construction
3.1.
Libstdc++.so.6 libstdc++.so.6.0.3 and copied to the/lib board file system;
The installation directory of the cross tool chain is searched libgcc_s.so libgcc_s.so.1 and copied to the/lib board file system; (only libstdc++.so.6 library is used in the test)


3.2, Mount debugging
Copy the compiled QT library to my mount directory
cp/opt/qt4.5.3/home/littlecc/

Make a soft connection, connect the library to the/OPT directory of the Silo Development Board file system, for what is it because-prefix/opt/qt4.5.3 is the directory when we configure it, or it will go wrong
Ln-s/mnt/qt4.5.3/opt/qt4.5.3


3.3
Setting environment variables directly modify the/etc/profile file for the offshore Development Board
Vi/etc/profile
Add the following:
qtdir=/opt/qt4.5.3//path must be set to otherwise the program will not run
Path= $QTDIR/bin: $PATH
Tslib_consoledevice=none
Ld_library_path= $T _root/lib: $QTDIR/lib


The above four sentences for the environment variable declaration, many articles on the internet are also declared Qws_mouse_proto, Tslib_fbdevice, etc., it is recommended not to declare these variables,
Because QT will automatically match the relevant mouse devices and framebuffer devices, sometimes declaring that it will affect the normal operation of the mouse, my framebuffer and mouse device characters are/dev/fb0 and/dev/mice respectively,
QT can be automatically identified, to ensure that the two names are not the preferred ln-s do a soft link, do not go to set environment variables


At this point, you can test run a bit, first run the HiSilicon SDK Mpp/sample under the HIFB test program, the framebuffer 0 open, and then run QT Example and demo


./API_SAMPLE_HIFB &
Ensure that the test screen can be seen on the display at this time, to ensure that the VGA chip driver and framebuffer drive load run correctly, and then,
cd/opt/qt4.5.3/demos/chip/
./chip-qws
Can be seen on the display of QT test screen effect;


If you are prompted with the word "QFONTENGINEQPF failed" during the run, open the src/gui/text/qfontdatabase_qws.cpp to do an empty write operation, and then re-compile all the steps above again, for reasons not specified.


Attention:
Issue One:/dev/fb0 Open failure issue
Because HiSilicon in operation Framebuffer need to make corresponding configuration, if not the corresponding configuration, then to open/dev/fb0 will be error.
The following two steps are carried out specifically:


(1), Initialize MPP
(2), enable output equipment VO
After the above two steps, open/dev/fb0 will not error


3.4. Write a demo test

#include <QApplication>
#include <QPushButton>
#include <stdio.h>
#include <QtGui>


int main (int argc, char *argv[])
{
Qapplication app (argc, argv);
Qdebug () << "Hello 3520 I am qt\n";


return App.exec ();
}
If you wait to print it out, it means that your transplant is successful, and then verify that the GUI interface can be displayed.

Good luck!!

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.