Skip to content

Commit 3640716

Browse files
nordicjmrlubos
authored andcommitted
sysbuild: Add image selection for FLPR core images
Allows selecting a core to be built for the FLPR core on supported devices, with empty as the only user selectable image. Also moves HPF into FLPR configuration and removes duplicate methods of configuration Signed-off-by: Jamie McCrae <[email protected]>
1 parent 6aca353 commit 3640716

File tree

7 files changed

+80
-33
lines changed

7 files changed

+80
-33
lines changed

cmake/sysbuild/hpf.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
#
33
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
44

5-
# Apply snippet to both images. Assumption is that HPF image is called 'hpf'.
5+
# Apply snippet to both images.
66
function(hpf_apply_snippets snippet)
77
sysbuild_cache_set(VAR ${DEFAULT_IMAGE}_SNIPPET APPEND REMOVE_DUPLICATES ${snippet})
8-
sysbuild_cache_set(VAR hpf_SNIPPET APPEND REMOVE_DUPLICATES ${snippet})
8+
sysbuild_cache_set(VAR ${SB_CONFIG_FLPRCORE_IMAGE_NAME}_SNIPPET APPEND REMOVE_DUPLICATES ${snippet})
99
endfunction()
1010

1111
function(hpf_apply_flpr_fault_timer_params timeout)
12-
set_config_bool(hpf CONFIG_HPF_MSPI_FAULT_TIMER y)
12+
set_config_bool(${SB_CONFIG_FLPRCORE_IMAGE_NAME} CONFIG_HPF_MSPI_FAULT_TIMER y)
1313
set_config_bool(${DEFAULT_IMAGE} CONFIG_MSPI_HPF_FAULT_TIMER y)
1414
set_config_int(${DEFAULT_IMAGE} CONFIG_MSPI_HPF_FAULT_TIMEOUT ${timeout})
1515
endfunction()
@@ -30,7 +30,7 @@ if(SB_CONFIG_HPF)
3030
endif()
3131
endif()
3232
if(SB_CONFIG_HPF_DEVELOPER_MODE)
33-
set_config_bool(hpf CONFIG_HPF_DEVELOPER_MODE y)
33+
set_config_bool(${SB_CONFIG_FLPRCORE_IMAGE_NAME} CONFIG_HPF_DEVELOPER_MODE y)
3434
endif()
3535

3636
if(SB_CONFIG_HPF_APPLY_SNIPPET)

sysbuild/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -902,9 +902,9 @@ include(ncs_sysbuild_extensions)
902902
include(${CMAKE_CURRENT_LIST_DIR}/extensions.cmake)
903903
include(${CMAKE_CURRENT_LIST_DIR}/appcore.cmake)
904904
include(${CMAKE_CURRENT_LIST_DIR}/netcore.cmake)
905+
include(${CMAKE_CURRENT_LIST_DIR}/flprcore.cmake)
905906
include(${CMAKE_CURRENT_LIST_DIR}/pprcore.cmake)
906907
include(${CMAKE_CURRENT_LIST_DIR}/secureboot.cmake)
907908
include(${CMAKE_CURRENT_LIST_DIR}/mcuboot.cmake)
908-
include(${CMAKE_CURRENT_LIST_DIR}/hpf.cmake)
909909

910910
store_ncs_vars()

sysbuild/Kconfig.flprcore

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,57 @@ config FLPRCORE_REMOTE_BOARD_TARGET_CPUCLUSTER
1212
string
1313
default "cpuflpr"
1414

15+
menu "Fast lightweight peripheral processor core (FLPR) configuration"
16+
depends on SUPPORT_FLPRCORE
17+
18+
config SUPPORT_FLPRCORE_EMPTY
19+
bool
20+
default y
21+
22+
config DEFAULT_FLPRCORE_EMPTY
23+
bool
24+
25+
choice FLPRCORE
26+
prompt "FLPR core image" if !HPF
27+
default FLPRCORE_EMPTY if DEFAULT_FLPRCORE_EMPTY && FLPRCORE_REMOTE_BOARD_TARGET_CPUCLUSTER != ""
28+
depends on SUPPORT_FLPRCORE
29+
30+
config FLPRCORE_NONE
31+
bool "None"
32+
help
33+
Do not include a FLPR core image in the build.
34+
35+
config FLPRCORE_EMPTY
36+
bool "Empty"
37+
depends on SUPPORT_FLPRCORE_EMPTY
38+
help
39+
Include empty image as the FLPR core image to use.
40+
41+
endchoice
42+
43+
if !FLPRCORE_NONE || HPF
44+
45+
config FLPRCORE_IMAGE_NAME
46+
string
47+
default "empty_flpr_core" if FLPRCORE_EMPTY
48+
default "hpf_gpio" if HPF_GPIO
49+
default "hpf_mspi" if HPF_MSPI
50+
help
51+
Name of FLPR core image.
52+
53+
config FLPRCORE_IMAGE_PATH
54+
string
55+
default "$(ZEPHYR_NRF_MODULE_DIR)/samples/basic/empty" if FLPRCORE_EMPTY
56+
default "$(ZEPHYR_NRF_MODULE_DIR)/applications/hpf/gpio" if HPF_GPIO
57+
default "$(ZEPHYR_NRF_MODULE_DIR)/applications/hpf/mspi" if HPF_MSPI
58+
help
59+
Source directory of FLPR core image.
60+
61+
endif # !FLPRCORE_NONE
62+
63+
# Include high performance framework which provides it's own FLPR configuration
64+
rsource "Kconfig.hpf"
65+
66+
endmenu
67+
1568
endif # SUPPORT_FLPRCORE

sysbuild/Kconfig.hpf

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,6 @@ endchoice
2323
config HPF_DEVELOPER_MODE
2424
bool "HPF developer mode"
2525

26-
config HPF_IMAGE_PATH
27-
string
28-
default "$(ZEPHYR_NRF_MODULE_DIR)/applications/hpf/gpio" if HPF_GPIO
29-
default "$(ZEPHYR_NRF_MODULE_DIR)/applications/hpf/mspi" if HPF_MSPI
30-
help
31-
Source directory of HPF image.
32-
3326
config HPF_APPLY_SNIPPET
3427
bool "Apply HPF overlay snippet"
3528
default y

sysbuild/Kconfig.sysbuild

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ rsource "Kconfig.bt_fast_pair"
7979
rsource "Kconfig.zip"
8080
rsource "Kconfig.matter"
8181
rsource "Kconfig.wifi"
82-
rsource "Kconfig.hpf"
8382
rsource "Kconfig.approtect"
8483
rsource "Kconfig.lwm2m_carrier"
8584
rsource "Kconfig.cracen"

sysbuild/flprcore.cmake

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#
2+
# Copyright (c) 2025 Nordic Semiconductor
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
6+
# Include FLPR core image if enabled
7+
if(SB_CONFIG_SUPPORT_FLPRCORE AND NOT SB_CONFIG_FLPRCORE_NONE AND DEFINED SB_CONFIG_FLPRCORE_IMAGE_NAME)
8+
# Calculate the FLPR core board target
9+
string(REPLACE "/" ";" split_board_qualifiers "${BOARD_QUALIFIERS}")
10+
list(GET split_board_qualifiers 1 target_soc)
11+
list(GET split_board_qualifiers 2 target_cpucluster)
12+
set(board_target_flprcore "${BOARD}/${target_soc}/${SB_CONFIG_FLPRCORE_REMOTE_BOARD_TARGET_CPUCLUSTER}")
13+
set(target_soc)
14+
set(target_cpucluster)
15+
16+
ExternalZephyrProject_Add(
17+
APPLICATION ${SB_CONFIG_FLPRCORE_IMAGE_NAME}
18+
SOURCE_DIR ${SB_CONFIG_FLPRCORE_IMAGE_PATH}
19+
BOARD ${board_target_flprcore}
20+
BOARD_REVISION ${BOARD_REVISION}
21+
)
22+
endif()

sysbuild/hpf.cmake

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

0 commit comments

Comments
 (0)