Skip to content

Commit 96cef0c

Browse files
jonathannilsenrlubos
authored andcommitted
[nrf fromtree] west: runners: nrf: Program UICR/PERIPHCONF artifacts if present
Program the new UICR and PERIPHCONF artifacts if they are generated. These are required for the application to operate properly if they are in use. Signed-off-by: Jonathan Nilsen <[email protected]> (cherry picked from commit eb7239c)
1 parent 7a80a2f commit 96cef0c

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

scripts/west_commands/runners/nrf_common.py

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,9 +369,9 @@ def program_hex(self):
369369
if self.family in ('nrf54h', 'nrf92'):
370370
erase_arg = 'ERASE_NONE'
371371

372-
generated_uicr = self.build_conf.getboolean('CONFIG_NRF_REGTOOL_GENERATE_UICR')
372+
regtool_generated_uicr = self.build_conf.getboolean('CONFIG_NRF_REGTOOL_GENERATE_UICR')
373373

374-
if generated_uicr and not self.hex_get_uicrs().get(core):
374+
if regtool_generated_uicr and not self.hex_get_uicrs().get(core):
375375
raise RuntimeError(
376376
f"Expected a UICR to be contained in: {self.hex_}\n"
377377
"Please ensure that the correct version of nrf-regtool is "
@@ -434,7 +434,27 @@ def program_hex(self):
434434
core='Application',
435435
)
436436

437-
if not self.erase and generated_uicr:
437+
if self.build_conf.getboolean("CONFIG_NRF_HALTIUM_GENERATE_UICR"):
438+
zephyr_build_dir = Path(self.cfg.build_dir) / 'zephyr'
439+
440+
self.op_program(
441+
str(zephyr_build_dir / 'uicr.hex'),
442+
'ERASE_NONE',
443+
None,
444+
defer=True,
445+
core='Application',
446+
)
447+
448+
if self.build_conf.getboolean("CONFIG_NRF_HALTIUM_UICR_PERIPHCONF"):
449+
self.op_program(
450+
str(zephyr_build_dir / 'periphconf.hex'),
451+
'ERASE_NONE',
452+
None,
453+
defer=True,
454+
core='Application',
455+
)
456+
457+
if not self.erase and regtool_generated_uicr:
438458
self.exec_op('erase', core=core, kind='uicr')
439459
else:
440460
if self.erase:

0 commit comments

Comments
 (0)