Skip to content

Commit 41b856f

Browse files
masz-nordiccarlescufi
authored andcommitted
soc: nordic: add vpr_launcher in sysbuild
`SB_CONFIG_VPR_LAUNCHER` can now be used in building a VPR target, to enable automatic building of image that will launch the VPR. Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no>
1 parent 25229b2 commit 41b856f

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed

soc/nordic/Kconfig.sysbuild

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright (c) 2024 Nordic Semiconductor ASA
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
rsource "common/vpr/Kconfig.sysbuild"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright (c) 2024 Nordic Semiconductor ASA
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config VPR_LAUNCHER
5+
bool "VPR launcher"
6+
default y
7+
depends on (SOC_NRF54H20_CPUPPR || SOC_NRF54L15_ENGA_CPUFLPR)
8+
help
9+
Include VPR launcher in build.
10+
VPR launcher is a minimal sample built for an ARM core that starts given VPR core.
11+
It is based on samples/basic/minimal with an appropriate snippet.

soc/nordic/sysbuild.cmake

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright (c) 2024 Nordic Semiconductor ASA
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if(SB_CONFIG_VPR_LAUNCHER)
5+
set(launcher_core "cpuapp")
6+
string(REPLACE "/" ";" launcher_quals ${BOARD_QUALIFIERS})
7+
list(LENGTH launcher_quals launcher_quals_len)
8+
list(GET launcher_quals 1 launcher_soc)
9+
list(GET launcher_quals 2 launcher_vpr)
10+
11+
string(REPLACE "cpu" "" launcher_vpr ${launcher_vpr})
12+
13+
if(launcher_quals_len EQUAL 4)
14+
list(GET launcher_quals 3 launcher_variant)
15+
set(launcher_vpr ${launcher_vpr}-${launcher_variant})
16+
endif()
17+
18+
string(CONCAT launcher_board ${BOARD} "/" ${launcher_soc} "/" ${launcher_core})
19+
20+
set(image "vpr_launcher")
21+
22+
ExternalZephyrProject_Add(
23+
APPLICATION ${image}
24+
SOURCE_DIR ${ZEPHYR_BASE}/samples/basic/minimal
25+
BOARD ${launcher_board}
26+
)
27+
28+
string(CONCAT launcher_snippet "nordic-" ${launcher_vpr})
29+
30+
sysbuild_cache_set(VAR ${image}_SNIPPET APPEND REMOVE_DUPLICATES ${launcher_snippet})
31+
endif()

0 commit comments

Comments
 (0)