README.md
1# How to Create CMSIS-Pack
2
3
4
5## STEP 1 Update 'lv_conf_cmsis.h'
6
71. Copy the **lv_conf_template.h** to '**cmsis-pack**' directory
8
92. Set the macro protector to '1'
10
11```c
12...
13/* clang-format off */
14#if 1 /*Set it to "1" to enable content*/
15...
16```
17
18remove the misleading guide above this code segment.
19
20```c
21/*
22 * Copy this file as `lv_conf.h`
23 * 1. simply next to the `lvgl` folder
24 * 2. or any other places and
25 * - define `LV_CONF_INCLUDE_SIMPLE`
26 * - add the path as include path
27 */
28```
29
30
313. Add including for '**RTE_Components.h**'
32
33```c
34#ifndef LV_CONF_H
35#define LV_CONF_H
36
37#include <stdint.h>
38#include "RTE_Components.h"
39...
40```
41
424. Remove macro definitions for
43 - LV_USE_GPU_STM32_DMA2D
44 - LV_USE_GPU_NXP_PXP
45 - LV_USE_GPU_NXP_VG_LITE
46 - LV_USE_GPU_SWM341_DMA2D
47 - LV_USE_GPU_ARM2D
48 - LV_USE_IME_PINYIN
49 - LV_USE_PNG
50 - LV_USE_BMP
51 - LV_USE_SJPG
52 - LV_USE_GIF
53 - LV_USE_QRCODE
54 - LV_USE_FREETYPE
55 - LV_USE_TINY_TTF
56 - LV_USE_RLOTTIE
57 - LV_USE_FFMPEG
58 - LV_USE_SNAPSHOT
59 - LV_USE_MONKEY
60 - LV_USE_GRIDNAV
61 - LV_USE_FRAGMENT
62 - LV_USE_IMGFONT
63 - LV_USE_MSG
64 - LV_USE_IME_PINYIN
655. Update macro `LV_ATTRIBUTE_MEM_ALIGN` and `LV_ATTRIBUTE_MEM_ALIGN_SIZE` to force a WORD alignment.
66```c
67#define LV_ATTRIBUTE_MEM_ALIGN_SIZE 4
68#define LV_ATTRIBUTE_MEM_ALIGN __attribute__((aligned(4)))
69```
70Update macro `LV_MEM_SIZE` to `(64*1024U)`.
71
72Update macro `LV_FONT_MONTSERRAT_12` to `1`.
73
74Update macro `LV_FONT_MONTSERRAT_12` to `1`.
75
766. Update Theme related macros:
77
78```c
79#ifdef RTE_GRAPHICS_LVGL_USE_EXTRA_THEMES
80 /*A simple, impressive and very complete theme*/
81 #define LV_USE_THEME_DEFAULT 1
82 #if LV_USE_THEME_DEFAULT
83
84 /*0: Light mode; 1: Dark mode*/
85 #define LV_THEME_DEFAULT_DARK 0
86
87 /*1: Enable grow on press*/
88 #define LV_THEME_DEFAULT_GROW 1
89
90 /*Default transition time in [ms]*/
91 #define LV_THEME_DEFAULT_TRANSITION_TIME 80
92 #endif /*LV_USE_THEME_DEFAULT*/
93
94 /*A very simple theme that is a good starting point for a custom theme*/
95 #define LV_USE_THEME_BASIC 1
96
97 /*A theme designed for monochrome displays*/
98 #define LV_USE_THEME_MONO 1
99#else
100 #define LV_USE_THEME_DEFAULT 0
101 #define LV_USE_THEME_BASIC 0
102 #define LV_USE_THEME_MONO 0
103#endif
104```
1057. Update `LV_TICK_CUSTOM` related macros:
106```c
107/*Use a custom tick source that tells the elapsed time in milliseconds.
108 *It removes the need to manually update the tick with `lv_tick_inc()`)*/
109#ifdef __PERF_COUNTER__
110 #define LV_TICK_CUSTOM 1
111 #if LV_TICK_CUSTOM
112 extern uint32_t SystemCoreClock;
113 #define LV_TICK_CUSTOM_INCLUDE "perf_counter.h"
114 #define LV_TICK_CUSTOM_SYS_TIME_EXPR get_system_ms()
115 #endif /*LV_TICK_CUSTOM*/
116#else
117 #define LV_TICK_CUSTOM 0
118 #if LV_TICK_CUSTOM
119 #define LV_TICK_CUSTOM_INCLUDE "Arduino.h" /*Header for the system time function*/
120 #define LV_TICK_CUSTOM_SYS_TIME_EXPR (millis()) /*Expression evaluating to current system time in ms*/
121 /*If using lvgl as ESP32 component*/
122 // #define LV_TICK_CUSTOM_INCLUDE "esp_timer.h"
123 // #define LV_TICK_CUSTOM_SYS_TIME_EXPR ((esp_timer_get_time() / 1000LL))
124 #endif /*LV_TICK_CUSTOM*/
125#endif /*__PERF_COUNTER__*/
126```
127
128
1299. Remove all content in `DEMO USAGE` section but keep the following:
130
131```c
132/*Show some widget. It might be required to increase `LV_MEM_SIZE` */
133#if LV_USE_DEMO_WIDGETS
134 #define LV_DEMO_WIDGETS_SLIDESHOW 0
135#endif
136
137/*Benchmark your system*/
138#if LV_USE_DEMO_BENCHMARK
139/*Use RGB565A8 images with 16 bit color depth instead of ARGB8565*/
140 #define LV_DEMO_BENCHMARK_RGB565A8 1
141#endif
142```
143
144
145
14610. Thoroughly remove the `3rd party libraries` section.
14711. rename '**lv_conf_template.h**' to '**lv_conf_cmsis.h**'.
148
149
150
151## STEP 2 Check, Update and Run the 'gen_pack.sh'
152
153```sh
154if [ `uname -s` = "Linux" ]
155 then
156 CMSIS_PACK_PATH="/home/$USER/.arm/Packs/ARM/CMSIS/5.7.0/"
157 PATH_TO_ADD="$CMSIS_PACK_PATH/CMSIS/Utilities/Linux64/"
158else
159 CMSIS_PACK_PATH="/C/Users/gabriel/AppData/Local/Arm/Packs/ARM/CMSIS/5.7.0"
160 PATH_TO_ADD="/C/Program Files (x86)/7-Zip/:$CMSIS_PACK_PATH/CMSIS/Utilities/Win32/:/C/xmllint/"
161fi
162[[ ":$PATH:" != *":$PATH_TO_ADD}:"* ]] && PATH="${PATH}:${PATH_TO_ADD}"
163echo $PATH_TO_ADD appended to PATH
164echo " "
165```
166
167
168
169### A. For Windows users
170
171Update the '**CMSIS_PACK_PATH**' accordingly (Usually just replace the name gabriel with your own windows account name is sufficient.).
172
173Update the '**PATH_TO_ADD**' to point to the installation folders of **7Zip** and **xmllint**.
174
175Launch the git-bash and go to the cmsis-pack folder.
176
177enter the following command:
178
179```sh
180./gen_pack.sh
181```
182
183
184
185### B. For Linux Users
186
187Update '**PATH_TO_ADD**' if necessary.
188
189go to the **cmsis-pack** folder.
190
191enter the following command:
192
193```sh
194./gen_pack.sh
195```
196
197