PDA

View Full Version : How to use QT creator to make application for embedded linux ?



wowy
17th March 2015, 10:16
Hello,

I am currently working on a SBC6000x board (armv5) with linux 2.6.24 on it and i would like to make an application which would use the lcd display with the board.
My idea was to write the application on my ubuntu pc and then cross compile it for my board. I got the compiler from embest (which work since i was able to make a little "hello world" application echo in the terminal) and the last version of qt Creator (installed last week). My board don't seems to have a current GUI, as i understand not having one would make it impossible for me to use application with thing like button/msgbox. Is there a way to create one using QT Creator/designer for armv5 ?

Kind regards

wysota
17th March 2015, 11:55
If you can run a GUI on your embedded device (either you have eglfs or x11) then you can implement a regular Qt GUI application in Creator and deploy it on your arm board.

Askar
17th March 2015, 12:11
yes.. you can create GUI using QT Creator/designer. Similar to your 'hello world' application you have to cross compile the Qt source.

First -> you have to create make file for cross compilation, by using qmake command in your cross compile tool chain.


qmake path\project_name.pro

Sencond -> then do make using 'make' command in your cross compile tool chain. similar to your hello world.

Note - instead of doing the above steps in command line, you can configure cross compiler in Qt Creator itself. refer below link under 'Configure Qt Creator' section

http://developer.toradex.com/how-to/how-to-set-up-qt-creator-to-cross-compile-for-embedded-linux

Third -> Once the compilation completed, Copy the generated bin file to your target board & execute with -qws keyword.


./filename -qws

- qws is used to mention run time environment that, currently running application is QWS_Server


For more info refer link.... http://doc.qt.io/qt-4.8/qt-embedded-running.html

wowy
17th March 2015, 13:03
yes.. you can create GUI using QT Creator/designer. Similar to your 'hello world' application you have to cross compile the Qt source.
First -> you have to create make file for cross compilation, by using qmake command in your cross compile tool chain.

qmake path\project_name.pro
Sencond -> then do make using 'make' command in your cross compile tool chain. similar to your hello world.
Note - instead of doing the above steps in command line, you can configure cross compiler in Qt Creator itself. refer below link under 'Configure Qt Creator' section
http://developer.toradex.com/how-to/how-to-set-up-qt-creator-to-cross-compile-for-embedded-linux
Third -> Once the compilation completed, Copy the generated bin file to your target board & execute with -qws keyword.

./filename -qws
- qws is used to mention run time environment that, currently running application is QWS_Server
For more info refer link.... http://doc.qt.io/qt-4.8/qt-embedded-running.html

The problem is if i want to use the -qws command i need Qt Embedded and other stuff like qt Windowing System installed on my board. Which is not possible. I can't connect it to the internet and even if i could she is missing most command (like make). I fear i am stuck on my ssytem...

wysota
17th March 2015, 14:08
You don't need make on your target board. All the compilation is done on the host.

wowy
17th March 2015, 15:21
You don't need make on your target board. All the compilation is done on the host.

But i still need to install something on the board for it to understand the -qws, no ?

wysota
17th March 2015, 15:32
But i still need to install something on the board for it to understand the -qws, no ?

You need to install Qt, of course.

However unless you specifically need qws, I would suggest to use Qt5 rather than Qt4 and run full screen applications using eglfs.

wowy
17th March 2015, 15:40
You need to install Qt, of course.

Which will be hard on my board i fear since i have really a few command available and no internet connection on it. I search about other more complete distro but it seems armv5 is abandoned, archlinuxarm have a version for armv5 but people already tried on on my micro and all gave up and debian arm version went armel and is unavailable for armv5 too. I fear i will have to say to my boss that this is not possible right now.

And qt-everywhere-opensource seems to run in an infinite loop when i try toe "make" it on my ubuntu pc right now...

wysota
17th March 2015, 15:44
Which will be hard on my board i fear since i have really a few command available and no internet connection on it.
I don't see how that's relevant. You only need to be able to copy things to your device which I'm assuming you can do since you already copied your "hello world" app to it.

wowy
17th March 2015, 15:51
I don't see how that's relevant. You only need to be able to copy things to your device which I'm assuming you can do since you already copied your "hello world" app to it.

Yes i can copy, erase, rename...this kind of basic things. I will try this http://qt.developpez.com/doc/4.6/qt-embedded-crosscompiling/

wowy
19th March 2015, 15:20
I am really sorry, i must be stupid but i am completly lost right now and i feel that i must not be the only person like this so i will explain all i have done step by step and if i did somethign wrong or did not understand a thing or told an absurdity i will accept it if someone can explain it.

Here is what i have done :
1) Used ubuntu software center and downloaded/installer qt creator and qt designer
2) Then got here : http://qt.developpez.com/doc/4.7/qt-embedded-linux/
3) Then i click on installation and finished the step 4 ( http://qt.developpez.com/doc/4.7/qt-embedded-install/ ), i check /usr/local/Trolltech/QtEmbedded-4.8.6-arm exist an is not empty so i would think the installation did not fail. But still, there is no executable anywhere called "qtembeded" or something and qt creator don't seems to have any thing new but it is written :

This document describes how to install Qt for Embedded Linux in your development environment:
( http://qt.developpez.com/doc/4.7/qt-embedded-install/ ) I installed it on my development environment which is my ubuntu pc but i don't really see the point now if there is no executable or relation with qt creator for example. But, why not, maybe this is used later.

Now like wysota told me, to run application on the embedded device i must have qt installed on the board too.

So here is where i am completly lost. Either this is as complicated as it is or i am missing something.

a) I go here : http://qt-project.org/doc/qt-4.8-snapshot/qt-embedded-install.html and read :

Please see the cross compiling and deployment documentation for details on how to install Qt for Embedded Linux on your target device.
b) I click on cross-compilling. I would assume that the files to cross compile are from the qt-everywhere-opensource-src-4.8.6.tar.gz archive too.
At the end i read :

That's all. Your target specific executable is ready for deployment.
Ok, i will have an executable, surely it will be put in /bin. Nice.
c) Then the deploying application part ( http://qt-project.org/doc/qt-4.8-snapshot/qt-embedded-deployment.html )
Which tells me :
The procedure of deploying an Qt application on Qt for Embedded Linux is essentially the same as the deployment procedure on X11 platforms which is described in detail in the Deploying an Application on X11 Platforms
So i click on the link ( http://qt-project.org/doc/qt-4.8-snapshot/deployment-x11.html )
But i thought i woul only need to call the window manager or qt with a ./filename -qws ...

To resume :
- qt creator is installed
- qt designer too
- qt for embedded linux is installed on the dev part but don't seems to be of any use...
- qt for embedded linux "board" part if cross-compilled would give me a qt executable which i assume would be used to launch the future applications
- The way to run an application is unsure

Did i miss something, or misunderstood a part ? Like i said, i want to understand. This is just...if i make it works i will write how i did it and put on somewhere because i don't want anyone else being as stuck as me. As much as the people doing qt are nice, they are not "noob-friendly" i would say but i can understand ;)

wysota
19th March 2015, 15:29
1. there is no "qtembeded" (or alike) binary, so don't expect one to be there.
2. Qt for embedded linux looks exactly the same as Qt for desktop -- it consists of executables, libraries and plugins. There is no application that you can "run" and call that "Qt Embedded"
3. You need Qt built for your target device and linked with libraries available on your device. I have no idea what you did as the site you have been working with is not an official Qt site so it's very unlikely anyone here will support their installation process.
4. To build Qt and other applications and libraries you need a cross-compiler (which I assume you do have), a sysroot for your device (containing libraries matching those your device has and include files compatible with your device) and source code for anything you would like to build as well as sources or binaries for dependencies of whatever you are trying to build.
5. A bit of knowledge about "console ways of doing things" -- if you expect to click some button here and there and keep your fingers crossed that eveything is going to be done for you then this probably won't happen.