Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

How to start Qt embedded programming



  • Hello to you,

    I would like to enter Qt embedded programming for the first time. I don't have any real project on hands for the time being; what I actually want is to be able to program devices that are mostly/commonly installed into an automobile or some industry device like a machine controller, etc, because they're highly demanded these days and I know C++/Qt so like to use it for these areas.

    I guess I should start with basics, something common that I can take advantages of it afterwards in the areas I mentioned.

    The tools I nearly certainly will make use are C++/Qt (depending on the target device) and Raspberry Pi 3 which is vastly utilized by Qt.

    So I guess I must know:
    1- How to use C++/Qt for embedded programming? To see how different it's from C++ code I write on Visual Studio or Qt Creator.
    2- What IDE should I use to create programs on and on what operating system?
    3- How to create programs for different embedded devices?
    4- How does Raspberry Pi 3 help me in the tasks?

    Thanks so much.
    I really don't know what embedded target device I will work on first whether it's GUI based or not. Probably both.
    Do you still, by reading the statements above, believe it's better to use a simulator? If so, what simulator do you suggest to me, please?



  • @qcoderpro

    Basically it depends what your current platform is. Since you are writing about use of VisualStudio, I guess it is windows.
    I do my development on Windows 10 using Qt creator with MinGW toolchains. I have switched years back to Qt creator, because you have the same environment on Linux devices.

    I have done cross-compiling for different embedded platforms like BeagleBone and others and also Raspberry Pi3. When the embedded device is using a linux based OS, there is IMHO the best choice to go to a linux desktop for cross-compilation. With Qt creator you have already the same dev environment also on a linux desktop and you can easily switch between desktop and cross-compilation toolchains. I am using VirtualBox for running a Linux installation to perform these tasks.

    There are ways to do cross-compilation for linux embedded devices on windows directly, but personally prefer the strict separation. Especially with the file system it is easier. Typically you need to cross-compile Qt libs for embedded devices on your own.


  • Lifetime Qt Champion

    Hi,

    1. C++ is C++ whether you are compiling for an RPi or a desktop machine. The cross-compiler for the target will define what C++ feature/standard is available to you.
      What can change is the backend you'll be using.
    2. Qt Creator will likely be a good choice to work.
    3. You need the toolchains matching these devices as well as a sysroot that provides all the libraries needed to build your application and or Qt
    4. It's a pretty cheap embedded system that is know to work pretty well with Qt

    If you are interested in the automotive world, you should take a look at the Qt for Automive suite.



  • Thank you both very much.
    What do you mean by cross-compilation, please? Is it what Qt Creator does using different kits for different platforms?

    Is it right that every embedded device should have a kind of operating system and compiler installed firstly and then we're able to write programs (GUI or non-GUI) for it? (It naturally must be true!)

    And also, what is the variety of those operating systems the majority of embedded devices are running whether they have a screen or not, please? And how to recognize the OS when we have the device at hands?


  • Lifetime Qt Champion

    Cross-compilation is the action of building on one architecture for another one. Qt Creator is just an IDE. It gives you a nice and easy way to handle several differs versions of Qt.

    No, but usually, you use the sysroot of the device so you can easily install the development package of libraries you want to use for your application.

    That depends on your target segment, you have various flavour of Linux, VxWorks, Android, etc. Even bare metal to some extent.



  • I devoted good time on Docs to read some related pages but still have some ambiguities, unfortunately.

    To get it straight: If we want to enter the automotive world, using Qt/C++ we had better install Qt Automotive Suite (which has a free/open source license for Linux) on a Linux distro, say Ubunto or Debian, using a virtual machine, for example. correct?

    Do we still need RPi 3/4? For what purpose, please? I guess we need that to cover other areas of embedded systems than Automotive. Correct?



  • @qcoderpro said in How to start Qt embedded programming:

    I devoted good time on Docs to read some related pages but still have some ambiguities, unfortunately.

    To get it straight: If we want to enter the automotive world, using Qt/C++ we had better install Qt Automotive Suite (which has a free/open source license for Linux) on a Linux distro, say Ubunto or Debian, using a virtual machine, for example. correct?

    Apparently no according to https://doc.qt.io/qt-5/qtmodules.html#value-add-modules . However you need to check with commercial guys for what is available.

    Do we still need RPi 3/4? For what purpose, please? I guess we need that to cover other areas of embedded systems than Automotive. Correct?

    You brought up RPi. You need to decide on your device and embedded OS. If that is not RPi or another linux based you might have to check further, if it is suitable for your development.



  • @koahnig

    If it's not free, I can't use it.


  • Lifetime Qt Champion

    Based on the Qt For Automotive installation page, it's dual licensed. As @koahnig suggested, double check with The Qt Company.



  • @sgaist
    It says: To find a license that suits your need, refer to the guide on Download Qt.

    So it has two licenses like the qt itself. Free/open source and the commercial one. I'm using open source Qt so I will install its open source (and limited!) version.

    So my plan is this:
    1_ I will install Qt + Qt Automotive Suite on a Linux machine, say Ubuntu or Debian.
    2_ Then try to find a cheap RPi 3/4 and cross compile it with Qt on the Linux machine.
    And then try embedded programming using C++/Qt.

    Do you find my plan good, please?


Log in to reply