Build Qt cross-development and debugging environment for Tiny4412

Publisher:心愿成真Latest update time:2024-07-11 Source: elecfansKeywords:Tiny4412 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Preface

I've been learning Qt programming under Tiny4412 recently. The first step is to build a cross-development debugging environment. After several attempts, it's basically completed. I'd like to sort out my notes during this period and post them on my blog as a summary. I also hope that others will avoid the pitfalls I've fallen into.

Another point to mention (which I learned from searching the Internet afterwards) is that the Yocto/OpenEmbedded framework is popular in the industry. Many manufacturers use this framework to build BSPs (including kernel, rootfs, toolchain, gdb, libraries, and qt libraries) for distribution development boards. Users can directly build a Qt cross-development environment based on this BSP, thus avoiding problems such as missing dependent libraries and toolchain version mismatches encountered when building the environment themselves, saving unnecessary time costs. There are many related cases, and several examples are listed in "References 2~5" (all unverified, for reference only).

However, Tiny4412 doesn't seem to provide Yocto BSP yet, so I can't experience it yet. But Yocto is probably a general trend, so I'll learn about it when I have time.

Go to top

1. Experimental Environment

1.1 Virtual Machine Environment

a) Vmware version: Vmware Workstation 12.5.7

b) Ubuntu version: Ubuntu 16.04.4 LTS (I used the version in the JZ2440 Data CD_20180516 of Baiwen.com, the address is: http://wiki.100ask.org/Download, then find: 002_JZ2440 Data CD_20180516(Free))

c) Kernel version: 4.13.0

d) gcc version: 5.4.0

e) Toolchain version:

arm-linux-gcc 4.3.2

1.2 Development Board Environment

1.2.1 Hardware

Development board: Friendly Arm tiny4412, baseboard: Tiny4412/Super4412SDK 1611, core board: Tiny4412 version number 1412

1.2.2 Software

a) Kernel version (included in the tiny4412 CD): linux-3.5-20170221

b) Root file system (included in the tiny4412 CD): rootfs_qtopia_qt4-20160514

Go to top

2. Specific process

2.1 Compile and install qte-4.8.5

Note: The tiny4412 CD contains the compiled target-qte-4.8.5-to-hostpc.tgz. However, my Ubuntu version is different from the Ubuntu version used by Youshan when compiling target-qte-4.8.5-to-hostpc.tgz. Therefore, after decompression, I cannot use it directly in qt-creator (after clicking the build button, it will report: The Qt version is invalid. Could not determine the path to the binaries of the Qt installation, maybe the qmake path is wrong?). I can only compile it from scratch.

Copy arm-qte-4.8.5-20131207.tar.gz to the development machine, and then execute the following command in the mobaXterm serial terminal:

tar xzvf arm-qte-4.8.5-20131207.tar.gz

cd arm-qte-4.8.5

./build.sh

Note: When executing ./build.sh for the first time, an error message was displayed: tslib functionality test failed. However, after re-executing ./build.sh, this error message did not appear again. The reason is unknown and needs to be investigated.

2.2 Download, compile, and install gdb-7.10, then compile and install gdbserver

Why did I choose this version? Because when I was studying the camera monitoring project of the third phase of Wei Dongshan Embedded Linux Training, I had successfully built a remote debugging environment for the development board using gdb-7.10 (in fact, I chose version 7.10 based on my feeling at that time Smile ).

2.2.1 Download, compile, and install gdb-7.10 (download address: http://ftp.gnu.org/gnu/gdb/gdb-7.10.tar.gz)

Download gdb-7.10.tar.gz to the development machine (assuming it is downloaded to /home/book/Downloads/), and then execute the following command in the mobaXterm serial terminal:

tar xzvf gdb-7.10.tar.gz

cd /home/book/Downloads/gdb-7.10

mkdir build && cd build

../configure --target=arm-linux --prefix=/usr/local/arm-gdb-7.10 --with-python

Note: You may also need to add: --with-expat --includedir=/home/book/Downloads/expat-2.2.9/bin/include --libdir=/home/book/Downloads/expat-2.2.9/bin/lib, see the notes below for details

make

make install

export PATH=$PATH:/usr/local/arm-gdb-7.10

(You can add this sentence to /etc/environment or ~./bashrc to save the changes to the $PATH environment variable)

Note 1: When configuring gdb-7.10, you need to add the --with-python option (you may also need to download and install python2.7-dev first). Otherwise, when you start debugging in qt-creator, you may get an error:

image

Note 2: If configure adds the --with-python option, it will report:

checking for python2.7... no

configure: error: python is missing or unusable

The solution is: first download and install python2.7-dev: apt-get install python2.7-dev. After the installation is complete, you can execute dpkg -l | grep python2.7-dev to verify whether the installation is successful.

Note 3: After compiling and installing gdb-7.10, if you start debugging in qt-creator and get an error in Application Output: warning: Can not parse XML target description; XML support
was disabled at compile time, you need to download, compile, and install expat first (http://sourceforge.net/projects/expat/):

./configure --prefix=$PWD/bin

mkdir bin

make && make install

Then recompile and install gdb-7.10 (when configuring, also add the following options: --with-expat --includedir=/home/book/Downloads/expat-2.2.9/bin/include
--libdir=/home/book/Downloads/expat-2.2.9/bin/lib –v)

Note 4: If you run make and get an error:

checking for libexpat... (cached) no

configure: error: expat is missing or unusable

The solution is: delete the entire gdb-7.10 folder, then re-decompress gdb-7.10.tar.gz, compile, and install.

The reasons are:

To speed up, configure will cache the last check result as a cache variable (named ac_cv_libexpat) in gdb/configure.cache, and this time configure will first

The cache variable is checked in this file. If it is not found, it will actually check whether the libexpat library exists. Therefore, this cache file should be cleared to force configure to perform a real check.

2.2.2 Compile and install gdbserver

Execute the following command in the mobaXterm serial terminal:

cd /home/book/Downloads/gdb-7.10/gdb/gdbserver

mkdir build && cd build

../configure --target=arm-linux -host=arm-linux

make CC=arm-linux-gcc

After completion, a gdbserver executable file will be generated in the build directory. Copy it to the /usr/bin directory of the development board (you can use ftp or nfs, the process is omitted):

2.3 Copy and unzip the root file system to the development machine

Copy the rootfs_qtopia_qt4-20160514.tgz in the CD-ROM that comes with Tiny4412 to the development machine (assuming it is copied to /home/book/Downloads/friendly_arm/tiny4412/linux_rootfs/), and then execute:

tar xzvf rootfs_qtopia_qt4-20160514.tgz

2.4 Download and install Qt-5.9.0 (download address: https://download.qt.io/archive/qt/5.9/5.9.0/qt-opensource-linux-x64-5.9.0.run)

Why choose this version? Because there are many successful cases online, and cross-debugging platforms have been built using this version, and there is experience to learn from.

Download qt-opensource-linux-x64-5.9.0.run to the development machine, and then execute the following command in the mobaXterm serial terminal:

chmod +x qt-opensource-linux-x64-5.9.0.run

./qt-opensource-linux-x64-5.9.0.run

Then follow the prompts of the installation wizard step by step (Note: In the "Select Components" step, select all components under Qt5.9.0 for safety reasons)

2.5 Open qt-creator and go to Tools==>Options for configuration

2.5.1 Add device

image

image

image

image

image

image

image

image

image

2.5.2 Add Qt version

image

2.5.3 Adding a compiler

image

2.5.4 Add debugger

image

2.5.5 Adding kit

image

2.5.6 Add environment variables to support touch screen operation

Method 1) Modify /etc/profile on the development board (follow the content of /bin/setqt4env) and add the following environment variables:

export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

export QWS_DISPLAY=:1

export QWS_KEYBOARD=TTY:/dev/tty1

export QWS_MOUSE_PROTO="Tslib MouseMan:/dev/input/mice"

export TSLIB_CALIBFILE=/etc/pointercal

export TSLIB_CONFFILE=/etc/ts-mt.conf

export TSLIB_PLUGINDIR=/usr/lib/ts

export TSLIB_TSDEVICE=/dev/touchscreen-1wire

Method 2) In qt-creator on the development machine, go to project==>Build&Run==>tiny4412==>Run==>Base environment for this run configuration and add the above environment variables:

image

2.5.7 Modify /usr/local/etc/sshd_config on the development board to solve the problem of "SFTP initialization failed: Server could not start SFTP subsystem" when debugging

Subsystem sftp /usr/libexec/sftp-server

to:

Subsystem sftp /usr/local/libexec/sftp-server

2.6 qt-creator creates a widget test program test, and then does some configuration

2.6.1 Modify the "test.pro" file and add the following two lines:

target.path = /opt #Specify the installation path on the development board for the program

INSTALLS += target

image

2.6.2 Enter Project==>Build&Run==>Tiny4412==>Run Settings

image

At this point, the Qt development and debugging environment of Tiny4412 has finally been built, and the effect diagram is as follows:

1) Start debugging:

image

2) Stop debugging:

image

Go to top

3. References

1) Tiny4412 User Manual

2) QtCreator+Arm development and online debugging

3) Full record of yocto for imx6 development environment construction (L4.1.15_2.0.0)

4) QTCreator + gdbserver to achieve remote debugging

5) Qt5 porting and development on NXP iMX8


Keywords:Tiny4412 Reference address:Build Qt cross-development and debugging environment for Tiny4412

Previous article:ALSA sound card_add recording function from scratch (based on Youlong FS2410 development board, UDA1341 sound card)
Next article:Wei Dongshan Embedded Linux_Issue 3: USB Camera Monitoring_Adding Video Recording Function to Mobile App (I)

Recommended ReadingLatest update time:2024-11-23 19:08

LCD Operation of Tiny4412
// 4412 has a total of 5 windows, each window can have two buffers // ALPHA: Determine whether it is translucent // COLOR KEY: determines whether to display // OSD: Determines the display area of ​​a window #include "regs.h" void enable_mmu(unsigned long ttb); void init_ttb(unsigned long *ttb_base); void mmap(unsigned
[Microcontroller]
qt-embedded-linux-opensource-src-4.5.3 ported to s3c6410
First, you need a configured environment. The compilation environment used in this article is as follows: Host system: Ubuntu 9.10 Host compiler: gcc version 4.4.1 Cross compiler: arm-linux-gcc-4.0.1 Software resources: qt-embedded-linux-opensource-src-4.5.3.tar.gz qt-x11-opensource-src-4.5.1.tar.gz
[Microcontroller]
Design and implementation of ARM/DSP DC motor monitoring interface based on QT/E
0 Introduction Embedded technology is widely used in the field of robot control. It concentrates the latest scientific research results in multiple disciplines such as mechanical engineering, automation control, and artificial intelligence. It has become the focus and center of current scientific and technological res
[Microcontroller]
Design and implementation of ARM/DSP DC motor monitoring interface based on QT/E
S5PV210 development -- QT4.8 porting
Today, at the request of netizens, I generated the root file system of the nand platform. Here is a brief explanation. 1. Install the cross compiler As mentioned before, see: S5PV210 Development - Cross Compiler 2. Install QT4.8 source package Copy the QT4.8 source package qt_x210v3s_160307.tar.bz2 in the CD to
[Microcontroller]
S5PV210 development -- QT4.8 porting
Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号