Skip to content

Commit 866e690

Browse files
tomchyfabiobaltieri
authored andcommitted
scripts: nrf_common: Move MPI to sysbuild Kconfig
Use sysbuild to build and configure SUIT Manifest Provisioning Information. Signed-off-by: Tomasz Chyrowicz <[email protected]>
1 parent 811ff1f commit 866e690

File tree

1 file changed

+27
-24
lines changed

1 file changed

+27
-24
lines changed

scripts/west_commands/runners/nrf_common.py

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -342,26 +342,28 @@ def program_hex(self):
342342
mpi_hex_dir = Path(os.path.join(self.cfg.build_dir, 'zephyr'))
343343

344344
# Handle Manifest Provisioning Information
345-
if self.build_conf.getboolean('CONFIG_SUIT_MPI_GENERATE'):
345+
if self.sysbuild_conf.getboolean('SB_CONFIG_SUIT_MPI_GENERATE'):
346346
app_mpi_hex_file = os.fspath(
347-
mpi_hex_dir / self.build_conf.get('CONFIG_SUIT_MPI_APP_AREA_PATH'))
347+
mpi_hex_dir / self.sysbuild_conf.get('SB_CONFIG_SUIT_MPI_APP_AREA_PATH'))
348348
rad_mpi_hex_file = os.fspath(
349-
mpi_hex_dir / self.build_conf.get('CONFIG_SUIT_MPI_RAD_AREA_PATH')
350-
)
351-
self.op_program(
352-
app_mpi_hex_file,
353-
'ERASE_NONE',
354-
None,
355-
defer=True,
356-
core='NRFDL_DEVICE_CORE_APPLICATION',
357-
)
358-
self.op_program(
359-
rad_mpi_hex_file,
360-
'ERASE_NONE',
361-
None,
362-
defer=True,
363-
core='NRFDL_DEVICE_CORE_NETWORK',
349+
mpi_hex_dir / self.sysbuild_conf.get('SB_CONFIG_SUIT_MPI_RAD_AREA_PATH')
364350
)
351+
if os.path.exists(app_mpi_hex_file):
352+
self.op_program(
353+
app_mpi_hex_file,
354+
'ERASE_NONE',
355+
None,
356+
defer=True,
357+
core='NRFDL_DEVICE_CORE_APPLICATION',
358+
)
359+
if os.path.exists(rad_mpi_hex_file):
360+
self.op_program(
361+
rad_mpi_hex_file,
362+
'ERASE_NONE',
363+
None,
364+
defer=True,
365+
core='NRFDL_DEVICE_CORE_NETWORK',
366+
)
365367

366368
# Handle SUIT root manifest if application manifests are not used.
367369
# If an application firmware is built, the root envelope is merged
@@ -370,13 +372,14 @@ def program_hex(self):
370372
app_root_envelope_hex_file = os.fspath(
371373
mpi_hex_dir / 'suit_installed_envelopes_application_merged.hex'
372374
)
373-
self.op_program(
374-
app_root_envelope_hex_file,
375-
'ERASE_NONE',
376-
None,
377-
defer=True,
378-
core='NRFDL_DEVICE_CORE_APPLICATION',
379-
)
375+
if os.path.exists(app_root_envelope_hex_file):
376+
self.op_program(
377+
app_root_envelope_hex_file,
378+
'ERASE_NONE',
379+
None,
380+
defer=True,
381+
core='NRFDL_DEVICE_CORE_APPLICATION',
382+
)
380383

381384
if not self.erase and generated_uicr:
382385
self.exec_op('erase', core=core, option={'chip_erase_mode': 'ERASE_UICR',

0 commit comments

Comments
 (0)