Veethree D7 SDK
Loading...
Searching...
No Matches
D7 SDK user walkthrough - Linux Host Builds

Prerequisites

The toolchain for host builds needs to be provided by the Linux distro. Please refer to External dependencies for the host toolchain to install required toolchains before proceeding.

Host build

Building CLI apps

  1. Activate the development environment shell

    # Navigate to the SDK installation directory and source the toolchain
    cd $HOME/d7-sdk
    source ./toolchain/environment-setup-x86_64

    This prepares the shell for building the application using the host environment from the D7 SDK.

  2. Navigate to application source directory to create build directory

    cd examples/hello-world/
    # Create the build directory
    mkdir host-build
    cd host-build/
  3. Configure and build the application
    cmake -S .. -GNinja
    cmake --build .
  4. Run the application. If the build is successful, the output should be
    ~/d7-sdk/examples/hello-world/host-build$ ./cli-hello-world-app
    Hello world from the D7!
    Board Serial Number: n/a
    Board Voltage: 0.00 mV
    Current Brightness: 0 %

Building QML apps

We will use the QML application from the examples/gui/qml-analog directory as an example. As seen on step 6 of this walkthrough (Building a QML application using the D7 SDK), this example demonstrates integrating the D7 SDK and Qt libraries into a single application.

For this example, you will need to have the Qt libraries installed separately from the D7 SDK. Please refer to the guide for installing Qt.

While running on the host, the sensor readings are mocked, since there are no sensors that can be used there. They will all read 249 Ohms.

Steps to build:

  1. Source the environment script with this command:

    source ./toolchain/environment-setup-x86_64
  2. Navigate to the source directory and create the build directory:

    cd examples/gui/qml-analog/
    # Create the build directory
    mkdir host-build
    cd host-build/
  3. Configure and build the project.

    cmake -S.. -GNinja -DCMAKE_PREFIX_PATH=$HOME/Qt/6.10.2/gcc_64
    cmake --build .
Note
For running applications that use the D7 SDK and Qt libraries on the host, you will need to configure the project by setting "CMAKE_PREFIX_PATH" to the installation directory of the Qt libraries.

This guide assumes Qt has been installed at the default location: $HOME/Qt

The previous commands should run without any errors and produce output similar to the following.

Example commands and output

You should now be able to run qml-analog-app from the build directory and it should look like this:

QML Resistance reading app

Previous step

Running apps on the host.

Next Step

If you would like to configure QtCreator to build and run SDK apps on the host, see Running the application on the host via Qt Creator

If you wish to see examples of using the D7 SDK's APIs, please see the D7 software development kit examples section.