Debian Codegraph @

lvgl/docs/src/integration/chip_vendors/alif/overview.rst

raw
1 .. _alif_overview:
2
3 ========
4 Overview
5 ========
6
7 Alif Semiconductor is a next-generation chip vendor making chips that come in a
8 variety of configurations. Their chips are designed to excel at multiple aspects
9 at once. They offer combinations of performance, low power consumption,
10 security, and special functionality like AI. Many of their chips have two asymmetrical cores.
11 One core is typically high performance while the other is high efficiency.
12 Alif offers both microcontrollers and microprocessors.
13
14
15 LVGL on Alif Boards
16 *******************
17
18 This is a guide for getting started with LVGL on an Alif board. It specifically details
19 the all the steps needed to get the LVGL example project
20 `alif_m55-lvgl <https://github.com/alifsemi/alif_m55-lvgl>`__ running on the
21 `Alif E7 Devkit Gen2 <https://alifsemi.com/ensemble-e7-series/>`__; however, any project
22 based on the `Alif VS Code Template <https://github.com/alifsemi/alif_vscode-template>`__
23 has a nearly identical setup process
24 so this can be used as a general guide for those. There are other ways to compile for Alif boards
25 such as with Zephyr RTOS. See `Alif's GitHub repos <https://github.com/orgs/alifsemi/repositories>`__.
26
27 This guide is for Linux and Windows.
28
29 This project uses D/AVE 2D rendering acceleration with LVGL's D/AVE 2D :ref:`draw unit<draw>`.
30
31
32 Step-by-Step Guide
33 ------------------
34
35 Install Visual Studio Code
36 ~~~~~~~~~~~~~~~~~~~~~~~~~~
37
38 Install Visual Studio code. There are different ways of installing it depending on your platform.
39 `See here <https://code.visualstudio.com/docs/setup/setup-overview>`__.
40
41 .. note::
42
43 The remaining steps can **optionally** be done inside a Docker container. You can connect to the Docker container
44 as a VS Code remote dev container.
45
46 There should be two serial ports created upon connecting your Alif board. On Linux, they will be something
47 like ``/dev/ttyACM0`` and ``/dev/ttyACM1``. In the ``docker run`` command you use to create the dev
48 container, include ``--device /dev/ttyACM0 --device /dev/ttyACM1`` to give the container access to those
49 ports so you can flash from it.
50
51 Install the "Dev Containers" VS Code extension. Select your container from the "Remote Explorer" on the left
52 side panel.
53
54
55 Install Prerequisite tools
56 ~~~~~~~~~~~~~~~~~~~~~~~~~~
57
58 Make sure these are installed in your environment. The VS Code extensions rely on these being present.
59
60 - ``git``
61 - ``curl``
62 - ``unzip``
63
64 Install the Alif SE Tools
65 ~~~~~~~~~~~~~~~~~~~~~~~~~
66
67 Create an Alif account and download the tools from
68 `here <https://alifsemi.com/support/software-tools/ensemble/>`__ under "Alif Security Toolkit".
69 Extract it. The path where it was extracted will be needed later.
70
71 On Linux, extracting can be done by running the following
72
73 .. code-block:: shell
74
75 cd
76 tar -xf Downloads/APFW0002-app-release-exec-linux-SE_FW_1.101.00_DEV.tar
77 ls
78 pwd
79
80 Among the results of ``ls`` you should see ``app-release-exec-linux``. That, combined
81 with the output of ``pwd``, is the path you need to use later. I.e.,
82 ``/home/you/app-release-exec-linux``.
83
84 Install J-Link Software (optional)
85 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
86
87 Download the latest stable version of the `J-Link Software <https://www.segger.com/downloads/jlink>`__.
88 Its installation path will be needed later.
89
90 Clone the ``alif_m55-lvgl`` Project
91 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
92
93 .. code-block:: shell
94
95 git clone --recursive https://github.com/alifsemi/alif_m55-lvgl
96
97 Open ``alif_m55-lvgl`` in VS Code
98 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
99
100 Open the cloned repo in VS Code. For the VS Code extensions to work properly,
101 it's recommended to open the folder in VS Code instead of opening a
102 containing parent directory.
103
104 .. code-block:: shell
105
106 code alif_m55-lvgl
107
108 or navigate to **File \> Open Folder** in VS Code and open ``alif_m55-lvgl``.
109
110 If you are prompted to automatically install recommended extensions, click
111 "install" so you can skip the next step.
112
113 Install Required VS Code Extensions
114 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
115
116 Install the following VS Code extensions from the "Extensions" side panel
117
118 - Arm Tools Environment Manager
119 - Arm CMSIS Solution
120 - C/C++ Extension Pack
121 - Cortex-Debug (optional. needed for debugging)
122
123 Activate Environment
124 ~~~~~~~~~~~~~~~~~~~~
125
126 If it hasn't happened automatically, Click "Arm Tools" on the bottom bar and then
127 click "Activate Environment" in the list that appears. It will install CMake,
128 ninja-build, a GCC ARM compiler, and cmsis-toolbox.
129
130 If you only see "Reactivate Environment" then it is likely already active.
131
132 Set the Paths of Installed Tools
133 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
134
135 Press ctrl + shift + p. Type "preferences" and select the option
136 "Preferences: Open User Settings (JSON)" from the choices.
137 A ``settings.json`` will open. Note: if using a Docker container,
138 it's better to edit the JSON file in the project directory at
139 ``.vscode/settings.json``.
140
141 You need to add some entries (at least ``"alif.setools.root"``)
142 to the JSON you see.
143
144 If your ``settings.json`` looks like this initially...
145
146 .. code-block:: json
147
148 {
149 "workbench.colorTheme": "Default Dark+",
150 "editor.renderWhitespace": "all",
151 }
152
153 ... then it should look like this afterwards:
154
155 .. code-block:: json
156
157 {
158 "workbench.colorTheme": "Default Dark+",
159 "editor.renderWhitespace": "all",
160 "alif.setools.root" : "C:/alif-se-tools/app-release-exec",
161 "cortex-debug.JLinkGDBServerPath": "C:/Program Files/SEGGER/JLink/JLinkGDBServerCL.exe"
162 }
163
164 The above uses Windows paths as an example. A Linux path to the Alif SE Tools may look
165 something like ``"/home/you/app-release-exec-linux"``.
166
167 Configure the Board Variant
168 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
169
170 Open the
171 `board.h file <https://github.com/alifsemi/alif_vscode-template/blob/ce5423dbd15f62cb0aa4462533a960d79a014f97/board/board.h#L23-L30>`__.
172
173 Identify your board variant in the list and set ``BOARD_ALIF_DEVKIT_VARIANT`` to the correct value.
174 You may also need to set ``BOARD_ILI9806E_PANEL_VARIANT`` if the default does not match yours.
175
176 Set Up the Build Context, Compile, and Flash
177 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
178
179 Get to the "Manage Solution" view from the CMSIS Solution extension. You can reach
180 it by either clicking the gear icon on the bottom bar or by navigating to the CMSIS panel
181 on the left and clicking the gear at the top of that view. When it's open, it's a
182 graphical editor tab called "Manage Solution" with a gear icon.
183
184 **Important**
185
186 Under "Run and Debug" \> "Run Configuration" (column) \> "alif" (row), click the dropdown and select
187 "First time pack installation". Click the play icon at the top of the CMSIS left side panel.
188 In your terminal you should see CMSIS packs being installed. Wait for it to complete.
189
190 Now you can click the hammer icon next to the play icon to compile the project.
191 A few hundred files will be compiled. Wait for it to complete.
192
193 Open the dropdown from before and choose "Prepare program with Security Toolkit". Click the
194 play icon. It prepares some files as a prior step to flashing.
195
196 Open the dropdown again and choose "Program with Security Toolkit". Click the play icon.
197 If this is the first time, you will be prompted to choose which serial port to use to flash
198 the board. You can try ``/dev/ttyACM0``. If it was the wrong one, it will fail and you will
199 need to open the dropdown and choose "Program with Security Toolkit (select COM port)"
200 to override the previous one which was saved as default.
201
202 The LVGL benchmark should run on your Alif board after flashing completes.
203
204 More Info
205 ---------
206
207 If there were any difficulties faced while following this guide, refer to these
208 Alif sources for more detailed steps.
209
210 - `Getting Started with VSCode CMSIS pack project <https://github.com/alifsemi/alif_vscode-template/blob/main/doc/getting_started.md>`__
211 - `VSCode Getting Started Template <https://github.com/alifsemi/alif_vscode-template/blob/main/README.md>`__
212
213 You can download the "Alif Security Toolkit Quick Start Guide" from https://alifsemi.com/support/software-tools/ensemble/ ,
214 assuming you have created an account, to learn how to use the Alif SE Tools to perform
215 low-level manipulations on your board.
216
217 HP and HE Cores and Optimized Build
218 -----------------------------------
219
220 In the "Manage Solution" view explained in the guide, there is an option to select either
221 an HP target or an HE target. What these are referring to are the two distinct cores
222 present in the Alif E7. "HE" stands for "High Efficiency" while "HP" stands for
223 "High Performance". To get the best performance out of an LVGL application, select HP.
224 Consider HE when power usage is a concern. The merit of having asymmetrical cores
225 is that your application can run theoretically run low-priority workloads efficiently on
226 the HE core and delegate time critical, processing intensive workloads to the HP core.
227
228 There is also an option to choose a "Build Type". For best performance, choose "release".
229 If debugging you will want "debug".
230
231 To maximize the score on the LVGL benchmark and maximize the performance of an LVGL
232 application in general, ensure the HP core is selected and the build type is release.
233