Veethree D7 SDK
Loading...
Searching...
No Matches
Building a CLI application using the D7 SDK

For this we will be using the example application from examples/hello-world. This application is the usual Hello world! app and will serve as a good example for compiling a simple app using the D7 SDK toolchain, both for the target device and for the host machine.

Host build

Activating the development environment shell

Linux

Open a terminal and navigate to the D7 SDK installation directory. From there run:

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.

Note: You will need a toolchain compatible with your host machine. See External dependencies for the host toolchain.

Windows

Open a terminal and navigate to the D7 SDK installation directory. From there run:

cd %HOME%\d7-sdk
.\toolchain\environment-setup-x86_64-mingw32.bat

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

Note: You will need a toolchain compatible with your host machine. See External dependencies for the host toolchain.

Build and run the app

Now navigate to the application source directory and run:

cd examples/hello-world/
# Create the build directory
mkdir host-build
cd host-build/
# Configure and build the application
cmake -S .. -GNinja
cmake --build .
# Run the application
./cli-hello-world-app

These commands should run without any errors and produce output similar to the following:

Configure and run hello-world

Target build

Activating the development environment shell

Similarly to the host build, we need to prepare the development shell for building the application for the target device.

Linux

Open a new terminal, navigate to the D7 SDK installation directory and run:

cd $HOME/d7-sdk/
source ./toolchain/environment-setup-armv8a-veethree-linux

Windows

Open a new CMD window, navigate to the D7 SDK installation directory and run:

cd %USERPROFILE%\d7-sdk
.\toolchain\environment-setup-armv8a-veethree-linux.bat

Build the app and copy it to the device

From the examples/hello-world directory

cd examples/hello-world/
# Create the build directory
mkdir target-build
cd target-build/
#Configure and build the application
cmake -S .. -GNinja
cmake --build .

These commands should run without any errors and produce the executable which will now be transferred to the device.

Assuming the D7 is connected to the network via ethernet and its IP address is known (see Connecting via SSH), run the following command to transfer the executable:

# Replace $device_ip with the D7's IP address
scp cli-hello-world-app root@$device_ip:/app

Once the transfer is complete, ssh into the device and run the app.

Transfer and run the app on the device

Note for building on Windows

The compiled binary won't be marked as executable, so once you ssh into the device, you will need to run the following command before you run the app:

chmod +x cli-hello-world-app

Summary

On this page we gave a detailed explanation of building a Hello world! CLI application using the D7 SDK for both the target device and the host, and running it.

Previous step

Prepare the D7 device

Next step

If you plan on using Qt libraries, the next step is installing the Qt libraries and Qt Creator.

Otherwise, you can skip directly to Creating software updates.