Commit eb7239c6 authored by Jonathan Nilsen's avatar Jonathan Nilsen Committed by Fabio Baltieri
Browse files

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: default avatarJonathan Nilsen <jonathan.nilsen@nordicsemi.no>
parent 56b6e575
Loading
Loading
Loading
Loading
+23 −3
Original line number Diff line number Diff line
@@ -369,9 +369,9 @@ class NrfBinaryRunner(ZephyrBinaryRunner):
        if self.family in ('nrf54h', 'nrf92'):
            erase_arg = 'ERASE_NONE'

            generated_uicr = self.build_conf.getboolean('CONFIG_NRF_REGTOOL_GENERATE_UICR')
            regtool_generated_uicr = self.build_conf.getboolean('CONFIG_NRF_REGTOOL_GENERATE_UICR')

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

            if not self.erase and generated_uicr:
            if self.build_conf.getboolean("CONFIG_NRF_HALTIUM_GENERATE_UICR"):
                zephyr_build_dir = Path(self.cfg.build_dir) / 'zephyr'

                self.op_program(
                    str(zephyr_build_dir / 'uicr.hex'),
                    'ERASE_NONE',
                    None,
                    defer=True,
                    core='Application',
                )

                if self.build_conf.getboolean("CONFIG_NRF_HALTIUM_UICR_PERIPHCONF"):
                    self.op_program(
                        str(zephyr_build_dir / 'periphconf.hex'),
                        'ERASE_NONE',
                        None,
                        defer=True,
                        core='Application',
                    )

            if not self.erase and regtool_generated_uicr:
                self.exec_op('erase', core=core, kind='uicr')
        else:
            if self.erase: