Search code examples
qtqt-creatorbuildrootimx6

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


Using Qt Creator 4.0.2 base on Qt 5.7.0, my app name is test

Board : i.M6Q with buildroot (Qt 5.9)

Questions:

A. When I run qt app show this error

EGL library doesn't support Emulator extensions 
Aborted
Application finished with exit code 134.

But I can run qt app in board using ./test, and it shows normally

B. And When I start debugging show this error

The GDB process terminated unexpectedly (exit code 1)

How to fix these errors?

The following is what I have set up:

  1. test.pro

    QT += core gui
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    TARGET = test
    TEMPLATE = app
    SOURCES += main.cpp\
    mainwindow.cpp
    HEADERS  += mainwindow.h
    FORMS    += mainwindow.ui
    
    target.path = /root/test
    INSTALLS += target
    
  2. Tools > Options > Build & Run > Compilers

    Name : imx6 buildroot GCC

    buildroot/output/host/usr/bin/arm-buildroot-linux-uclibcgnueabihf-g++
    
  3. Tools > Options > Build & Run > Debuggers

    Name : IMX6 buildroot gdb

    buildroot/output/host/usr/bin/arm-buildroot-linux-uclibcgnueabihf-gdb
    
  4. Tools > Options > Build & Run > Qt Versions

    Version Name : Qt %{Qt:Version} (buildroot)

    buildroot/output/host/usr/bin/qmake
    
  5. Tools > Options > Build & Run > Kits look like this image

  6. Tools > Options > Devices:

    Device test finished successfully.
    
  7. This is my main.cpp

    #include "mainwindow.h"
    #include <QApplication>
    int main(int argc, char *argv[])
    {
        QApplication a(argc, argv);
        MainWindow w;
        w.show();
    
        return a.exec();
    }
    

Solution

  • 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