Skip to content

Commit 1d827bc

Browse files
tejlmandjhedberg
authored andcommitted
samples: cleanup sysbuild/hello_world sample
Remove the prompt for REMOTE_BOARD. REMOTE_BOARD should not be having a prompt or be configurable on command line. Instead REMOTE_BOARD should be defined based on the SoC as this will allow creation of new boards using the same SoC, and thereby be able to build the sample out-of-the-box for any supported SoC. This allows us to remove several single line config files. For SoCs with more than two CPU clusters, such as the nRF54h20, then a choice is provided to select specific core. Remove the REMOTE_BOARD restriction, as this sample will build and run even for single core SoCs, and may be useful for testing other sysbuild multi-image features even for single cores SoCs. Signed-off-by: Torsten Rasmussen <[email protected]>
1 parent 816489e commit 1d827bc

12 files changed

+49
-55
lines changed

samples/sysbuild/hello_world/Kconfig.sysbuild

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,34 @@
33

44
source "$(ZEPHYR_BASE)/share/sysbuild/Kconfig"
55

6+
choice REMOTE_NRF54H20_CORE
7+
prompt "Remote nRF54h20 core"
8+
default REMOTE_NRF54H20_CPUFLPR_CORE
9+
depends on SOC_NRF54H20_CPUAPP
10+
11+
config REMOTE_NRF54H20_CPUFLPR_CORE
12+
bool "flpr core"
13+
14+
config REMOTE_NRF54H20_CPUFLPR_XIP_CORE
15+
bool "flpr/xip core"
16+
17+
config REMOTE_NRF54H20_CPUPPR_CORE
18+
bool "ppr core"
19+
20+
config REMOTE_NRF54H20_CPUPPR_XIP_CORE
21+
bool "ppr/xip core"
22+
23+
config REMOTE_NRF54H20_CPURAD_CORE
24+
bool "cpurad"
25+
26+
endchoice
27+
628
config REMOTE_BOARD
7-
string "The board used for remote target"
29+
string
30+
default "$(BOARD)/nrf5340/cpunet" if SOC_NRF5340_CPUAPP
31+
default "$(BOARD)/nrf54l15/cpuflpr" if SOC_NRF54L15_CPUAPP
32+
default "$(BOARD)/nrf54h20/cpurad" if SOC_NRF54H20_CPUAPP && REMOTE_NRF54H20_CPURAD_CORE
33+
default "$(BOARD)/nrf54h20/cpuppr" if SOC_NRF54H20_CPUAPP && REMOTE_NRF54H20_CPUPPR_CORE
34+
default "$(BOARD)/nrf54h20/cpuppr/xip" if SOC_NRF54H20_CPUAPP && REMOTE_NRF54H20_CPUPPR_XIP_CORE
35+
default "$(BOARD)/nrf54h20/cpuflpr" if SOC_NRF54H20_CPUAPP && REMOTE_NRF54H20_CPUFLPR_CORE
36+
default "$(BOARD)/nrf54h20/cpuflpr/xip" if SOC_NRF54H20_CPUAPP && REMOTE_NRF54H20_CPUFLPR_XIP_CORE

samples/sysbuild/hello_world/sample.yaml

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,70 +17,56 @@ tests:
1717
- nrf5340dk/nrf5340/cpuapp
1818
integration_platforms:
1919
- nrf5340dk/nrf5340/cpuapp
20-
extra_args: SB_CONF_FILE=sysbuild/nrf5340dk_nrf5340_cpunet.conf
2120
sample.sysbuild.hello_world.nrf54h20dk_cpuapp_cpurad:
2221
platform_allow:
2322
- nrf54h20dk/nrf54h20/cpuapp
2423
integration_platforms:
2524
- nrf54h20dk/nrf54h20/cpuapp
2625
extra_args:
27-
- SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf
26+
- SB_CONFIG_REMOTE_NRF54H20_CPURAD_CORE=y
2827
- hello_world_CONFIG_SOC_NRF54H20_CPURAD_ENABLE=y
2928
sample.sysbuild.hello_world.nrf54h20dk_cpuapp_cpuppr:
3029
platform_allow:
3130
- nrf54h20dk/nrf54h20/cpuapp
3231
integration_platforms:
3332
- nrf54h20dk/nrf54h20/cpuapp
3433
extra_args:
35-
- SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpuppr.conf
34+
- SB_CONFIG_REMOTE_NRF54H20_CPUPPR_CORE=y
3635
- hello_world_SNIPPET=nordic-ppr
3736
sample.sysbuild.hello_world.nrf54h20dk_cpuapp_cpuppr_xip:
3837
platform_allow:
3938
- nrf54h20dk/nrf54h20/cpuapp
4039
integration_platforms:
4140
- nrf54h20dk/nrf54h20/cpuapp
4241
extra_args:
43-
- SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpuppr_xip.conf
42+
- SB_CONFIG_REMOTE_NRF54H20_CPUPPR_XIP_CORE=y
4443
- hello_world_SNIPPET=nordic-ppr-xip
45-
sample.sysbuild.hello_world.nrf54l15dk_nrf54l15_cpuflpr:
44+
sample.sysbuild.hello_world.nrf54l15_cpuflpr:
4645
platform_allow:
4746
- nrf54l15dk/nrf54l15/cpuapp
4847
- ophelia4ev/nrf54l15/cpuapp
48+
- bl54l15_dvk/nrf54l15/cpuapp
49+
- bl54l15u_dvk/nrf54l15/cpuapp
4950
integration_platforms:
5051
- nrf54l15dk/nrf54l15/cpuapp
5152
- ophelia4ev/nrf54l15/cpuapp
53+
- bl54l15_dvk/nrf54l15/cpuapp
54+
- bl54l15u_dvk/nrf54l15/cpuapp
5255
extra_args:
53-
- SB_CONF_FILE=sysbuild/nrf54l15dk_nrf54l15_cpuflpr.conf
5456
- hello_world_SNIPPET=nordic-flpr
5557
sample.sysbuild.hello_world.nrf54h20dk_cpuapp_cpuflpr:
5658
platform_allow:
5759
- nrf54h20dk/nrf54h20/cpuapp
5860
integration_platforms:
5961
- nrf54h20dk/nrf54h20/cpuapp
6062
extra_args:
61-
- SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpuflpr.conf
63+
- SB_CONFIG_REMOTE_NRF54H20_CPUFLPR_CORE=y
6264
- hello_world_SNIPPET=nordic-flpr
6365
sample.sysbuild.hello_world.nrf54h20dk_cpuapp_cpuflpr_xip:
6466
platform_allow:
6567
- nrf54h20dk/nrf54h20/cpuapp
6668
integration_platforms:
6769
- nrf54h20dk/nrf54h20/cpuapp
6870
extra_args:
69-
- SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpuflpr_xip.conf
71+
- SB_CONFIG_REMOTE_NRF54H20_CPUFLPR_XIP_CORE=y
7072
- hello_world_SNIPPET=nordic-flpr-xip
71-
sample.sysbuild.hello_world.bl54l15_dvk_nrf54l15_cpuflpr:
72-
platform_allow:
73-
- bl54l15_dvk/nrf54l15/cpuapp
74-
integration_platforms:
75-
- bl54l15_dvk/nrf54l15/cpuapp
76-
extra_args:
77-
- SB_CONF_FILE=sysbuild/bl54l15_dvk_nrf54l15_cpuflpr.conf
78-
- hello_world_SNIPPET=nordic-flpr
79-
sample.sysbuild.hello_world.bl54l15u_dvk_nrf54l15_cpuflpr:
80-
platform_allow:
81-
- bl54l15u_dvk/nrf54l15/cpuapp
82-
integration_platforms:
83-
- bl54l15u_dvk/nrf54l15/cpuapp
84-
extra_args:
85-
- SB_CONF_FILE=sysbuild/bl54l15u_dvk_nrf54l15_cpuflpr.conf
86-
- hello_world_SNIPPET=nordic-flpr
Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
# Copyright (c) 2024 Nordic Semiconductor ASA
22
# SPDX-License-Identifier: Apache-2.0
33

4-
if("${SB_CONFIG_REMOTE_BOARD}" STREQUAL "")
5-
message(FATAL_ERROR "REMOTE_BOARD must be set to a valid board name")
6-
endif()
7-
8-
ExternalZephyrProject_Add(
9-
APPLICATION remote
10-
SOURCE_DIR ${APP_DIR}/remote
11-
BOARD ${SB_CONFIG_REMOTE_BOARD}
12-
)
4+
if(DEFINED SB_CONFIG_REMOTE_BOARD)
5+
ExternalZephyrProject_Add(
6+
APPLICATION remote
7+
SOURCE_DIR ${APP_DIR}/remote
8+
BOARD ${SB_CONFIG_REMOTE_BOARD}
9+
)
1310

14-
add_dependencies(${DEFAULT_IMAGE} remote)
15-
sysbuild_add_dependencies(FLASH ${DEFAULT_IMAGE} remote)
11+
add_dependencies(${DEFAULT_IMAGE} remote)
12+
sysbuild_add_dependencies(FLASH ${DEFAULT_IMAGE} remote)
13+
endif()

samples/sysbuild/hello_world/sysbuild/bl54l15_dvk_nrf54l15_cpuflpr.conf

Lines changed: 0 additions & 6 deletions
This file was deleted.

samples/sysbuild/hello_world/sysbuild/bl54l15u_dvk_nrf54l15_cpuflpr.conf

Lines changed: 0 additions & 6 deletions
This file was deleted.

samples/sysbuild/hello_world/sysbuild/nrf5340dk_nrf5340_cpunet.conf

Lines changed: 0 additions & 1 deletion
This file was deleted.

samples/sysbuild/hello_world/sysbuild/nrf54h20dk_nrf54h20_cpuflpr.conf

Lines changed: 0 additions & 1 deletion
This file was deleted.

samples/sysbuild/hello_world/sysbuild/nrf54h20dk_nrf54h20_cpuflpr_xip.conf

Lines changed: 0 additions & 1 deletion
This file was deleted.

samples/sysbuild/hello_world/sysbuild/nrf54h20dk_nrf54h20_cpuppr.conf

Lines changed: 0 additions & 1 deletion
This file was deleted.

samples/sysbuild/hello_world/sysbuild/nrf54h20dk_nrf54h20_cpuppr_xip.conf

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)