Skip to content

Commit 7981a26

Browse files
tomchyrlubos
authored andcommitted
[nrf fromlist] scripts: nrf_common: Use cfg for SUIT paths
It is safer to base the SUIT artifacts path on the path of the configuration file than the HEX file that is being flashed. The latter may be overriden by several scripts that merge/transform the final firmware image. Ref: NCSDK-26282 Upstream PR: zephyrproject-rtos/zephyr#76560 Signed-off-by: Tomasz Chyrowicz <[email protected]>
1 parent a49f603 commit 7981a26

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scripts/west_commands/runners/nrf_common.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,14 +265,14 @@ def program_hex(self):
265265
# This logic should be executed only once per build.
266266
# Use sysbuild board qualifiers to select the context, with which the artifacts will be programmed.
267267
if self.build_conf.get('CONFIG_BOARD_QUALIFIERS') == self.sysbuild_conf.get('SB_CONFIG_BOARD_QUALIFIERS'):
268-
hex_path = Path(self.hex_)
268+
mpi_hex_dir = Path(os.path.join(self.cfg.build_dir, 'zephyr'))
269269

270270
# Handle Manifest Provisioning Information
271271
if self.build_conf.getboolean('CONFIG_SUIT_MPI_GENERATE'):
272272
app_mpi_hex_file = os.fspath(
273-
hex_path.parent / self.build_conf.get('CONFIG_SUIT_MPI_APP_AREA_PATH'))
273+
mpi_hex_dir / self.build_conf.get('CONFIG_SUIT_MPI_APP_AREA_PATH'))
274274
rad_mpi_hex_file = os.fspath(
275-
hex_path.parent / self.build_conf.get('CONFIG_SUIT_MPI_RAD_AREA_PATH'))
275+
mpi_hex_dir / self.build_conf.get('CONFIG_SUIT_MPI_RAD_AREA_PATH'))
276276
self.op_program(app_mpi_hex_file, 'ERASE_NONE', None, defer=True, core='NRFDL_DEVICE_CORE_APPLICATION')
277277
self.op_program(rad_mpi_hex_file, 'ERASE_NONE', None, defer=True, core='NRFDL_DEVICE_CORE_NETWORK')
278278

@@ -281,7 +281,7 @@ def program_hex(self):
281281
# as well as the output HEX file.
282282
if not self.build_conf.getboolean('CONFIG_SOC_NRF54H20_CPUAPP') and self.sysbuild_conf.get('SB_CONFIG_SUIT_ENVELOPE'):
283283
app_root_envelope_hex_file = os.fspath(
284-
hex_path.parent / 'suit_installed_envelopes_application_merged.hex')
284+
mpi_hex_dir / 'suit_installed_envelopes_application_merged.hex')
285285
self.op_program(app_root_envelope_hex_file, 'ERASE_NONE', None, defer=True, core='NRFDL_DEVICE_CORE_APPLICATION')
286286

287287
if self.build_conf.getboolean('CONFIG_SOC_NRF54H20_CPUAPP'):

0 commit comments

Comments
 (0)