Skip to content

Commit

Permalink
treewide: Remove child/parent image support
Browse files Browse the repository at this point in the history
Removes support for child/parent image

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
  • Loading branch information
nordicjm committed Jan 8, 2025
1 parent 5373eab commit 88eaae4
Show file tree
Hide file tree
Showing 101 changed files with 99 additions and 3,955 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ endforeach()
include(cmake/extensions.cmake)
include(cmake/version.cmake)
include(cmake/version_app.cmake)
include(cmake/multi_image.cmake)
include(cmake/sdp.cmake)

zephyr_include_directories(include)
Expand Down
6 changes: 0 additions & 6 deletions Kconfig.nrf
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ endif # BUILD_WITH_TFM

menu "Nordic nRF Connect"

# Hides child parent configuration options
config HIDE_CHILD_PARENT_CONFIG
bool
default y if "$(HIDE_CHILD_PARENT_CONFIG)" = "True"
default n

# Override configuration from zephyr which sets this to 0x200 if MCUboot is
# enabled (CONFIG_BOOTLOADER_MCUBOOT), since NCS use partition_manager to
# get this offset intsead.
Expand Down
1 change: 0 additions & 1 deletion applications/asset_tracker_v2/boards/native_sim.conf
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ CONFIG_IMG_MANAGER=n
CONFIG_MCUBOOT_IMG_MANAGER=n
CONFIG_IMG_ERASE_PROGRESSIVELY=n
CONFIG_SECURE_BOOT=n
CONFIG_BUILD_S1_VARIANT=n

# Watchdog
CONFIG_WATCHDOG_APPLICATION=n
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,3 @@ CONFIG_LED_PWM=y

# Disable MCUboot DFU -- incompatible with static partitions
CONFIG_SECURE_BOOT=n
CONFIG_BUILD_S1_VARIANT=n
1 change: 0 additions & 1 deletion applications/asset_tracker_v2/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ CONFIG_IMG_MANAGER=y
CONFIG_MCUBOOT_IMG_MANAGER=y
CONFIG_IMG_ERASE_PROGRESSIVELY=y
CONFIG_SECURE_BOOT=y
CONFIG_BUILD_S1_VARIANT=y

# Watchdog
CONFIG_WATCHDOG_APPLICATION=y
Expand Down
4 changes: 0 additions & 4 deletions applications/machine_learning/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,3 @@ add_subdirectory(common/src/modules)
add_subdirectory(src/events)
add_subdirectory(src/modules)
add_subdirectory(src/util)

if(CONFIG_BT_HCI_IPC AND NOT SYSBUILD)
assert_exists(hci_ipc_CONF_FILE)
endif()
3 changes: 0 additions & 3 deletions applications/nrf5340_audio/Kconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ config SYSTEM_WORKQUEUE_STACK_SIZE
config THREAD_NAME
default y

config NCS_INCLUDE_RPMSG_CHILD_IMAGE
default y

# Workaround to not use fatal_error.c in NCS. Note that the system may still
# reset on error depending on the build configuraion
config RESET_ON_FATAL_ERROR
Expand Down
14 changes: 1 addition & 13 deletions applications/nrf_desktop/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,7 @@ add_subdirectory(src/hw_interface)
add_subdirectory(src/modules)
add_subdirectory(src/util)

if(NOT SYSBUILD AND NOT CONFIG_NCS_IS_VARIANT_IMAGE)
if(CONFIG_BOOTLOADER_MCUBOOT)
assert_exists(mcuboot_CONF_FILE)
endif()
if(CONFIG_SECURE_BOOT)
assert_exists(b0_CONF_FILE)
endif()
if(CONFIG_BT_HCI_IPC)
assert_exists(hci_ipc_CONF_FILE)
endif()
endif()

if (CONFIG_IMG_MANAGER)
if(CONFIG_IMG_MANAGER)
zephyr_library_link_libraries(MCUBOOT_BOOTUTIL)
endif()

Expand Down
6 changes: 0 additions & 6 deletions boards/nordic/thingy91x/Kconfig.defconfig.nrf5340
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,10 @@ config SECURE_BOOT
config BOOTLOADER_MCUBOOT
default y if BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS

config ADD_MCUBOOT_MEDIATE_SIM_FLASH_DTS
default y if BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS

config NRF53_UPGRADE_NETWORK_CORE
default y if BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS

config UPDATEABLE_IMAGE_NUMBER
default 2 if BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS

config SB_SIGNING_KEY_FILE
default "$(ZEPHYR_NRF_MODULE_DIR)/boards/nordic/thingy91x/nsib_signing_key_nrf5340.pem" if BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS || BOARD_THINGY91X_NRF5340_CPUNET

endif # !IS_BOOTLOADER_IMG
8 changes: 0 additions & 8 deletions boards/nordic/thingy91x/Kconfig.defconfig.nrf9151
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,6 @@ config SECURE_BOOT
config BOOTLOADER_MCUBOOT
default y

# Do not use these keys for own custom boards!
# These are meant as examples and therefore public.
# The documentation of the nRF Secure Immutable Bootloader and MCUBoot detail on how
# to set up your own keys.

config SB_SIGNING_KEY_FILE
default "$(ZEPHYR_NRF_MODULE_DIR)/boards/nordic/thingy91x/nsib_signing_key.pem"

config I2C
default y

Expand Down
5 changes: 5 additions & 0 deletions boards/nordic/thingy91x/Kconfig.sysbuild
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ endif # BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS

if BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS || BOARD_THINGY91X_NRF5340_CPUNET

# Do not use these keys for own custom boards!
# These are meant as examples and therefore public.
# The documentation of the nRF Secure Immutable Bootloader and MCUBoot detail on how
# to set up your own keys.

config SECURE_BOOT_SIGNING_KEY_FILE
default "$(ZEPHYR_NRF_MODULE_DIR)/boards/nordic/thingy91x/nsib_signing_key_nrf5340.pem"

Expand Down
87 changes: 6 additions & 81 deletions cmake/extensions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -80,35 +80,6 @@ function(get_board_without_ns_suffix board_in board_out)
endif()
endfunction()

# Add an overlay file to a child image.
# This can be used by a parent image to set overlay of Kconfig configuration or devicetree
# in its child images. This function must be called before 'add_child_image(image)'
# to have effect.
#
# Parameters:
# 'image' - child image name
# 'overlay_file' - overlay to be added to child image
# 'overlay_type' - 'OVERLAY_CONFIG' or 'DTC_OVERLAY_FILE'
function(add_overlay image overlay_file overlay_type)
set(old_overlays ${${image}_${overlay_type}})
string(FIND "${old_overlays}" "${overlay_file}" found)
if (${found} EQUAL -1)
set(${image}_${overlay_type} "${old_overlays};${overlay_file}" CACHE STRING
"Extra config fragments for ${image} child image" FORCE
)
endif()
endfunction()

# Convenience macro to add configuration overlays to child image.
macro(add_overlay_config image overlay_file)
add_overlay(${image} ${overlay_file} EXTRA_CONF_FILE)
endmacro()

# Convenience macro to add device tree overlays to child image.
macro(add_overlay_dts image overlay_file)
add_overlay(${image} ${overlay_file} EXTRA_DTC_OVERLAY_FILE)
endmacro()

# Add a partition manager configuration file to the build.
# Note that is only one image is included in the build,
# you must set CONFIG_PM_SINGLE_IMAGE=y for the partition manager
Expand Down Expand Up @@ -353,59 +324,13 @@ function(set_shared)
set(multi_args "PROPERTY")
cmake_parse_arguments(SHARE "${flags}" "${single_args}" "${multi_args}" ${ARGN})

if(SYSBUILD)
# Sysbuild can read the cache directly, no reason for an extra share file.
list(POP_FRONT SHARE_PROPERTY listname)
if(SHARE_APPEND)
list(APPEND ${listname} ${SHARE_PROPERTY})
list(REMOVE_DUPLICATES ${listname})
set(SHARE_PROPERTY ${${listname}})
endif()
set(${listname} "${SHARE_PROPERTY}" CACHE INTERNAL "shared var")
return()
endif()

check_arguments_required("set_shared" SHARE IMAGE FILE)

check_arguments_exclusive("set_shared" SHARE FILE IMAGE PROPERTY APPEND)
check_arguments_exclusive("set_shared" SHARE IMAGE FILE)


set(prop_target ${IMAGE_NAME}_shared_property_target)
if(NOT TARGET ${prop_target})
add_custom_target(${prop_target})
endif()

if(DEFINED SHARE_IMAGE)
# When using IMAGE, then PROPERTY is also required.
check_arguments_required("set_shared" SHARE PROPERTY)

set(share_prop_target ${SHARE_IMAGE}_shared_property_target)

if(SHARE_APPEND)
set(SHARE_APPEND APPEND)
else()
set(SHARE_APPEND)
endif()

get_property(string_targets TARGET ${prop_target} PROPERTY image_targets)
if(NOT "add_custom_target(${share_prop_target})" IN_LIST string_targets)
set_property(
TARGET ${prop_target} APPEND PROPERTY
image_targets "add_custom_target(${share_prop_target})"
)
endif()

set_property(TARGET ${prop_target} APPEND_STRING PROPERTY shared_vars
"set_property(TARGET ${share_prop_target} ${SHARE_APPEND} PROPERTY ${SHARE_PROPERTY})\n"
)
endif()

if(DEFINED SHARE_FILE)
set_property(TARGET ${prop_target} APPEND_STRING PROPERTY shared_vars
"include(${SHARE_FILE})\n"
)
list(POP_FRONT SHARE_PROPERTY listname)
if(SHARE_APPEND)
list(APPEND ${listname} ${SHARE_PROPERTY})
list(REMOVE_DUPLICATES ${listname})
set(SHARE_PROPERTY ${${listname}})
endif()
set(${listname} "${SHARE_PROPERTY}" CACHE INTERNAL "shared var")
endfunction()

# generate_shared(IMAGE <img> FILE <file>)
Expand Down
2 changes: 1 addition & 1 deletion cmake/fw_zip.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function(generate_dfu_zip)
message(FATAL_ERROR "Missing required param")
endif()

if(SYSBUILD AND GENZIP_IMAGE)
if(GENZIP_IMAGE)
set(APPNAME ${GENZIP_IMAGE})
sysbuild_get(CONFIG_BUILD_OUTPUT_META IMAGE ${GENZIP_IMAGE} VAR CONFIG_BUILD_OUTPUT_META KCONFIG)
sysbuild_get(CONFIG_BOARD IMAGE ${GENZIP_IMAGE} VAR CONFIG_BOARD KCONFIG)
Expand Down
11 changes: 2 additions & 9 deletions cmake/mesh_dfu_metadata.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@
find_package(Python3 REQUIRED)

function(mesh_dfu_metadata)
if(SYSBUILD)
set(metadata_dir ${CMAKE_BINARY_DIR}/${DEFAULT_IMAGE}/zephyr)
else()
set(metadata_dir ${PROJECT_BINARY_DIR})
endif()

set(metadata_dir ${CMAKE_BINARY_DIR}/${DEFAULT_IMAGE}/zephyr)
set(metadata_depends ${CMAKE_BINARY_DIR}/dfu_application.zip)

add_custom_command(
Expand Down Expand Up @@ -42,6 +37,4 @@ function(mesh_dfu_metadata)
)
endfunction()

if(SYSBUILD)
mesh_dfu_metadata()
endif()
mesh_dfu_metadata()
Loading

0 comments on commit 88eaae4

Please sign in to comment.