zephyr-lvgl: make it possible to build the zephyr lvgl sample
v2 cover zephyr-lvgl: make it possible to build the zephyr lvgl sample
This series adds a recipe for the lvgl sample from zephyr. Due to how meta-zephyr works we need to pull in some additional modules for the build to succeed.
The first three patches are just coding style improvements, the last patch adds the recipe.
v1 -> v2:
- rebase patches on top of current master
Bartosz Golaszewski (4):
zephyr-kernel-src: order the SRCREV assignments alphabetically
zephyr-kernel-src: use the preferred coding style for multi-line
assignments
zephyr-kernel-src: order git repos alphabetically
zephyr-lvgl: new recipe
...0001-cmake-added-missing-file-ext-to.patch | 42 +++++++++++++++++++ .../zephyr-kernel/zephyr-kernel-common.inc | 1 + .../zephyr-kernel/zephyr-kernel-src-2.6.1.inc | 20 +++++---- .../zephyr-kernel/zephyr-kernel-src-2.7.0.inc | 18 ++++---- .../zephyr-kernel/zephyr-kernel-src.inc | 5 ++- recipes-kernel/zephyr-kernel/zephyr-lvgl.bb | 11 +++++ 6 files changed, 81 insertions(+), 16 deletions(-) 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
Signature · 1 line
2.30.1
RE: [yocto] [meta-zephyr][PATCH v2 4/4] zephyr-lvgl: new recipe
In reply to a message not in the archiveQuoted 94 lines
-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Bartosz Golaszewski
Sent: Tuesday, November 9, 2021 10:43 PM
To: [email protected]
Cc: Bartosz Golaszewski <[email protected]>; Eilís Ní Fhlannagáin <[email protected]>
Subject: [yocto] [meta-zephyr][PATCH v2 4/4] zephyr-lvgl: new recipeFrom: Bartosz Golaszewski <[email protected]>
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 <[email protected]> for helping me with that.
Signed-off-by Bartosz Golaszewski <[email protected]>Signed-off-by Eilís Ní Fhlannagáin <[email protected]>--- ...0001-cmake-added-missing-file-ext-to.patch | 42 +++++++++++++++++++ .../zephyr-kernel/zephyr-kernel-common.inc | 1 + .../zephyr-kernel/zephyr-kernel-src-2.6.1.inc | 3 ++ .../zephyr- kernel/zephyr-kernel-src-2.7.0.inc | 3 ++ .../zephyr-kernel/zephyr-kernel-src.inc | 3 ++ recipes-kernel/zephyr-kernel/zephyr-lvgl.bb | 11 +++++ 6 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(quoted diff) +0
-0file-ext-to.patch b/recipes-kernel/zephyr-kernel/files/0001-cmake-added- missing-file-ext-to.patch
new file mode 100644
index 0000000..6aeca14recipes-kernel/zephyr-kernel/files/0001-cmake-added-missing-file-e new file +2
-0+++ xt-to.patch@@ -0,0 +1,42 @@ +From 783c1f78c8e39751fe89d0883c8bce7336f55e94 Mon Sep 17 00:00:002001
recipes-kernel/zephyr-kernel/files/0001-cmake-added-missing-file-e new file +41
-0+From: Torsten Rasmussen <[email protected]> +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 <[email protected]> +--- +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 +recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc +0
-0@@ -31,6 +31,7 @@ ZEPHYR_MODULES:append:arm =
Quoted 6 lines
"\;${S}/modules/cmsis"
ZEPHYR_MODULES:append:nordic = "\;${S}/modules/hal/nordic" ZEPHYR_MODULES:append:stm32 = "\;${S}/modules/hal/stm32" ZEPHYR_MODULES:append:openamp = "\;${S}/modules/lib/open-
amp\;${S}/modules/hal/libmetal" +ZEPHYR_MODULES:append:zsegger = "\;${S}/modules/debug/segger"
[Naveen] zsegger is not defined as override, it causing build failure. If module is required only for lvgl sample, it can move into sample recipe !
| build/tmp-newlib/work/armv7m-yocto-eabi/zephyr-lvgl/2.7.0+gitAUTOINC+3f826560aa_b0612c97c1-r0/git/subsys/logging/log_backend_rtt.c:12:10: fatal error: SEGGER_RTT.h: No such file or directory | 12 | #include <SEGGER_RTT.h> | | ^~~~~~~~~~~~~~ | compilation terminated.
It can be checked with $ bitbake zephyr-lvgl -e | grep ^ZEPHYR_MODULES=
Quoted 110 lines
EXTRA_OECMAKE:append = " -DZEPHYR_MODULES=${ZEPHYR_MODULES}"
recipes-kernel/zephyr-kernel/zephyr-kernel-src-2.6.1.inc +3
-0@@ -2,12 +2,15 @@ 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" SRCREV_openthread = "385e19da1ae15f27872c2543b97276a42f102ead" +SRCREV_segger = "3a52ab222133193802d3c3b4d21730b9b1f1d2f6" SRCREV_stm32 = "f8ff8d25aa0a9e65948040c7b47ec67f3fa300df" SRCREV_tinycrypt = "3e9a49d2672ec01435ffbf0d788db6d95ef28de0" +SRCREV_TraceRecorderSource ="
36c577727642457b0db7274298a4b96558374832"
ZEPHYR_BRANCH= "v2.6-branch"
PV = "2.6.1+git${SRCPV}"recipes-kernel/zephyr-kernel/zephyr-kernel-src-2.7.0.inc +3
-0@@ -2,12 +2,15 @@ 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" SRCREV_openthread = "5d706547ebcb0a85e11412bcd88e80e2af98c74d" +SRCREV_segger = "3a52ab222133193802d3c3b4d21730b9b1f1d2f6" SRCREV_stm32 = "5c8275071ec1cf160bfe8c18bbd9330a7d714dc8" SRCREV_tinycrypt = "3e9a49d2672ec01435ffbf0d788db6d95ef28de0" +SRCREV_TraceRecorderSource ="
36c577727642457b0db7274298a4b96558374832"
ZEPHYR_BRANCH= "v2.7-branch"
PV = "2.7.0+git${SRCPV}"recipes- renamed from recipes-kernel/zephyr-kernel/zephyr-kernel-src.inc +0
-0
kernel/zephyr-kernel/zephyr-kernel-src.inc
index d8b086b..21ba208 100644recipes-kernel/zephyr-kernel/zephyr-kernel-src.inc +0
-0@@ -14,10 +14,13 @@ SRC_URI = "\ git://github.com/zephyrproject-rtos/hal_nordic.git;protocol=https;nobranch=1;destsuffix=git/modules/hal/n ordic;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/lib metal;name=libmetal \
+
+git://github.com/zephyrproject-rtos/lvgl.git;branch=zephyr;protocol=ht
+ tps;destsuffix=git/modules/lib/gui/lvgl;name=lvgl \
git://github.com/zephyrproject-
rtos/mbedtls.git;protocol=https;nobranch=1;destsuffix=git/modules/lib/mbe dtls;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=gi t/modules/lib/openthread;name=openthread \
+
+git://github.com/zephyrproject-rtos/segger.git;protocol=https;nobranch
+ =1;destsuffix=git/modules/debug/segger;name=segger \
git://github.com/zephyrproject-
rtos/tinycrypt.git;protocol=https;nobranch=1;destsuffix=git/modules/crypto/ tinycrypt;name=tinycrypt \recipes-kernel/zephyr-kernel/zephyr-kernel-src.inc +3
-0+ + git://github.com/zephyrproject-rtos/TraceRecorderSource.git;branch=zep +hyr;protocol=https;destsuffix=git/modules/debug/TraceRecorder;name=Tra
+ ceRecorderSource \ "S = "${WORKDIR}/git"
recipes- renamed from recipes-kernel/zephyr-kernel/zephyr-lvgl.bb +0
-0
kernel/zephyr-kernel/zephyr-lvgl.bb
new file mode 100644
index 0000000..29d1c5frecipes-kernel/zephyr-kernel/zephyr-lvgl.bb new file +6
-0@@ -0,0 +1,11 @@ +include zephyr-sample.inc + +ZEPHYR_SRC_DIR = "${S}/samples/subsys/display/lvgl" +ZEPHYR_MODULES:append = "\;${S}/modules/lib/gui/lvgl" + +# TODO Once more machines and displays are supported, add aPACKAGECONFIG.
recipes-kernel/zephyr-kernel/zephyr-lvgl.bb new file +3
-0+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"
recipes-kernel/zephyr-kernel/zephyr-lvgl.bb new file +2
-1+ +COMATIBLE_MACHINE = "(nrf52840dk-nrf52840)" --2.30.1