From 7aa947a8a5d5749cb751612c23d47bcedd877ce3 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 8 Nov 2024 12:01:17 +0000 Subject: [PATCH] [nrf noup] config: Add support for non-PM factory data generation fixup! [nrf noup] config: Add initial sysbuild files Adds support for factory data generation using devicetree data from the primary sysbuild image, if partition manager is not enabled for a build Signed-off-by: Jamie McCrae (cherry picked from commit 93c712e6e0be9211507cb9e559860b32daa984ed) Signed-off-by: Adrian Gielniewski --- .../generate_factory_data_sysbuild.cmake | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/config/nrfconnect/chip-module/generate_factory_data_sysbuild.cmake b/config/nrfconnect/chip-module/generate_factory_data_sysbuild.cmake index ff37a5f57e..ff5b44d60f 100644 --- a/config/nrfconnect/chip-module/generate_factory_data_sysbuild.cmake +++ b/config/nrfconnect/chip-module/generate_factory_data_sysbuild.cmake @@ -163,21 +163,16 @@ function(nrfconnect_create_factory_data factory_data_target script_path schema_p string(APPEND script_args "--offset $\n") string(APPEND script_args "--size $\n") else() - include(${CMAKE_BINARY_DIR}/${DEFAULT_IMAGE}/zephyr/dts.cmake) - - get_target_property(factory_data_alias devicetree_target "DT_ALIAS|factory-data") - get_target_property(factory_data_address devicetree_target "DT_REG|${factory_data_alias}|ADDR") - get_target_property(factory_data_size devicetree_target "DT_REG|${factory_data_alias}|SIZE") - - # remove ; from address and size properties - string(SUBSTRING ${factory_data_address} 0 -1 factory_data_address) - string(SUBSTRING ${factory_data_size} 0 -1 factory_data_size) - if(NOT (DEFINED factory_data_alias AND DEFINED factory_data_address AND DEFINED factory_data_size)) - message(FATAL_ERROR "factory-data alias does not exist in DTS") - endif() + include(${ZEPHYR_NRF_MODULE_DIR}/cmake/sysbuild/suit_utilities.cmake) + sysbuild_dt_alias(factory_data_alias IMAGE ${DEFAULT_IMAGE} PROPERTY "factory-data") + sysbuild_dt_reg_addr(factory_data_address IMAGE ${DEFAULT_IMAGE} PATH "${factory_data_alias}") + sysbuild_dt_reg_size(factory_data_size IMAGE ${DEFAULT_IMAGE} PATH "${factory_data_alias}") string(APPEND script_args "--offset ${factory_data_address}\n") string(APPEND script_args "--size ${factory_data_size}\n") + suit_add_merge_hex_file(FILES ${factory_data_output_path}.hex + DEPENDENCIES ${factory_data_target} + ) endif() # Execute first script to create a JSON file