Problems with QML and SAM-BA v3 for a custom GUI

Microchip in-system programming solution: SAM-BA

Moderators: nferre, fab

adahl
Location: Germany
Posts: 4
Joined: Thu Jan 24, 2019 3:37 pm

Problems with QML and SAM-BA v3 for a custom GUI

Wed Oct 16, 2019 9:34 am

Hei hei,

for our production tools I'm trying to build a custom GUI working with SAM-BA v3. My idea was to use Qt and QML and include SAM-BA to connect to the target board, load applets, run tests etc. The SAM-BA docs come with some information on how to extend SAM-BA with custom command-line scripting, just basic things however.

What I tried so far (on my host computer with Debian GNU/Linux version 9 (stretch) and self built Qt 5.9.3 as required by SAM-BA v3.3):

Writing a standalone example QML file like this:

Code: Select all

import QtQuick 2.3
import SAMBA 3.2
import SAMBA.Connection.Serial 3.2

Rectangle {
    id: simpleButton
    color: "grey"
    width: 150; height: 75

    Text {
        id: buttonLabel
        anchors.centerIn: parent
        text: "button label"
    }

    SerialConnection {
        /*
        onConnectionOpened: print("Connection opened")
        onConnectionFailed: print("Connection failed: " + message)
        onConnectionClosed: print("Connection closed")
        */
    }
}
Calling it like in the docs leads to a segfault.

Code: Select all

./sam-ba -x /path/to/my-gui.qml
gdb shows this:

Code: Select all

Thread 1 "sam-ba" received signal SIGSEGV, Segmentation fault.
0x00007ffff76251b2 in ?? () from /home/adahl/release/sam-ba_v3.3/lib/libQt5Gui.so.5
However it works going to my folder and calling the my-gui.qml file with qml or qmlscene like this:

Code: Select all

qml -I ~/release/sam-ba_v3.3/qml my-gui.qml
This is all nice, but 'qml' and 'qmlscene' are dev tools and need a Qt dev environment, this is not recommended for deploying it later.

So I made a new Qt Quick Application project in Qt Creator and try to use SAM-BA from there and this is where I got stuck. :(

I can call the generated and adapted 'main.qml' from outside Qt Creator with 'qml' or 'qmlscene' like above. Building the project with Qt Creator also succeeds. However running it fails:
QQmlApplicationEngine failed to load component
qrc:/main.qml:6 module "SAMBA.Connection.Serial" is not installed
qrc:/main.qml:5 module "SAMBA" is not installed
qrc:/main.qml:6 module "SAMBA.Connection.Serial" is not installed
qrc:/main.qml:5 module "SAMBA" is not installed
I already added the path to the qml subfolder of my sam-ba release directory to 'QML_IMPORT_PATH' in my .pro file, but the error persists.

Has anyone a hint on how to setup a Qt * GUI project and use SAM-BA v3 from it?

Any help appreciated. I am willing to share all insights I'll collect as well. :wink:

Greets
Alex
adahl
Location: Germany
Posts: 4
Joined: Thu Jan 24, 2019 3:37 pm

Re: Problems with QML and SAM-BA v3 for a custom GUI

Thu Oct 17, 2019 10:13 am

I talked to a friend of mine yesterday who is an experienced Qt developer and he advised to post this problem to the Qt forums. Because this is all free software, I did. For reference: https://forum.qt.io/topic/107839
adahl
Location: Germany
Posts: 4
Joined: Thu Jan 24, 2019 3:37 pm

Re: Problems with QML and SAM-BA v3 for a custom GUI

Thu Oct 17, 2019 1:28 pm

This was tough, but I got it running in Qt Creator so far, all I had to do was setting an environment variable named QML2_IMPORT_PATH (see the screenshot in the above linked Qt forum). Note: this has to be set as an environment variable, not some variable in the .pro file!

Maybe I'll come back here, if problems with deployment occur, but I can proceed with developing my application for now. :D

Return to “SAM-BA”

Who is online

Users browsing this forum: No registered users and 1 guest