Skip to content

Commit

Permalink
soc: nordic: add vpr_launcher in sysbuild
Browse files Browse the repository at this point in the history
`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 <[email protected]>
  • Loading branch information
masz-nordic committed May 14, 2024
1 parent 0cb828d commit 680babc
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
4 changes: 4 additions & 0 deletions soc/nordic/Kconfig.sysbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (c) 2024 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

rsource "common/vpr/Kconfig.sysbuild"
11 changes: 11 additions & 0 deletions soc/nordic/common/vpr/Kconfig.sysbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright (c) 2024 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

config VPR_LAUNCHER
bool "VPR launcher"
default y
depends on (SOC_NRF54H20_CPUPPR || SOC_NRF54L15_ENGA_CPUFLPR)
help
Include VPR launcher in build.
VPR launcher is a minimal sample built for an ARM core that starts given VPR core.
It is based on samples/basic/minimal with an appropriate snippet.
31 changes: 31 additions & 0 deletions soc/nordic/sysbuild.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright (c) 2024 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

if(SB_CONFIG_VPR_LAUNCHER)
set(launcher_core "cpuapp")
string(REPLACE "/" ";" launcher_quals ${BOARD_QUALIFIERS})
list(LENGTH launcher_quals launcher_quals_len)
list(GET launcher_quals 1 launcher_soc)
list(GET launcher_quals 2 launcher_vpr)

string(REPLACE "cpu" "" launcher_vpr ${launcher_vpr})

if(launcher_quals_len EQUAL 4)
list(GET launcher_quals 3 launcher_variant)
set(launcher_vpr ${launcher_vpr}-${launcher_variant})
endif()

string(CONCAT launcher_board ${BOARD} "/" ${launcher_soc} "/" ${launcher_core})

set(image "vpr_launcher")

ExternalZephyrProject_Add(
APPLICATION ${image}
SOURCE_DIR ${ZEPHYR_BASE}/samples/basic/minimal
BOARD ${launcher_board}
)

string(CONCAT launcher_snippet "nordic-" ${launcher_vpr})

sysbuild_cache_set(VAR ${image}_SNIPPET APPEND REMOVE_DUPLICATES ${launcher_snippet})
endif()

0 comments on commit 680babc

Please sign in to comment.