Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove child/parent image support #19283

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
18 changes: 4 additions & 14 deletions applications/nrf5340_audio/tools/buildprog/buildprog.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def __print_dev_conf(device_list):


def __build_cmd_get(core: Core, device: AudioDevice, build: BuildType,
pristine, child_image, options):
pristine, options):
if core == Core.app:
build_cmd = (f"west build {TARGET_CORE_APP_FOLDER} "
f"-b {TARGET_BOARD_NRF5340_AUDIO_DK_APP_NAME} "
Expand All @@ -108,9 +108,6 @@ def __build_cmd_get(core: Core, device: AudioDevice, build: BuildType,
else:
raise Exception("Invalid build type!")

if not child_image:
device_flag += " -DCONFIG_NCS_INCLUDE_RPMSG_CHILD_IMAGE=n"

if options.nrf21540:
device_flag += " -Dnrf5340_audio_SHIELD=nrf21540ek"
device_flag += " -Dipc_radio_SHIELD=nrf21540ek"
Expand Down Expand Up @@ -156,7 +153,6 @@ def __build_module(build_config, options):
build_config.device,
build_config.build,
build_config.pristine,
build_config.child_image,
options,
)
west_str = f"{build_cmd} -d {dest_folder} "
Expand Down Expand Up @@ -190,11 +186,11 @@ def __find_snr():
return list(map(int, snrs))


def __populate_hex_paths(dev, options, child_image):
def __populate_hex_paths(dev, options):
"""Poplulate hex paths where relevant"""

_, temp_dest_folder, _, _ = __build_cmd_get(
Core.app, dev.nrf5340_audio_dk_dev, options.build, options.pristine, child_image, options
Core.app, dev.nrf5340_audio_dk_dev, options.build, options.pristine, options
)

dev.hex_path_app = temp_dest_folder / "merged.hex"
Expand Down Expand Up @@ -364,23 +360,18 @@ def __main():

# Reboot step finished
# Build step start
child_image = True

if options.build is not None:
print("Invoking build step")
build_configs = []
if Core.app in cores:
if not Core.net in cores:
child_image = False

if AudioDevice.headset in devices:
build_configs.append(
BuildConf(
core=Core.app,
device=AudioDevice.headset,
pristine=options.pristine,
build=options.build,
child_image=child_image,
)
)
if AudioDevice.gateway in devices:
Expand All @@ -390,7 +381,6 @@ def __main():
device=AudioDevice.gateway,
pristine=options.pristine,
build=options.build,
child_image=child_image,
)
)

Expand All @@ -406,7 +396,7 @@ def __main():
if options.program:
for dev in device_list:
if dev.snr_connected:
__populate_hex_paths(dev, options, child_image)
__populate_hex_paths(dev, options)
program_threads_run(device_list, sequential=options.sequential_prog)

# Program step finished
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,3 @@ class BuildConf:
device: AudioDevice
build: BuildType
pristine: bool
child_image: bool
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
Loading