Skip to content

Commit c7f7d97

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 <[email protected]>
1 parent 7d9a71a commit c7f7d97

File tree

10 files changed

+200
-0
lines changed

10 files changed

+200
-0
lines changed

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: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
.. _GUI_Frameworks_User_Guide:
2+
3+
#############
4+
UI Frameworks
5+
#############
6+
7+
This document provides an overview of how to develop with different UI frameworks on
8+
the |__PART_FAMILY_NAME__| platform. The SDK supports many UI 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 UI, 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+
Please refer to the :ref:`Yocto Layer Configuration <yocto-layer-configuration>` guide to
58+
find the correct :file:`<oeconfig-file>` for the SDK release. The ``<machine>`` variable should
59+
be set to your target device as in :ref:`Build_Options`.
60+
61+
#. **Flash the SD Card:**
62+
Once the build is complete, flash the generated image at :file:`build/deploy-ti/images/<machine>/tisdk-default-image-<machine>.wic.xz`
63+
on to a SD card. Please follow the instructions from here to :ref:`Flash an SD card <processor-sdk-linux-create-sd-card>`.
64+
65+
Running the Demo
66+
================
67+
68+
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:
69+
70+
.. code-block:: bash
71+
72+
systemctl stop ti-apps-launcher
73+
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
74+
75+
.. image:: /images/flutter-samples-material-3-demo.png
76+
:width: 50%
77+
:align: center
78+
:alt: Flutter Samples Material 3 Demo
79+
80+
For application specific performance imporvements, refer this `App note <https://www.ti.com/lit/po/sprt761a/sprt761a.pdf>`__.
81+
82+
*************************
83+
How to Develop With Slint
84+
*************************
85+
86+
Overview
87+
========
88+
89+
`Slint <https://slint.dev/>`_ is a declarative GUI toolkit to build native user interfaces
90+
for embedded systems and desktop applications. It is designed to be lightweight and efficient,
91+
making it a good choice for resource-constrained embedded systems.
92+
93+
Slint uses a flexible architecture with interchangeable rendering backends. By default,
94+
it uses its own built-in **FemtoVG** renderer, which is a lightweight, hardware-accelerated
95+
engine that leverages OpenGL ES 2.0. This makes it highly efficient and well-suited for
96+
embedded GPUs like the PowerVR series on the |__PART_FAMILY_NAME__|, providing a great
97+
balance of performance and low resource usage out-of-the-box.
98+
99+
Build Instructions
100+
==================
101+
102+
This guide provides instructions on how to add the `meta-slint <https://layers.openembedded.org/layerindex/branch/master/layer/meta-slint/>`__ layer
103+
to the Yocto build system of the TI Processor SDK to build and run Slint applications.
104+
105+
#. **Prepare your Yocto environment:**
106+
Complete the one-time setup prerequisites listed in the |__SDK_FULL_NAME__| documentation at :ref:`building-the-sdk-with-yocto`.
107+
108+
#. **Configure and build the SDK:**
109+
The following commands will set up the necessary Slint and dependent layers and build the image.
110+
111+
.. code-block:: bash
112+
113+
# Set up the base SDK layers
114+
git clone https://git.ti.com/git/arago-project/oe-layersetup.git tisdk
115+
cd tisdk
116+
117+
# Create a new config for Slint and add the required meta-layers
118+
# Replace <oeconfig-file> with the appropriate file for the release
119+
cp configs/processor-sdk/<oeconfig-file> configs/slint-config.txt
120+
echo "meta-slint,https://github.com/slint-ui/meta-slint.git,main,7406ee51c140968345b86f3927a8c67984a2dda8,layers=" >> configs/slint-config.txt
121+
echo "meta-rust-bin,https://github.com/rust-embedded/meta-rust-bin.git,master,79c077fac9694eb5fbcee7b15e800c21e887bb5d,layers=" >> configs/slint-config.txt
122+
123+
# Set up the bitbake build environment
124+
./oe-layertool-setup.sh -f configs/slint-config.txt
125+
cd build/
126+
127+
# Add the slint-demos package to the image
128+
echo 'IMAGE_INSTALL:append = " slint-demos"' >> conf/local.conf
129+
130+
# Source the environment and build the image
131+
. conf/setenv
132+
MACHINE=<machine> bitbake -k tisdk-default-image
133+
134+
.. note::
135+
Please refer to the :ref:`Yocto Layer Configuration <yocto-layer-configuration>` guide to
136+
find the correct ``<oeconfig-file>`` for your SDK release. The ``<machine>`` variable should
137+
be set to your target device as in :ref:`Build_Options`.
138+
139+
#. **Flash the SD Card:**
140+
Once the build is complete, flash the generated image at :file:`build/deploy-ti/images/<machine>/tisdk-default-image-<machine>.wic.xz`
141+
on to a SD card. Please follow the instructions from here to :ref:`Flash an SD card <processor-sdk-linux-create-sd-card>`.
142+
143+
Running the Demos
144+
=================
145+
146+
After booting the board with the new image, you will find several Slint demo binaries located in :file:`/usr/bin`, including:
147+
148+
* :file:`energy-monitor`
149+
* :file:`gallery`
150+
* :file:`home-automation`
151+
* :file:`opengl_texture`
152+
* :file:`opengl_underlay`
153+
* :file:`printerdemo`
154+
* :file:`slide_puzzle`
155+
156+
To run a demo, first stop the ti-apps-launcher that runs out-of-box and then execute the desired binary.
157+
For example, to run the "home-automation" demo on a Wayland display:
158+
159+
.. code-block:: bash
160+
161+
systemctl stop ti-apps-launcher
162+
WAYLAND_DISPLAY=/run/user/1000/wayland-1 /usr/bin/home-automation
163+
164+
165+
.. image:: /images/slint_home_automation.png
166+
:width: 50%
167+
:alt: Slint Home Automation Demo
168+
169+
Here are some snapshots of the other demos running on the device.
170+
171+
.. list-table::
172+
:widths: 50 50
173+
:header-rows: 0
174+
175+
* - .. figure:: /images/slint_opengl_texture.png
176+
:align: center
177+
:alt: Slint OpenGL Texture Demo
178+
179+
OpenGL Texture Demo
180+
181+
- .. figure:: /images/slint_opengl_underlay.png
182+
:align: center
183+
:alt: Slint OpenGL Underlay Demo
184+
185+
OpenGL Underlay Demo
186+
187+
* - .. figure:: /images/slint_printer_demo.png
188+
:align: center
189+
:alt: Slint Printer Demo
190+
191+
Printer Demo
192+
193+
- .. figure:: /images/slint_puzzle_demo.png
194+
:align: center
195+
:alt: Slint Puzzle Demo
196+
197+
Puzzle demo

source/linux/Demo_User_Guides/index_Demos.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ The SDK supports the following Out-Of-Box demo-applications
1717
Webserver_Demo_User_Guide
1818
Display_Cluster_User_Guide
1919
TI_LVGL_Demo_User_Guide
20+
GUI_Frameworks_User_Guide
2021
AM62D_Dsp_Offload_User_Guide.rst
2122
AM62D_2DFFT_User_Guide.rst
2223

0 commit comments

Comments
 (0)