Skip to content

Commit 373d2a4

Browse files
committed
[nrf fromtree] 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]> (cherry picked from commit 866e690)
1 parent 50d943c commit 373d2a4

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
@@ -286,26 +286,28 @@ def program_hex(self):
286286
mpi_hex_dir = Path(os.path.join(self.cfg.build_dir, 'zephyr'))
287287

288288
# Handle Manifest Provisioning Information
289-
if self.build_conf.getboolean('CONFIG_SUIT_MPI_GENERATE'):
289+
if self.sysbuild_conf.getboolean('SB_CONFIG_SUIT_MPI_GENERATE'):
290290
app_mpi_hex_file = os.fspath(
291-
mpi_hex_dir / self.build_conf.get('CONFIG_SUIT_MPI_APP_AREA_PATH'))
291+
mpi_hex_dir / self.sysbuild_conf.get('SB_CONFIG_SUIT_MPI_APP_AREA_PATH'))
292292
rad_mpi_hex_file = os.fspath(
293-
mpi_hex_dir / self.build_conf.get('CONFIG_SUIT_MPI_RAD_AREA_PATH')
294-
)
295-
self.op_program(
296-
app_mpi_hex_file,
297-
'ERASE_NONE',
298-
None,
299-
defer=True,
300-
core='NRFDL_DEVICE_CORE_APPLICATION',
301-
)
302-
self.op_program(
303-
rad_mpi_hex_file,
304-
'ERASE_NONE',
305-
None,
306-
defer=True,
307-
core='NRFDL_DEVICE_CORE_NETWORK',
293+
mpi_hex_dir / self.sysbuild_conf.get('SB_CONFIG_SUIT_MPI_RAD_AREA_PATH')
308294
)
295+
if os.path.exists(app_mpi_hex_file):
296+
self.op_program(
297+
app_mpi_hex_file,
298+
'ERASE_NONE',
299+
None,
300+
defer=True,
301+
core='NRFDL_DEVICE_CORE_APPLICATION',
302+
)
303+
if os.path.exists(rad_mpi_hex_file):
304+
self.op_program(
305+
rad_mpi_hex_file,
306+
'ERASE_NONE',
307+
None,
308+
defer=True,
309+
core='NRFDL_DEVICE_CORE_NETWORK',
310+
)
309311

310312
# Handle SUIT root manifest if application manifests are not used.
311313
# If an application firmware is built, the root envelope is merged
@@ -314,13 +316,14 @@ def program_hex(self):
314316
app_root_envelope_hex_file = os.fspath(
315317
mpi_hex_dir / 'suit_installed_envelopes_application_merged.hex'
316318
)
317-
self.op_program(
318-
app_root_envelope_hex_file,
319-
'ERASE_NONE',
320-
None,
321-
defer=True,
322-
core='NRFDL_DEVICE_CORE_APPLICATION',
323-
)
319+
if os.path.exists(app_root_envelope_hex_file):
320+
self.op_program(
321+
app_root_envelope_hex_file,
322+
'ERASE_NONE',
323+
None,
324+
defer=True,
325+
core='NRFDL_DEVICE_CORE_APPLICATION',
326+
)
324327

325328
if cpuapp:
326329
core = 'NRFDL_DEVICE_CORE_APPLICATION'

0 commit comments

Comments
 (0)