|
Veethree D7 SDK
|
This page goes into detail about the toolchains packaged by the D7 SDK. It will explain the external dependencies for the host machine, why there are separate toolchains for the host machine and the target device, the dependency between them and a rough guide on what each toolchain contains.
From the D7 SDK installation directory, the toolchains can be found in the toolchain\sysroots subdirectory.
In each sysroot you will find executables, shared libraries, static libraries, include headers and package configuration files for CMake and pkg-config packages in the locations you would expect in a regular Linux distribution; i.e. binaries in usr/bin, libraries in usr/lib, headers in usr/include, configurations in etc, etc.
The target device toolchain contains the headers, shared libraries and static libraries necessary for compiling an application for the target.
All the files in toolchain\sysroots\armv8a-veethree-linux, binary or text, refer to the rootfs on the target device and are also compiled for the target device; as such, they will not run on the host.
You need to enable the development environment in every shell where you will be compiling projects for the target device. This should be done by invoking the %USERPROFILE%\d7-sdk\toolchain\environment-setup-armv8a-veethree-linux.bat script in the current shell. This will set a number of environment variables in the current shell to make sure that C and C++ projects are compiled and linked for the target device.
For examples of sourcing the toolchain and building app see:
To use Qt Creator for compiling for the D7, you will need to add the D7 SDK's Qt Creator Kit. Please see Adding the D7 SDK as a Kit in Qt Creator for a guide on how to do that.
Note: The target toolchain depends on utilities from the host sysroot.
In addition to the development tools, the host toolchain also contains some of the libraries available on the target to allow testing some application functionality on the host machine before testing on the target.
Not all the target functionality is available on the host. Specifically, hardware interfaces (described in I/O: Analog, Digital, PWM) are mocked on the host, and libraries required for that functionality are not included in the host toolchain (for instance, libgpiod is not available on the host toolchain because gpio functionality is not available on the host via the D7 SDK).
On Windows, the libraries that exist in the host SDK have been built to be compatible with the Desktop Qt 6.10.2 MinGW 64-bit kit.
If you have followed Qt install step and installed the MinGW toolchain, you can skip this section.
If Qt is installed but MinGW isn’t, use the Qt Maintenance Tool to add it. Otherwise, download the toolchain separately.
To add the toolchain as an install component:
The toolchain can be downloaded from here independently of Qt. After downloading the file, extract the toolchain.
To use the toolchain, you will need to add the %toolchain_path%\mingw1310_64\bin, the downloaded toolchain's bin folder, to the PATH environment variable to make the tools available on the command line and to other tools such as CMake. Pick one of the two methods below.
You will need to run this everytime you start a new terminal session. For persistent variables see the next section.
If you have downloaded the toolchain independently, run:
If you have installed the toolchain using Qt Maintenance Tool, the toolchain will be installed in Qt install location, which is assumed to be C:\Qt. Add the toolchain to PATH using:
Adding variables here will persist between terminal sessions.
To build and run apps on the host, the host toolchains need to be sourced to set required environment variables in the current shell. Please refer to Windows Host Builds for full instructions to build and run both CLI and QML apps.
To use Qt Creator for compiling D7 SDK applications for the host, it is good practice to create a clone of the default desktop kit, such that it can be rebuilt as many times as needed in case it ever drifts from a working configuration.
Please see Qt host build kit for windows.