Veethree D7 SDK
Loading...
Searching...
No Matches
Setup the D7 SDK to use in Qt Creator

Note
In order to use Qt libraries you must have your own Qt development and distribution licenses. Please refer to https://www.qt.io/qt-licensing for more information.

Installing Qt Creator

Please refer to the guide for installing Qt for the necessary steps to install the Qt libraries and Qt Creator.

Please make a note of the installation directory for the Qt libraries. It will be required later.

The reference documentation for installing Qt Creator can be found here.

Adding the D7 SDK as a Kit in Qt Creator

The tool qt-kit-setup in tools directory can be used to set up the D7 Kit.

The path to Qt's sdktool is required for the qt-kit-setup script.

Assuming Qt was installed in the default path, the sdktool should be at $HOME/Qt/Tools/sdktool/libexec/qtcreator/sdktool on Linux and at C:\Qt\Tools\sdktool\bin\sdktool.exe on Windows. If Qt is not installed in the default location, please refer to Qt SDK Tool docs for finding the path to the sdktool.

Linux

$HOME/d7-sdk/tools/qt-kit-setup --sdktool-path=<SDK-TOOL-PATH>

Windows

%USERPROFILE%\d7-sdk\tools\qt-kit-setup.exe --sdktool-path=<SDK-TOOL-PATH>

Follow the instructions it displays to enable the Qt Kit configuration for the device. For parameters reference, see the --help option.

Note: Make sure to use the absolute path to the sdktool. It will not work with relative paths or paths that start with ~.

Please refer to Qt's documentation page for finding the path to the sdktool.

After running the script, you will need to restart Qt Creator to see the change. A Qt kit named VeethreeD7 will be created.

Removing the D7 SDK Kit from Qt Creator

If you configured a Qt Creator kit and wish to uninstall it, use the same executable qt-kit-setup with an additional flag --remove. The path to Qt's sdktool is necessary for removing the kit, so please check the previous section for instructions on finding the path.

Linux

$HOME/d7-sdk/tools/qt-kit-setup --sdktool-path=<SDK-TOOL-PATH> --remove

Windows

%USERPROFILE%\d7-sdk\tools\qt-kit-setup.exe --sdktool-path=<SDK-TOOL-PATH> --remove

Follow the instructions it displays to enable the Qt Kit configuration for the device.

After running the qt-kit-setup executable, you will need to restart Qt Creator to see the changes. The VeethreeD7 kit will have been removed.

Important
Qt caches paths to the kit in the build directories. This may cause issues if you need to uninstall and re-install the kit to upgrade to a new version of the SDK.

For a clean changeover to the new kit, make sure you delete build directories and reconfigure the D7 kit from the list of configured kits in all projects.

Opening and building the QML example app

Open Qt Creator, click on "Open Project..." and navigate to the SDK installation directory, then into the examples/gui/qml-analog directory and double click on CMakeLists.txt.

Select QML project

Tick the option for using the VeethreeD7 kit.

VeethreeD7 Kit selection

Click on "Manage Kit" and make VeethreeD7 the default kit.

Manage kit
Make default kit

Click "Apply", then click on "Configure Project" in the bottom-right corner.

There should be no errors in configuring the project.

Running the application on the device via Qt Creator

You will need to add the device into Qt Creator. Please refer to Qt's guide for doing so: https://doc.qt.io/qtcreator/creator-how-to-add-remote-linux.html.

When prompted for the device configuration, set the D7's IP address, the port to 22 and the username to root.

Device config

Make sure the "Source /etc/profile and $HOME/.profile" option is checked.

Source environment

Click the "Play" button. The application should start running on the device.

Debugging the application while running on the device

Remarks
This will only work using the development image, as debugging on the device requires gdbserver

The release image does not contain a debugger. See the differences between release and development images.

To test that debugging the application while it's running on the target device works, open the main.cpp file and set a breakpoint on the line that loads the ui from the "Main" module (line 19 in the screenshot).

Setting a breakpoint

Then you will need to make sure that the project will run on the target device by checking that the "Run device" is set to your D7, the "Kit" is set to "VeethreeD7" and "Deploy" is set to "Deploy to Remote Linux Host":

Selecting the D7 device

You should now be able to launch the project with a debugger attached:

Launch with debug

(Optional) Troubleshooting

If the D7 is running the default application, you may get an error like:

Could not set DRM mode for screen LVDS1 (Permission denied)
Could not queue DRM page flip on screen LVDS1 (Permission denied)

you may have to stop the default application.

To do so, open a new D7 shell and stop the default service:

systemctl stop qml-hello-world-app

To run the above command before deploying your application from Qt Creator, add a deploy step to Run custom remote command in "Deployment" section of "Run Settings" of the VeethreeD7 kit.

Run custom remote command

Summary

In this section we have described setting up Qt Creator to be able to build applications for the device using the D7 SDK and deploy them to a development board.

Previous step

Installing Qt libraries and Qt Creator

Next step

The next step now is to build and run applications on the host machine.