From: Bartosz Golaszewski <bartosz.golaszewski@...>
This adds a recipe for building the lvgl sample from mainline zephyr
source. We need to include one upstream patch that fixes a build problem
with lvgl and pull in two other modules or otherwise the default config
will fail to build. Currently only the nordic reference devkit for
nrf52840 is supported.
Big thanks to Eilís Ní Fhlannagáin <elizabeth.flanagan@...> for
helping me with that.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@...>
Signed-off-by: Eilís Ní Fhlannagáin <elizabeth.flanagan@...>
---
...0001-cmake-added-missing-file-ext-to.patch | 42 +++++++++++++++++++
.../zephyr-kernel/zephyr-kernel-src-2.6.1.inc | 1 +
.../zephyr-kernel/zephyr-kernel-src-2.7.0.inc | 1 +
.../zephyr-kernel/zephyr-kernel-src.inc | 1 +
recipes-kernel/zephyr-kernel/zephyr-lvgl.bb | 18 ++++++++
5 files changed, 63 insertions(+)
create mode 100644 recipes-kernel/zephyr-kernel/files/0001-cmake-added-missing-file-ext-to.patch
create mode 100644 recipes-kernel/zephyr-kernel/zephyr-lvgl.bb
diff --git a/recipes-kernel/zephyr-kernel/files/0001-cmake-added-missing-file-ext-to.patch b/recipes-kernel/zephyr-kernel/files/0001-cmake-added-missing-file-ext-to.patch
new file mode 100644
index 0000000..6aeca14
--- /dev/null
+++ b/recipes-kernel/zephyr-kernel/files/0001-cmake-added-missing-file-ext-to.patch
@@ -0,0 +1,42 @@
+From 783c1f78c8e39751fe89d0883c8bce7336f55e94 Mon Sep 17 00:00:00 2001
+From: Torsten Rasmussen <Torsten.Rasmussen@...>
+Date: Thu, 19 Aug 2021 08:53:00 +0200
+Subject: [PATCH] cmake: added missing file ext to
+ lv_font_dejavu_16_persian_hebrew.c
+
+CMake >= 3.20 requires file extensions explicitly added to source files.
+
+See CMP0115:
+> Starting in CMake 3.20, CMake prefers all source files to have their
+> extensions explicitly listed:
+
+In the CMakeLists.txt, the file lv_font_dejavu_16_persian_hebrew.c
+was added without its .c extension, causing never CMakes ti fail
+discovering the file.
+
+This has been fixed by correctly add the file as:
+lv_font_dejavu_16_persian_hebrew.c
+
+Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@...>
+---
+Upstream-status: Accepted
+
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 57b07c84..0f433edc 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -58,7 +58,7 @@ zephyr_library_sources(
+ src/lv_misc/lv_utils.c
+
+ src/lv_font/lv_font.c
+- src/lv_font/lv_font_dejavu_16_persian_hebrew
++ src/lv_font/lv_font_dejavu_16_persian_hebrew.c
+ src/lv_font/lv_font_fmt_txt.c
+ src/lv_font/lv_font_loader.c
+ src/lv_font/lv_font_montserrat_12.c
+--
+Gitee
+
diff --git a/recipes-kernel/zephyr-kernel/zephyr-kernel-src-2.6.1.inc b/recipes-kernel/zephyr-kernel/zephyr-kernel-src-2.6.1.inc
index 9f28df7..ce5e067 100644
--- a/recipes-kernel/zephyr-kernel/zephyr-kernel-src-2.6.1.inc
+++ b/recipes-kernel/zephyr-kernel/zephyr-kernel-src-2.6.1.inc
@@ -2,6 +2,7 @@ SRCREV_FORMAT = "default_cmsis"
SRCREV_cmsis = "c3bd2094f92d574377f7af2aec147ae181aa5f8e"
SRCREV_default = "2d6322d74aaac838ead46bfcba0db619cff4b534"
SRCREV_libmetal = "39d049d4ae68e6f6d595fce7de1dcfc1024fb4eb"
+SRCREV_lvgl = "31acbaa36e9e74ab88ac81e3d21e7f1d00a71136"
SRCREV_mbedtls = "5765cb7f75a9973ae9232d438e361a9d7bbc49e7"
SRCREV_nordic = "574493fe29c79140df4827ab5d4a23df79d03681"
SRCREV_open-amp = "6010f0523cbc75f551d9256cf782f173177acdef"
diff --git a/recipes-kernel/zephyr-kernel/zephyr-kernel-src-2.7.0.inc b/recipes-kernel/zephyr-kernel/zephyr-kernel-src-2.7.0.inc
index f425d9f..b6a6fc4 100644
--- a/recipes-kernel/zephyr-kernel/zephyr-kernel-src-2.7.0.inc
+++ b/recipes-kernel/zephyr-kernel/zephyr-kernel-src-2.7.0.inc
@@ -2,6 +2,7 @@ SRCREV_FORMAT = "default_cmsis"
SRCREV_cmsis = "b0612c97c1401feeb4160add6462c3627fe90fc7"
SRCREV_default = "3f826560aaf81a444018293bd6acce3c339fe150"
SRCREV_libmetal = "39d049d4ae68e6f6d595fce7de1dcfc1024fb4eb"
+SRCREV_lvgl = "31acbaa36e9e74ab88ac81e3d21e7f1d00a71136"
SRCREV_mbedtls = "5765cb7f75a9973ae9232d438e361a9d7bbc49e7"
SRCREV_nordic = "a6e5299041f152da5ae0ab17b2e44e088bb96d6d"
SRCREV_open-amp = "6010f0523cbc75f551d9256cf782f173177acdef"
diff --git a/recipes-kernel/zephyr-kernel/zephyr-kernel-src.inc b/recipes-kernel/zephyr-kernel/zephyr-kernel-src.inc
index d8b086b..c973c2a 100644
--- a/recipes-kernel/zephyr-kernel/zephyr-kernel-src.inc
+++ b/recipes-kernel/zephyr-kernel/zephyr-kernel-src.inc
@@ -14,6 +14,7 @@ SRC_URI = "\
git://github.com/zephyrproject-rtos/hal_nordic.git;protocol=https;nobranch=1;destsuffix=git/modules/hal/nordic;name=nordic \
git://github.com/zephyrproject-rtos/hal_stm32.git;protocol=https;branch=main;destsuffix=git/modules/hal/stm32;name=stm32 \
git://github.com/zephyrproject-rtos/libmetal.git;protocol=https;nobranch=1;destsuffix=git/modules/hal/libmetal;name=libmetal \
+ git://github.com/zephyrproject-rtos/lvgl.git;branch=zephyr;protocol=https;destsuffix=git/modules/lib/gui/lvgl;name=lvgl \
git://github.com/zephyrproject-rtos/mbedtls.git;protocol=https;nobranch=1;destsuffix=git/modules/lib/mbedtls;name=mbedtls \
git://github.com/zephyrproject-rtos/open-amp.git;protocol=https;nobranch=1;destsuffix=git/modules/lib/open-amp;name=open-amp \
git://github.com/zephyrproject-rtos/openthread.git;protocol=https;nobranch=1;branch=zephyr;destsuffix=git/modules/lib/openthread;name=openthread \
diff --git a/recipes-kernel/zephyr-kernel/zephyr-lvgl.bb b/recipes-kernel/zephyr-kernel/zephyr-lvgl.bb
new file mode 100644
index 0000000..4f08fc7
--- /dev/null
+++ b/recipes-kernel/zephyr-kernel/zephyr-lvgl.bb
@@ -0,0 +1,18 @@
+include zephyr-sample.inc
+
+ZEPHYR_SRC_DIR = "${S}/samples/subsys/display/lvgl"
+ZEPHYR_MODULES:append = "\;${S}/modules/lib/gui/lvgl\;${S}/modules/debug/segger"
+
+# TODO Once more machines and displays are supported, add a PACKAGECONFIG.
+EXTRA_OECMAKE:append =" -DSHIELD=adafruit_2_8_tft_touch_v2"
+
+SRC_URI:append = " \
+ file://0001-cmake-added-missing-file-ext-to.patch;patchdir=modules/lib/gui/lvgl \
+ git://github.com/zephyrproject-rtos/segger.git;protocol=https;nobranch=1;destsuffix=git/modules/debug/segger;name=segger \
+ git://github.com/zephyrproject-rtos/TraceRecorderSource.git;branch=zephyr;protocol=https;destsuffix=git/modules/debug/TraceRecorder;name=TraceRecorderSource \
+"
+
+SRCREV_segger = "3a52ab222133193802d3c3b4d21730b9b1f1d2f6"
+SRCREV_TraceRecorderSource = "36c577727642457b0db7274298a4b96558374832"
+
+COMATIBLE_MACHINE = "(nrf52840dk-nrf52840)"
--
2.30.1