6.6. GUI Frameworks
This document provides an overview of how to develop with different GUI frameworks on the AM62Px platform. The SDK supports many GUI frameworks, including QT, Flutter and Slint. Use these frameworks to create rich graphical user interfaces for embedded applications.
See the TI Apps Launcher - User Guide documentation for more information about Qt-based demos. This guide provides a brief overview of Flutter and Slint, along with instructions on how to build and run demos for each.
6.6.1. How to Develop With Flutter
6.6.1.1. About Flutter
The Flutter software development kit from Google is a popular open source framework for building natively compiled, multi-platform applications from a single codebase. It offers fast development cycles, expressive GUI, and excellent performance.
6.6.1.2. Building with Flutter
Developers who want to use Flutter to build applications on TI embedded platforms, can follow the process described in the following steps:
Prepare your Yocto environment: Complete the one-time setup prerequisites listed in the Processor SDK Linux AM62Px documentation at Building the SDK with Yocto.
Configure and build the SDK: The following commands will set up the necessary flutter layers(meta-flutter) and build the image.
# Set up the base SDK layers git clone https://git.ti.com/git/arago-project/oe-layersetup.git tisdk cd tisdk # Replace <oeconfig-file> with the default oe-config file for the release # uncomment the meta-flutter layer configuration in the selected <oeconfig-file> ./oe-layertool-setup.sh -f configs/processor-sdk/<oeconfig-file> cd build # Add the flutter example demo package to the image echo 'IMAGE_INSTALL:append = " flutter-wayland-client flutter-samples-material-3-demo"' >> conf/local.conf # Source the environment and build the image . conf/setenv MACHINE=<machine> bitbake -k tisdk-default-image
Note
See the Yocto Layer Configuration guide to find the correct
<oeconfig-file>for the SDK release. Set the<machine>variable to your target device as in Build Options.Flash the SD Card: Once the build is complete, flash the generated image at
build/deploy-ti/images/<machine>/tisdk-default-image-<machine>.wic.xzon to a SD card. See Flash an SD card for instructions.
6.6.1.3. Running the Demo
After booting the board with the new image, the following flutter-samples-material-3-demo shows on the Wayland display after running the following commands:
systemctl stop ti-apps-launcher
# Run the demo as weston user
su weston
WAYLAND_DISPLAY=/run/user/1000/wayland-1 LD_LIBRARY_PATH=/usr/share/flutter/flutter-samples-material-3-demo/3.38.3/release/lib flutter-client --bundle=/usr/share/flutter/flutter-samples-material-3-demo/3.38.3/release
For application specific performance imporvements, refer this App note.
6.6.2. How to Develop With Slint
6.6.2.1. About Slint
Slint is a declarative GUI toolkit to build native user interfaces for embedded systems and desktop applications. It is designed to be lightweight and efficient, making it a good choice for resource-constrained embedded systems.
Slint uses a flexible architecture with configurable renderers and backends, controlled
by PACKAGECONFIG in meta-slint. See the meta-slint features documentation for the full list of available
renderers and backends and how to configure them.
On AM62Px, the image adapts to the board’s graphics stack. Devices with a GPU render through the hardware-accelerated Skia renderer. GPU-less devices fall back to the Skia software renderer.
6.6.2.2. Building with Slint
When meta-slint is included in the Yocto layer configuration, two image targets are available:
Image target |
What you get |
|---|---|
|
Full TI SDK image with Slint demo binaries in |
|
Slint-focused image with the same demo binaries and slint-viewer, plus slint-launcher which starts automatically on boot and presents a graphical list of demos to launch. |
Download a pre-built image
TI SDK image: Download
tisdk-default-imagefrom AM62Px-SDK-Download-page.Slint demo image: Download from the meta-slint releases page (based on
ti-image-slint-demos, includes the demo launcher).
Flash the downloaded image to an SD card as described in Flash an SD card.
Build from source
Follow the steps in Building the SDK with Yocto. Use the default oe-config file, which includes
the meta-slint layer. See Yocto Layer Configuration to find the
correct oe-config file for the release.
# Standard TI SDK image with Slint demos
MACHINE=<machine> bitbake tisdk-default-image
# Slint-focused image with demo launcher
MACHINE=<machine> bitbake ti-image-slint-demos
Flash the generated image at build/deploy-ti/images/<machine>/<image>-<machine>.wic.xz
onto a SD card. See Flash an SD card for instructions.
6.6.2.3. Running the Demos
The following Slint demo binaries are available in /usr/bin on both image types:
energy-monitorgalleryhome-automationopengl_textureopengl_underlayprinterdemoslide_puzzle
With ti-image-slint-demos (or Slint pre-built image): slint-launcher starts automatically on boot. Select and start any demo from the graphical list.
With tisdk-default-image: Run demos manually. Stop the ti-apps-launcher first before starting any demo. For example, to run the home-automation demo on a Wayland display:
systemctl stop ti-apps-launcher
# Run the demo as weston user
su weston
WAYLAND_DISPLAY=/run/user/1000/wayland-1 /usr/bin/home-automation
6.6.2.3.1. Slint Viewer
The images now include slint-viewer, a tool for previewing .slint UI files directly
on the board. Run it in remote mode to connect from your development machine and push live UI updates
to the board as you edit, without rebuilding:
# View all available options
slint-viewer --help
# Start in remote mode — board waits for editor to connect
slint-viewer --remote
In your editor’s Slint live preview, select Remote and enter the address shown on the board. See the Slint Viewer documentation for full usage.
Here are some snapshots of the other demos running on the device (OpenGL demos require a GPU).
Fig. 6.1 OpenGL Texture Demo |
Fig. 6.2 OpenGL Underlay Demo |
Fig. 6.3 Printer Demo |
Fig. 6.4 Puzzle demo |
Fig. 6.5 Energy Monitor |
Fig. 6.6 Gallery Demo |