On this page

C

Qt Safe Monitor: Qt Quick Ultralite Example on Bare-Metal Traveo II

Demonstrates how to integrate Qt Safe Monitor to a Qt Quick Ultralite application targeting bare-metal Traveo II environment.

Prerequisites

To run this example on the TRAVEO™ T2G Cluster 4M Lite Kit, ensure the following prerequisites are met:

Follow the manufacturer's documentation for detailed instructions on setting up the hardware and software environment. Ensure all dependencies are installed and the hardware is properly connected before proceeding with the example.

For more information about Qt Safe Renderer and Qt Quick Ultralite, see: Getting Started with Qt Safe Renderer and Qt Quick Ultralite

Overview

This example demonstrates how to integrate the Qt Safe Monitor into a Qt Quick Ultralite application with hardware CRC checking. It shows how to generate and use output verification data, and how to interact with the Signature Driver module to verify that the rendering is correct.

The example features a simple simulation of a motorcycle cluster using only safe QML elements. To demonstrate the functionality of the Monitor's CRC checking, the simulation includes a deliberate failure case.

The example is divided into two parts:

  • Monitor - The Qt Safe Monitor adaptation.
  • SafeUI - The Qt Quick Ultralite application.

The build system uses CMake. It compiles the Qt Safe Renderer modules, generates golden CRC values from QML using the Qt Safe Renderer Monitor Config Tool, and links the resulting data library into the main Qt Quick Ultralite application.

During the Monitor build process, the QML layout is parsed to generate output verification data. The Qt Safe Renderer Monitor Config Tool produces a data library containing golden CRC values for each safety item. This data is used at runtime to verify that the rendered output on the screen matches the expected results.

After generating and linking the verification data, the build process continues with the Qt Quick Ultralite application (SafeUI).

The Qt Quick Ultralite application invokes the verification functions. These functions call Signature Driver that execute the hardware CRC checking mechanism. If a CRC failure is detected, the default error handler logs the error to the debug output.

Example Structure

Monitor Components

The Monitor is responsible for generating verification data and interacting with the hardware CRC mechanism. It includes:

ComponentDescription
Signature Driver moduleProvides functions for hardware CRC checking.
qul_log_bridgeBridges Qt Quick Ultralite logging output to the Monitor for debugging purposes.
LibmonitordataGenerates data library that contains golden CRC values for each safety item.
cdd_qsr.cImplements functions that call the Signature Driver for CRC operations.
SafeUI Components

SafeUI integrates Qt Safe Renderer verification into a Qt Quick Ultralite project. It includes:

ComponentDescription
Qmlproject fileDefines the Qt Quick Ultralite configuration for the application.
QML filesThree QML files define the interface: a main layout file, one for SafeTexts, and one for SafeImages.
Asset filesFonts and images used by the UI.
Backend simulation filesProvides simulated backend logic for the example.
main.cppThe entry point of the application, which initializes Qt Quick Ultralite and integrates the Qt Safe Monitor verification logic.
Customizing Error Handling

The default error handler logs the error to the debug output. In production systems, implement your own version to raise alerts or initiate system recovery.

static void defaultErrorHandler(ErrorCode errorType, qint64 arg1, qint64 arg2)
{
    printf("Error: %s\n", errorCodeToString(errorType));
    printf("Item id: %d, CRC checking failed. Actual value: %x\n", (quint32)arg1, (quint32)arg2);
}

Building the Example

For general build instructions, see: Building for Qt Quick Ultralite.

Building the Monitor

Navigate to <Qt installation directory>/Examples/QtSafeRenderer-<version>/saferenderer/qul-monitor/monitor.

Configure the following build command to build the Monitor:

mkdir build
cd build
cmake .. -G Ninja -DCMAKE_TOOLCHAIN_FILE=<Qt installation directory>/Src/QtSafeRenderer-runtime-<version>/cmake/ghs-armv7m.cmake -DQSR_TARGET_TOOLCHAIN_DIR=<GHS compiler installation> -DQSR_SOURCE_DIR=<Qt installation directory>/Src/QtSafeRenderer-runtime-<version> -DDRIVER_PATH=<T2G-SignatureDriver installation> -DQUL_BOARD_SDK_DIR=<TVII-GraphicsDriver installation> -DSAFE_QMLS=<Qt installation directory>/Examples/QtSafeRenderer-<version>/saferenderer/qul-monitor/SafeUI/qml/mainUI.qml -DSAFE_LAYOUT_FONTS=<Qt installation directory>/Examples/QtSafeRenderer-<version>/saferenderer/qul-monitor/SafeUI/fonts
cmake --build .
Building and Running the SafeUI Qt Quick Ultralite Application

After building the Monitor, proceed to build the main Qt Quick Ultralite application.

First, configure Qt Quick Ultralite for the project. Add the following Signature Driver sections to the linker script. The linker script is typically located in <QtMCUs installation directory>/<version>/platform/boards/cypress/tviic2d4mlite-baremetal/cmake/ghs-arm/linker_directives_post.ld.

.cyfssigText ALIGN(4) : {
    *(.cyfssigText)
} > CODE_FLASH

.cyfssigRodata ALIGN(4) : {
    *(.cyfssigRodata)
} > CODE_FLASH

.cyfssigData ALIGN(4) : {
    *(.cyfssigData)
} > SRAM

.cyfssigBss ALIGN(4) : {
    *(.cyfssigBss)
} > SRAM

Then, enable the pre-processor macro to use the LVDS display output. Follow the instructions in LVDS display output on TRAVEO T2G CYT3DL 4M LITE KIT.

Remember to rebuild the Platform library after completing these two steps.

Next, open Qt Creator and navigate to File > Open File or Project...

Select the path: <Qt installation directory>/Examples/QtSafeRenderer-<version>/saferenderer/qul-monitor/SafeUI/CMakeLists.txt.

Follow the instructions provided under the Infineon TRAVEO T2G CYT3DL (4M LITE KIT) tabs in Getting started on Infineon, which explain how to create kits and build and run the Qt Quick Ultralite application in Qt Creator for the target device.

Example Files

Files:

Images:

Available under certain Qt licenses.
Find out more.