2211 views|5 replies

249

Posts

5

Resources
The OP
 

[Mill MYB-YT507 development board trial experience] + build QT development environment and test, the most detailed steps to solve all troubles [Copy link]

 

After the last article, we will enter our application article. There is still time for experience, so let's not waste time on compilation. Let's experience our QT development today. In fact, Allwinner supports more than just QT display on its platform this year. We choose QT experience because its code can run on multiple terminals and basically can run across multiple platforms.

We can see that there are other GUIs supported on the platform. LVGL is also very popular this year, and basically the SDK in the new Allwinner video supports it. Let's get into the topic, let's install QT development on Ubuntu first.

Here I choose the qt5.9 version on Linux. This version is the one I use most. This version avoids logging in and has a good experience in other aspects. However, it does not correspond to the development version on our development board. But there is no problem with this. The only difference is that running some examples will be different.

After running, the QT installation page will pop up, and we can just click NEXT.

Then the next step is to log in. It seems that you must log in to verify the following steps. You can directly choose to skip this version.

Then choose our installation path. Here I will let it choose by itself. You can choose any path here, there is no problem.

Then jump to our component installation. For component installation, we must choose QT Creator, which is an IDE developed by QT. I also recommend installing other desktop versions of QT5.9.1, so that you can see the running effect directly on Ubuntu.

Next, wait for the installation to complete.

In this step, we are setting up the QT cross-compilation environment. Our computers are usually based on X86 architecture, and the generated executable files cannot be run on our ARM development board, so we need to cross-compile them into ARM versions and provide them to the development board for running. This tool is provided directly by Mir, just unzip it.

Then we install the QT Creator and click Options under Tools to configure our cross compiler.

Go to build&run and select kits to create our cross-compiler here.

Click Add and rename it for easy identification. The following compiler and QT version need to be newly created, and there are corresponding options above.

In QT Versions, we select our qmake. This path is the path of the unzipped file. Select it according to the red box.

After selecting, our version will be prompted directly, which is QT5.12.5, which is also the version on our development board.

Then add our gcc and g++ compilers.

You can check the path yourself. It is also the path where we decompressed it. Choose whatever you want to add. There are two here, one is gcc and the other is g++. Choose both of them.

The addition is completed as above. For the convenience of naming, we still rename it.

Then modify the first kits and change all the contents to the corresponding development board.

The next step is to create a new project using QT Creator. Here we choose one with a graphical display. The first one will do.

Name the command hello_world. Keep your first project simple.

On the Kits page, we check both desktop and cross-compilation.

This step and the following ones are all default and will not be modified for the time being.

Then we can run the desktop directly, and you can see a window pop up with nothing in it. This step completes the new project and verification.

Then modify the .ui file. This is the box that just displays the image. We can add some things ourselves.

You can see that another window pops up after clicking. This window is the QT designer, which can design various UI interfaces. What you see is what you get. We drag a button and a label from the left control to the window, and double-click to modify the content to hello world.

Then run the desktop again and we will see the display.

Then start our cross-compilation build and select T507.

Then there was an error in the build, which we needed to resolve. At first I thought it was a problem with our compiler, so I added the environment variables.

Modify /etc/profile to add the path of our cross compiler. Then restart.

Restart and open QT Creator in the application and select our hello world project. However, the above problem still occurs. Generally, it is a problem of QT itself. The output target folder does not exist during compilation, and the corresponding so file, that is, the dynamically linked file, cannot be found. At this time, we still need to create a new directory and put the file in it.

/home/lcy/t507/out/t507/demo2.0/longan/buildroot/host/usr/

First of all, this string is the path of the error just reported, so we first create the user lcy, use the command sudo adduser lcy

Then keep pressing Enter.

Then enter the lcy directory and create a folder

sudo mkdir -p t507/out/t507/demo2.0/longan/buildroot/host/usr/

Then copy the files in the path.

My path here is missing a t507, but it won’t happen if I create it above. Just copy a folder directly.

Then go in ls and see many so files. That's it.

Then build again and it's fine.

Then our executable file comes out, and you can see that the file type is ARM aarch64. The next step is to run it on the board.

There are many ways to download our program to our development board. Allwinner also provides an ADB method, which we will use later. I am anxious to test it, so we just copy it to the SD card and insert it into the board. Then I found a problem here. There is no prompt for mounting, which is not good. We can find new devices by finding what kind of devices are added in /dev/. Here I found that mmcblk1p1 has appeared. Then we mount it. After mounting, our program appears in the ls directory.

It is not possible to run the program directly afterwards because of the lack of link library. At this time, we can find that it is running its own program. At this time, we need to find it and replace the program brought by Mil with ours.

I usually find the program we run when we start the computer in the file /etc/init.d/rcS, and sure enough, it executes a qtenv.sh. Let's look at this file again.

Find our running program mxapp2, and then simply replace the file name with our program.

We need to search for the location of this file. We found it in /usr/bin and copied our program directly into it. Then boot the computer. The running effect is as follows:

The controls are a bit compressed and not fully displayed. We will release a video later to explain this.

This post is from Domestic Chip Exchange

Latest reply

Very detailed, thanks for sharing   Details Published on 2022-8-3 18:39
 
 

5998

Posts

6

Resources
2
 

Qt is very suitable for embedded interactive interface design

This post is from Domestic Chip Exchange
Personal signature

在爱好的道路上不断前进,在生活的迷雾中播撒光引

 
 
 

6818

Posts

11

Resources
3
 

Thanks for sharing. I’ll mark the points you noticed here!

This post is from Domestic Chip Exchange
 
 
 

5213

Posts

239

Resources
4
 

You can submit Mir now

I thought the previous problem was solved, but it seems that I have bypassed it.

This post is from Domestic Chip Exchange
Add and join groups EEWorld service account EEWorld subscription account Automotive development circle

Comments

Yes, they have provided a virtual machine. I will use their virtual machine when the time comes. Now I am making applications. I will not try that yet. This board also has Ubuntu to try, and Android has not been released yet. Search Copy  Details Published on 2022-8-1 13:36
 
 
 

249

Posts

5

Resources
5
 
nmg posted on 2022-8-1 11:11 You can submit Mir. I thought the previous problem was solved, but it seems that it was bypassed.

Yes, they have provided a virtual machine, so I will use their virtual machine when the time comes. Now I am making applications, so I won’t experience that for now. This board also has Ubuntu to experience, and Android, which has not been released yet.

This post is from Domestic Chip Exchange
 
 
 

7422

Posts

2

Resources
6
 

Very detailed, thanks for sharing

This post is from Domestic Chip Exchange
Personal signature

默认摸鱼,再摸鱼。2022、9、28

 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list