Skip to content

Commit a182578

Browse files
feat: Add documentation for slint and flutter
Add a how to develop guide with different UI frameworks including slint and flutter in the Demo Applications section for AM62x/AM62P. Signed-off-by: Telukula Jeevan Kumar Sahu <j-sahu@ti.com>
1 parent b929ff0 commit a182578

11 files changed

Lines changed: 215 additions & 5 deletions

configs/AM62PX/AM62PX_linux_toc.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,5 +180,6 @@ linux/Demo_User_Guides/TI_Apps_Launcher_User_Guide
180180
linux/Demo_User_Guides/Seva_Store
181181
linux/Demo_User_Guides/Display_Cluster_User_Guide
182182
linux/Demo_User_Guides/Chromium_Browser
183+
linux/Demo_User_Guides/GUI_Frameworks_User_Guide
183184

184185
linux/Documentation_Tarball

configs/AM62X/AM62X_linux_toc.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ linux/Demo_User_Guides/index_Demos
182182
linux/Demo_User_Guides/TI_Apps_Launcher_User_Guide
183183
linux/Demo_User_Guides/Seva_Store
184184
linux/Demo_User_Guides/Chromium_Browser
185+
linux/Demo_User_Guides/GUI_Frameworks_User_Guide
185186

186187
common/PRU-ICSS/Getting_Started_with_PSSP
187188
common/PRU-ICSS/Header_Files
84.5 KB
Loading
303 KB
Loading
47.8 KB
Loading
195 KB
Loading
60.5 KB
Loading
31.8 KB
Loading
Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
.. _GUI_Frameworks_User_Guide:
2+
3+
##############
4+
GUI Frameworks
5+
##############
6+
7+
This document provides an overview of how to develop with different GUI frameworks on
8+
the |__PART_FAMILY_NAME__| platform. The SDK supports many GUI frameworks, including
9+
QT, Flutter and Slint. Use these frameworks to create rich graphical user interfaces
10+
for embedded applications.
11+
12+
See the :ref:`TI-Apps-Launcher-User-Guide-label` documentation for more information about Qt-based demos.
13+
This guide provides a brief overview of Flutter and Slint, along with instructions on how to build and run demos for each.
14+
15+
***************************
16+
How to Develop With Flutter
17+
***************************
18+
19+
Overview
20+
========
21+
22+
The `Flutter <https://flutter.dev/>`__ software development kit from Google is a popular
23+
open source framework for building natively compiled, multi-platform applications from a
24+
single codebase. It offers fast development cycles, expressive GUI, and excellent performance.
25+
26+
Build Instructions
27+
==================
28+
29+
Developers who want to use Flutter to build applications on TI embedded platforms,
30+
can follow the process described in the following steps:
31+
32+
#. **Prepare your Yocto environment:**
33+
Complete the one-time setup prerequisites listed in the |__SDK_FULL_NAME__| documentation at :ref:`building-the-sdk-with-yocto`.
34+
35+
#. **Configure and build the SDK:**
36+
The following commands will set up the necessary flutter layers(`meta-flutter <https://layers.openembedded.org/layerindex/branch/master/layer/meta-flutter/>`__) and build the image.
37+
38+
.. code-block:: bash
39+
40+
# Set up the base SDK layers
41+
git clone https://git.ti.com/git/arago-project/oe-layersetup.git tisdk
42+
cd tisdk
43+
44+
# Replace <oeconfig-file> with the appropriate file for the release
45+
# uncomment the meta-flutter layer configuration in the selected <oeconfig-file>
46+
./oe-layertool-setup.sh -f configs/processor-sdk/<oeconfig-file>
47+
cd build
48+
49+
# Add the flutter example demo package to the image
50+
echo 'IMAGE_INSTALL:append = " flutter-wayland-client flutter-samples-material-3-demo"' >> conf/local.conf
51+
52+
# Source the environment and build the image
53+
. conf/setenv
54+
MACHINE=<machine> bitbake -k tisdk-default-image
55+
56+
.. note::
57+
58+
Please refer to the :ref:`Yocto Layer Configuration <yocto-layer-configuration>` guide to
59+
find the correct :file:`<oeconfig-file>` for the SDK release. The ``<machine>`` variable should
60+
be set to your target device as in :ref:`Build_Options`.
61+
62+
#. **Flash the SD Card:**
63+
Once the build is complete, flash the generated image at :file:`build/deploy-ti/images/<machine>/tisdk-default-image-<machine>.wic.xz`
64+
on to a SD card. Please follow the instructions from here to :ref:`Flash an SD card <processor-sdk-linux-create-sd-card>`.
65+
66+
Running the Demo
67+
================
68+
69+
After booting the board with the new image, the following :file:`flutter-samples-material-3-demo` shows on the Wayland display after running the following commands:
70+
71+
.. code-block:: bash
72+
73+
systemctl stop ti-apps-launcher
74+
# Run the demo as weston user
75+
su weston
76+
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
77+
78+
.. image:: /images/flutter-samples-material-3-demo.png
79+
:width: 50%
80+
:align: center
81+
:alt: Flutter Samples Material 3 Demo
82+
83+
For application specific performance imporvements, refer this `App note <https://www.ti.com/lit/po/sprt761a/sprt761a.pdf>`__.
84+
85+
*************************
86+
How to Develop With Slint
87+
*************************
88+
89+
Overview
90+
========
91+
92+
`Slint <https://slint.dev/>`_ is a declarative GUI toolkit to build native user interfaces
93+
for embedded systems and desktop applications. It is designed to be lightweight and efficient,
94+
making it a good choice for resource-constrained embedded systems.
95+
96+
Slint uses a flexible architecture with interchangeable rendering backends. By default,
97+
it uses its own built-in **FemtoVG** renderer, which is a lightweight, hardware-accelerated
98+
engine that leverages OpenGL ES 2.0. This makes it highly efficient and well-suited for
99+
embedded GPUs like the PowerVR series on the |__PART_FAMILY_NAME__|, providing a great
100+
balance of performance and low resource usage out-of-the-box.
101+
102+
Build Instructions
103+
==================
104+
105+
This guide provides instructions on how to add the `meta-slint <https://layers.openembedded.org/layerindex/branch/master/layer/meta-slint/>`__ layer
106+
to the Yocto build system of the TI Processor SDK to build and run Slint applications.
107+
108+
#. **Prepare your Yocto environment:**
109+
Complete the one-time setup prerequisites listed in the |__SDK_FULL_NAME__| documentation at :ref:`building-the-sdk-with-yocto`.
110+
111+
#. **Configure and build the SDK:**
112+
The following commands will set up the necessary Slint and dependent layers and build the image.
113+
114+
.. code-block:: bash
115+
116+
# Set up the base SDK layers
117+
git clone https://git.ti.com/git/arago-project/oe-layersetup.git tisdk
118+
cd tisdk
119+
120+
# Create a new config for Slint and add the required meta-layers
121+
# Replace <oeconfig-file> with the appropriate file for the release
122+
cp configs/processor-sdk/<oeconfig-file> configs/slint-config.txt
123+
echo "meta-slint,https://github.com/slint-ui/meta-slint.git,main,7406ee51c140968345b86f3927a8c67984a2dda8,layers=" >> configs/slint-config.txt
124+
echo "meta-rust-bin,https://github.com/rust-embedded/meta-rust-bin.git,master,79c077fac9694eb5fbcee7b15e800c21e887bb5d,layers=" >> configs/slint-config.txt
125+
126+
# Set up the bitbake build environment
127+
./oe-layertool-setup.sh -f configs/slint-config.txt
128+
cd build/
129+
130+
# Add the slint-demos package to the image
131+
echo 'IMAGE_INSTALL:append = " slint-demos"' >> conf/local.conf
132+
133+
# Source the environment and build the image
134+
. conf/setenv
135+
MACHINE=<machine> bitbake -k tisdk-default-image
136+
137+
.. note::
138+
139+
Please refer to the :ref:`Yocto Layer Configuration <yocto-layer-configuration>` guide to
140+
find the correct ``<oeconfig-file>`` for your SDK release. The ``<machine>`` variable should
141+
be set to your target device as in :ref:`Build_Options`.
142+
143+
#. **Flash the SD Card:**
144+
Once the build is complete, flash the generated image at :file:`build/deploy-ti/images/<machine>/tisdk-default-image-<machine>.wic.xz`
145+
on to a SD card. Please follow the instructions from here to :ref:`Flash an SD card <processor-sdk-linux-create-sd-card>`.
146+
147+
Running the Demos
148+
=================
149+
150+
After booting the board with the new image, you will find several Slint demo binaries located in :file:`/usr/bin`, including:
151+
152+
* :file:`energy-monitor`
153+
* :file:`gallery`
154+
* :file:`home-automation`
155+
* :file:`opengl_texture`
156+
* :file:`opengl_underlay`
157+
* :file:`printerdemo`
158+
* :file:`slide_puzzle`
159+
160+
To run a demo, first stop the ti-apps-launcher that runs out-of-box and then execute the desired binary.
161+
For example, to run the "home-automation" demo on a Wayland display:
162+
163+
.. code-block:: bash
164+
165+
systemctl stop ti-apps-launcher
166+
# Run the demo as weston user
167+
su weston
168+
WAYLAND_DISPLAY=/run/user/1000/wayland-1 /usr/bin/home-automation
169+
170+
171+
.. image:: /images/slint_home_automation.png
172+
:width: 50%
173+
:alt: Slint Home Automation Demo
174+
175+
Here are some snapshots of the other demos running on the device.
176+
177+
.. list-table::
178+
:widths: 50 50
179+
:header-rows: 0
180+
181+
* - .. figure:: /images/slint_opengl_texture.png
182+
:align: center
183+
:alt: Slint OpenGL Texture Demo
184+
185+
OpenGL Texture Demo
186+
187+
- .. figure:: /images/slint_opengl_underlay.png
188+
:align: center
189+
:alt: Slint OpenGL Underlay Demo
190+
191+
OpenGL Underlay Demo
192+
193+
* - .. figure:: /images/slint_printer_demo.png
194+
:align: center
195+
:alt: Slint Printer Demo
196+
197+
Printer Demo
198+
199+
- .. figure:: /images/slint_puzzle_demo.png
200+
:align: center
201+
:alt: Slint Puzzle Demo
202+
203+
Puzzle demo

source/linux/Demo_User_Guides/TI_Apps_Launcher_User_Guide.rst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
TI Apps Launcher - User Guide
44
=============================
55

6+
The TI Apps Launcher uses the Qt framework. The SDK also supports other modern UI toolkits,
7+
such as Flutter and Slint. For instructions on building applications with these frameworks,
8+
see the :ref:`GUI_Frameworks_User_Guide`.
9+
610
Overview
711
--------
812

@@ -273,9 +277,9 @@ Launching the GPU Performance Demo
273277

274278
.. Image:: /images/ti-apps-launcher-gpu-performance.png
275279
:height: 400
276-
280+
277281
3. You will see the updated values of FPS & Score metrices getting populated in the table.
278-
282+
279283
.. ifconfig:: CONFIG_sdk in ('j7_foundational')
280284

281285
3. The image below is captured while running the `glmark2` with **GPU Load Level as 3**.
@@ -294,7 +298,7 @@ Launching the Seva Store
294298

295299
Seva Store is not supported on AM62xSIP due to it's memory constraints.
296300

297-
1. |__SDK_FULL_NAME__| now supports Seva Store. Seva Store is a TI developed demo gallery which allows users to download and install demos on the go. Developers can host their demos as Docker Images on any public Docker Registry and link them to Seva Design Gallery.
301+
1. |__SDK_FULL_NAME__| now supports Seva Store. Seva Store is a TI developed demo gallery which allows users to download and install demos on the go. Developers can host their demos as Docker Images on any public Docker Registry and link them to Seva Design Gallery.
298302

299303
2. Refer :ref:`Seva Store - User Guide <Seva-Store-label>` to know more about Seva Store.
300304

@@ -313,13 +317,13 @@ Launching the Chromium Browser
313317
Chromium Browser is not supported on AM62xSIP due to it's memory constraints.
314318

315319
1. |__SDK_FULL_NAME__| now supports GPU Accelarated Chromium Browser. Click on the Chromium button on the left panel.
316-
320+
317321
2. Click Launch button to launch the Chromium Browser. The Browser launches with `WebGL Aquarium <https://webglsamples.org/aquarium/aquarium.html>`__ as the first tab by default.
318322

319323
.. ifconfig:: CONFIG_part_variant in ('AM62X')
320324

321325
.. Image:: /images/chromium-browser-am62x.png
322-
:height: 400
326+
:height: 400
323327

324328
.. ifconfig:: CONFIG_part_variant in ('AM62PX')
325329

0 commit comments

Comments
 (0)