All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-zephyr][PATCH v2 0/2] Fix Bluetooth Peripheral ESP sample compilation
@ 2021-02-04 13:09 Wojciech Zmuda
  2021-02-04 13:09 ` [meta-zephyr][PATCH v2 1/2] zephyr-kernel: clone Tinycrypt Wojciech Zmuda
  2021-02-04 13:09 ` [meta-zephyr][PATCH v2 2/2] zephyr-peripheral-esp: fix compilation Wojciech Zmuda
  0 siblings, 2 replies; 3+ messages in thread
From: Wojciech Zmuda @ 2021-02-04 13:09 UTC (permalink / raw)
  To: yocto; +Cc: andrei.gherzan, stefan.schmidt, Wojciech Zmuda

From: Wojciech Zmuda <wojciech.zmuda@huawei.com>

v1 -> v2:
 - Addedd missing [meta-zephyr] tag
 - Re-sending with slightly different git-send-email
   configuration, so the authorship is pointed to my @huawei.com email
   instead of the one I'm sending it from.

Wojciech Zmuda (2):
  zephyr-kernel: clone Tinycrypt
  zephyr-peripheral-esp: fix compilation

 classes/zephyr-kernel-src.bbclass                     |  2 ++
 recipes-kernel/zephyr-kernel/zephyr-peripheral-esp.bb | 11 ++++-------
 2 files changed, 6 insertions(+), 7 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [meta-zephyr][PATCH v2 1/2] zephyr-kernel: clone Tinycrypt
  2021-02-04 13:09 [meta-zephyr][PATCH v2 0/2] Fix Bluetooth Peripheral ESP sample compilation Wojciech Zmuda
@ 2021-02-04 13:09 ` Wojciech Zmuda
  2021-02-04 13:09 ` [meta-zephyr][PATCH v2 2/2] zephyr-peripheral-esp: fix compilation Wojciech Zmuda
  1 sibling, 0 replies; 3+ messages in thread
From: Wojciech Zmuda @ 2021-02-04 13:09 UTC (permalink / raw)
  To: yocto; +Cc: andrei.gherzan, stefan.schmidt, Wojciech Zmuda

From: Wojciech Zmuda <wojciech.zmuda@huawei.com>

Tinycrypt is a library used in some sample applications,
i.e. in zephyr-peripheral-esp. Add it to kernel bbclass,
so it can be referenced in applications recipes that
use it.

Signed-off-by: Wojciech Zmuda <wojciech.zmuda@huawei.com>
---
 classes/zephyr-kernel-src.bbclass | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/classes/zephyr-kernel-src.bbclass b/classes/zephyr-kernel-src.bbclass
index b7fb81d..c6c8d61 100644
--- a/classes/zephyr-kernel-src.bbclass
+++ b/classes/zephyr-kernel-src.bbclass
@@ -9,6 +9,7 @@ SRCREV_nordic = "d8a6ea9695ddf792bb18bb6035c13b1daac5d79c"
 SRCREV_stm32 = "f0e11398128ac9abdff713da5d3035e6c96e9b86"
 SRCREV_open-amp = "de1b85a13032a2de1d8b6695ae5f800b613e739d"
 SRCREV_libmetal = "9d4ee2c3cfd5f49861939447990f3b7d7bf9bf94"
+SRCREV_tinycrypt = "3e9a49d2672ec01435ffbf0d788db6d95ef28de0"
 
 SRC_URI = "git://github.com/zephyrproject-rtos/zephyr.git;protocol=https;branch=v2.4-branch;name=default \
            git://github.com/zephyrproject-rtos/cmsis.git;protocol=https;destsuffix=git/modules/cmsis;name=cmsis \
@@ -16,6 +17,7 @@ SRC_URI = "git://github.com/zephyrproject-rtos/zephyr.git;protocol=https;branch=
            git://github.com/zephyrproject-rtos/hal_stm32.git;protocol=https;destsuffix=git/modules/hal/stm32;name=stm32 \
            git://github.com/zephyrproject-rtos/open-amp.git;protocol=https;destsuffix=git/modules/lib/open-amp;name=open-amp \
            git://github.com/zephyrproject-rtos/libmetal.git;protocol=https;destsuffix=git/modules/hal/libmetal;name=libmetal \
+           git://github.com/zephyrproject-rtos/tinycrypt.git;protocol=https;destsuffix=git/modules/crypto/tinycrypt;name=tinycrypt \
            file://0001-cmake-add-yocto-toolchain.patch \
           "
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [meta-zephyr][PATCH v2 2/2] zephyr-peripheral-esp: fix compilation
  2021-02-04 13:09 [meta-zephyr][PATCH v2 0/2] Fix Bluetooth Peripheral ESP sample compilation Wojciech Zmuda
  2021-02-04 13:09 ` [meta-zephyr][PATCH v2 1/2] zephyr-kernel: clone Tinycrypt Wojciech Zmuda
@ 2021-02-04 13:09 ` Wojciech Zmuda
  1 sibling, 0 replies; 3+ messages in thread
From: Wojciech Zmuda @ 2021-02-04 13:09 UTC (permalink / raw)
  To: yocto; +Cc: andrei.gherzan, stefan.schmidt, Wojciech Zmuda

From: Wojciech Zmuda <wojciech.zmuda@huawei.com>

Bluetooth peripheral ESP sample application does not compile
because of:
 - broken source directory path passing to cmake,
 - broken paths in do_deploy,
 - unnecessary call for do_install,
 - missing tinycrypt.

The first issue caused the following error:

    <...>/gcc/arm-yocto-eabi/9.3.0/ld: <...>/recipe-sysroot/usr/lib/libc.a(lib_a-exit.o): in function `exit':
    /usr/src/debug/newlib/3.2.0-r0/newlib-3.2.0/newlib/libc/stdlib/exit.c:64: undefined reference to `_exit'
    collect2: error: ld returned 1 exit status

Fix the issue by providing Zephyr source directory to cmake
via OECMAKE_SOURCEPATH variable. On the do_configure step cmake
now gets the full path to the sample source code instead of
Zephyr root directory.

The second and third issue caused errors because of missing files.
Don't execute do_install and use the same paths in deploy as the
other sample apps do.

Inspecting meta-zephyr commits history shows that similar approach
was used in bb files of other sample application when updating
them to work with Zephyr 2.0.

For the missing Tinycrypt, append its location to cmake.

Signed-off-by: Wojciech Zmuda <wojciech.zmuda@huawei.com>
---
 recipes-kernel/zephyr-kernel/zephyr-peripheral-esp.bb | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/recipes-kernel/zephyr-kernel/zephyr-peripheral-esp.bb b/recipes-kernel/zephyr-kernel/zephyr-peripheral-esp.bb
index 2ffe5ae..192c76d 100644
--- a/recipes-kernel/zephyr-kernel/zephyr-peripheral-esp.bb
+++ b/recipes-kernel/zephyr-kernel/zephyr-peripheral-esp.bb
@@ -5,15 +5,12 @@ inherit deploy
 ZEPHYR_SAMPLE_NAME="samples/bluetooth/peripheral_esp"
 ZEPHYR_SRC_DIR = "${S}/${ZEPHYR_SAMPLE_NAME}"
 ZEPHYR_BASE = "${S}"
-
-do_compile () {
-    cd ${ZEPHYR_SRC_DIR}
-    oe_runmake ${ZEPHYR_MAKE_ARGS}
-}
+OECMAKE_SOURCEPATH = "${ZEPHYR_SRC_DIR}"
+EXTRA_OECMAKE_append = "\;${S}/modules/crypto/tinycrypt"
 
 do_deploy () {
-    install -D ${ZEPHYR_SAMPLE_NAME}/outdir/${BOARD}/zephyr.elf ${DEPLOYDIR}/${PN}.elf
-    install -D ${ZEPHYR_SAMPLE_NAME}/outdir/${BOARD}/zephyr.bin ${DEPLOYDIR}/${PN}.bin
+    install -D ${B}/zephyr/${ZEPHYR_MAKE_OUTPUT} ${DEPLOYDIR}/${PN}.elf
 }
 
 addtask deploy after do_compile
+do_install[noexec] = "1"
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-04 13:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-04 13:09 [meta-zephyr][PATCH v2 0/2] Fix Bluetooth Peripheral ESP sample compilation Wojciech Zmuda
2021-02-04 13:09 ` [meta-zephyr][PATCH v2 1/2] zephyr-kernel: clone Tinycrypt Wojciech Zmuda
2021-02-04 13:09 ` [meta-zephyr][PATCH v2 2/2] zephyr-peripheral-esp: fix compilation Wojciech Zmuda

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.