How to Cross-Compile a Qt Application for Imx6

How to build Qt applications for imx6 processors?

That's a huge question!

At a minimum you need a cross-compiler that runs on your Ubuntu system but makes binaries for your iMX6 (ARM). Typically, when you download Qt it also packages a compiler with it, this compiler is built to run on the platform you downloaded Qt for and to create binaries for this same platform. You need to cross compile, so your host is (probably) x86 but your target is ARM. So you either need to get a pre-built compiler and library chain that runs on x86 and generates ARM binaries or create one yourself. For popular embedded platforms (like a Raspberry Pi for example) there are pre-built toolchains, for development boards a pre-built toolchain of some form is usually available from the vendor. For complete control of a product you would usually build one yourself that exactly met your products needs.

If you were running Qt creator on an ARM platform, the cross compiler would not be necessary, however embedded environments are typically relatively slow with limited resources, hence the cross compile. You cross compile on a fast machine that has all your tools on and run the resulting binary on the slower more limited embedded system.

Then you must cross-compile an operating system that will run on the iMX6, probably including a custom boot loader and drivers appropriate for your embedded system.

Then you need to build Qt against this ARM target.

Then you can build your app in Qt on top of all that.

I would suggest you look at Yocto (https://www.yoctoproject.org/) to build a minimal system to run on the iMX6 along with the partnered cross compiler. Alternatively you could look at crosstool-ng (http://crosstool-ng.org/) to build the compiler and then hand roll the O/S on top of that yourself.

Usually, if you have a development board from some manufacturer, they've done all of this for you so you can at least try stuff out day 1!

How to enable EGLFS i.Mx6 QPA for Qt on IMX6Q?

Enable BR2_PACKAGE_IMX_GPU_VIV, which will provide the OpenGL implementation for i.MX6.

Qml components not loaded properly on xcb platform

I'm answering to my own question for whom may face the same problem. I was compiling qt using a sysroot configured to run with Vivante plugin for video acceleration. That was not compatible with eglfs on x11. Without egl , qt libraries are not able to render correctly complex objects such as those mentioned in the question. Compiling with the right dependencies and running with eglfs solved the issue.

QT Creator can not remote run and debugging on i.Mx6 (buildroot)

This is a reported Qt BUG
The problem is that the build system does not select the correct eglfs backend

The solution is to export:

QT_QPA_EGLFS_INTEGRATION=eglfs_viv before running Qt apps, or

QT_QPA_EGLFS_INTEGRATION=none


Related Topics



Leave a reply



Submit