|
Veethree D7 SDK
|
Once you have built your application, in order to run it when the device powers on, you will need to have in place a few things:
There are two ways to create a software update:
This page covers the latter: taking an existing application and making a SWU for it.
The next step after this page covers applying a software update to the device.
Once again, we will use the QML application that reads resistances from the analog sensors, so the setup and test harness are the same as in Building a QML application using the D7 SDK.
We will need to configure the project for the target with a convenient install location set. Any folders named target-build from earlier step should be deleted because the build configuration files are written to target-build in this step.
Activate the development environment shell to prepare the development shell for building the application
Linux
Windows
Navigate to application source directory to create build directory
Configure and build with the install location set to target-install
The commands here should run without errors; then if you navigate to the target-install directory, you should see the following file structure:
Navigate to examples/gui/qml-analog/target-install, created from the previous section. In that folder, create a systemd unit file qml-analog-app.service with the contents:
Please note the path of the executable is /app/bin/qml-analog-app since the directory structure will be replicated on the /app partition on the device.
Also of note, the Environment File being /etc/qt/qt-environment. That file contains a number of environment variables which are necessary for Qt QML applications.
The application will be run as root without sourcing the usual profile scripts, and so setting the environment file in the systemd unit is necessary.
The target-install directory should look like this now:
After applying an update, the operating system on the D7 will check to make sure that within 60 seconds of starting up all the critical services have succeeded. If not, the board will automatically revert to the previous running image. See A/B update scheme for more information.
If your application has multiple services and some of them are allowed to fail, you will need to mark them as non-critical. To do so, run:
On Linux:
On Windows:
Add each non-critical service on a new line of the "app.conf" file.
The software update image is created using the swugen utility, also from tools in the D7 SDK installation directory. See more details swugen.
On Linux:
On Windows:
The --development switch tells swugen to create a development image. Alternatively, the --release switch would create a release image. Run swugen --help for a list of all supported options.
On this page we have described the necessary steps to create a software update image that can be flashed onto the device which will run a compiled application on the device startup.
Please also check the software update details page for more information on the validation that takes place after a software update is applied.
Building a QML application using the D7 SDK