Skip to content

Commit

Permalink
samples/runtime-source: Make it buildable on twister
Browse files Browse the repository at this point in the history
This sample has two parts: hooks for an mcuboot instance and a target
application. For the first, a new entry at boot/zephyr/sample.yaml is
added as well as a corresponding change at boot/zephyr/CMakeLists.txt to
include the hook as a module. For the second, added a sample.yaml as
well as invoke it from the github workflow.

Signed-off-by: Ederson de Souza <[email protected]>
  • Loading branch information
edersondisouza committed Jan 13, 2025
1 parent 214d257 commit 78d3509
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/zephyr_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ jobs:
-T ../bootloader/mcuboot/boot/zephyr
-T ./tests/subsys/dfu
-T ./samples/subsys/mgmt/mcumgr/smp_svr
-T ../bootloader/mcuboot/samples/runtime-source/zephyr/app
run: |
export ZEPHYR_BASE=${PWD}
export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
Expand Down
6 changes: 6 additions & 0 deletions boot/zephyr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@

cmake_minimum_required(VERSION 3.13.1)

# This sample shows usage of an external module and we need to set the
# set the extra module path before calling find_package(Zephyr).
if(TEST_RUNTIME_SOURCE_HOOKS)
set(EXTRA_ZEPHYR_MODULES "${CMAKE_SOURCE_DIR}/../../samples/runtime-source/zephyr/hooks")
endif()

# find_package(Zephyr) in order to load application boilerplate:
# http://docs.zephyrproject.org/application/application.html
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
Expand Down
6 changes: 6 additions & 0 deletions boot/zephyr/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,9 @@ tests:
platform_allow: mimxrt1020_evk
integration_platforms:
- mimxrt1020_evk
sample.bootloader.mcuboot.runtime_source.hooks:
extra_args: EXTRA_CONF_FILE=../../samples/runtime-source/zephyr/sample.conf
TEST_RUNTIME_SOURCE_HOOKS=y
tags: bootloader_mcuboot runtime_source
platform_allow: frdm_k64f
build_only: true
10 changes: 10 additions & 0 deletions samples/runtime-source/zephyr/app/sample.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
sample:
name: Runtime source target
description: Application loaded from mcuboot using runtime source hooks
common:
build_only: true
tests:
sample.zephyr.runtime_source.app:
tags: samples tests runtime_source
platform_allow:
- frdm_k64f

0 comments on commit 78d3509

Please sign in to comment.