C
Monitor Integration to Qt Ultralite with AUTOSAR
Demonstrates how to integrate Qt Safe Renderer Monitor to a Qt Ultralite application targeting AUTOSAR-compliant environments.
This example demonstrates how to integrate the Qt Safe Renderer (QSR) Monitor module into a Qt Ultralite application with AUTOSAR CRC checking. It shows how to generate and use output verification data, and how to interact with the AUTOSAR hardware interface to verify that the rendering is correct.
For more information about implementing safety-critical elements in Qt Ultralite, see: Qt Quick Ultralite application with safety-critical items
The build system uses CMake. The example builds QSR modules, generates the golden CRC values from QML using the QSR Monitor Config Tool, and links the resulting data library into a monitor test application.
Overview
The QML layout is parsed at build time to generate output verification data. The tool produces a data library containing the golden CRC values for each safety item state. This data is later used during runtime to verify that the rendering output on the screen matches the expected results.
The verification is done by calling AUTOSAR CDD stub functions that simulate the hardware CRC checking mechanism.
Customizing Error Handling
The default error handler prints 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); }
AUTOSAR HW Integration
The example includes only a stub implementation of the AUTOSAR CDD interface. Real implementations must provide CRC access logic using MCU hardware features.
The Qt Ultralite reference implementation supports the following HW targets:
- Infineon Traveo II.
- Renesas RH850.
For more information and a reference AUTOSAR project for the platforms, contact The Qt Company.
Example Files
CMakeLists.txt
- Build setup.main.c
- Monitor test loop and verification setup.cdd_qsr_stub.c
- AUTOSAR CDD interface stubs for CRC verification.SafeUI.qml
- Safety-critical UI layout.
Files:
- saferenderer/qul-monitor/CMakeLists.txt
- saferenderer/qul-monitor/libmonitordata/CMakeLists.txt
- saferenderer/qul-monitor/qml/SafeUI.qml
Images:
Available under certain Qt licenses.
Find out more.