diff --git a/scripts/west_commands/runners/nrf_common.py b/scripts/west_commands/runners/nrf_common.py index a7401084ef3..110b14eeb51 100644 --- a/scripts/west_commands/runners/nrf_common.py +++ b/scripts/west_commands/runners/nrf_common.py @@ -52,29 +52,6 @@ }, } -# Relative to the root of the hal_nordic module -SUIT_STARTER_PATH = Path('zephyr/blobs/suit/bin/suit_manifest_starter.hex') - -@functools.cache -def _get_suit_starter(): - path = None - modules = zephyr_module.parse_modules(ZEPHYR_BASE) - for m in modules: - if 'hal_nordic' in m.meta.get('name'): - path = Path(m.project) - break - - if not path: - raise RuntimeError("hal_nordic project missing in the manifest") - - suit_starter = path / SUIT_STARTER_PATH - if not suit_starter.exists(): - raise RuntimeError("Unable to find suit manifest starter file, " - "please make sure to run \'west blobs fetch " - "hal_nordic\'") - - return str(suit_starter.resolve()) - class NrfBinaryRunner(ZephyrBinaryRunner): '''Runner front-end base class for nrf tools.''' @@ -95,9 +72,6 @@ def __init__(self, cfg, family, softreset, pinreset, dev_id, erase=False, self.force = force self.recover = bool(recover) - # Only applicable for nrfutil - self.suit_starter = False - self.tool_opt = [] if tool_opt is not None: for opts in [shlex.split(opt) for opt in tool_opt]: @@ -384,55 +358,6 @@ def program_hex(self): self.exec_op('erase', core='Application', kind='all') self.exec_op('erase', core='Network', kind='all') - # Manage SUIT artifacts. - # This logic should be executed only once per build. - # Use sysbuild board qualifiers to select the context, - # with which the artifacts will be programmed. - if self.build_conf.get('CONFIG_BOARD_QUALIFIERS') == self.sysbuild_conf.get( - 'SB_CONFIG_BOARD_QUALIFIERS' - ): - mpi_hex_dir = Path(os.path.join(self.cfg.build_dir, 'zephyr')) - - # Handle Manifest Provisioning Information - if self.sysbuild_conf.getboolean('SB_CONFIG_SUIT_MPI_GENERATE'): - app_mpi_hex_file = os.fspath( - mpi_hex_dir / self.sysbuild_conf.get('SB_CONFIG_SUIT_MPI_APP_AREA_PATH')) - rad_mpi_hex_file = os.fspath( - mpi_hex_dir / self.sysbuild_conf.get('SB_CONFIG_SUIT_MPI_RAD_AREA_PATH') - ) - if os.path.exists(app_mpi_hex_file): - self.op_program( - app_mpi_hex_file, - 'ERASE_NONE', - None, - defer=True, - core='Application', - ) - if os.path.exists(rad_mpi_hex_file): - self.op_program( - rad_mpi_hex_file, - 'ERASE_NONE', - None, - defer=True, - core='Network', - ) - - # Handle SUIT root manifest if application manifests are not used. - # If an application firmware is built, the root envelope is merged - # with other application manifests as well as the output HEX file. - if core != 'Application' and self.sysbuild_conf.get('SB_CONFIG_SUIT_ENVELOPE'): - app_root_envelope_hex_file = os.fspath( - mpi_hex_dir / 'suit_installed_envelopes_application_merged.hex' - ) - if os.path.exists(app_root_envelope_hex_file): - self.op_program( - app_root_envelope_hex_file, - 'ERASE_NONE', - None, - defer=True, - core='Application', - ) - if self.build_conf.getboolean("CONFIG_NRF_HALTIUM_GENERATE_UICR"): zephyr_build_dir = Path(self.cfg.build_dir) / 'zephyr' @@ -518,18 +443,6 @@ def reset_target(self): def do_require(self): ''' Ensure the tool is installed ''' - def _check_suit_starter(self, op): - op = op['operation'] - if op['type'] not in ('erase', 'recover', 'program'): - return None - if op['type'] == 'program' and op['options']['chip_erase_mode'] != "ERASE_UICR": - return None - - file = _get_suit_starter() - self.logger.debug(f'suit starter: {file}') - - return file - def op_program(self, hex_file, erase, ext_mem_erase, defer=False, core=None): args = self._op_program(hex_file, erase, ext_mem_erase) self.exec_op('program', defer, core, **args) @@ -556,12 +469,6 @@ def _exec_op(op, defer=False, core=None, **kwargs): return op _op = _exec_op(op, defer, core, **kwargs) - # Check if the suit manifest starter needs programming - if self.suit_starter and self.family == 'nrf54h': - file = self._check_suit_starter(_op) - if file: - args = self._op_program(file, 'ERASE_NONE', None) - _exec_op('program', defer, core, **args) @abc.abstractmethod def do_exec_op(self, op, force=False): diff --git a/scripts/west_commands/runners/nrfutil.py b/scripts/west_commands/runners/nrfutil.py index f11d2a7ad13..b8510de6fb5 100644 --- a/scripts/west_commands/runners/nrfutil.py +++ b/scripts/west_commands/runners/nrfutil.py @@ -18,14 +18,12 @@ class NrfUtilBinaryRunner(NrfBinaryRunner): def __init__(self, cfg, family, softreset, pinreset, dev_id, erase=False, erase_mode=None, ext_erase_mode=None, reset=True, tool_opt=None, - force=False, recover=False, suit_starter=False, - ext_mem_config_file=None): + force=False, recover=False, ext_mem_config_file=None): super().__init__(cfg, family, softreset, pinreset, dev_id, erase, erase_mode, ext_erase_mode, reset, tool_opt, force, recover) - self.suit_starter = suit_starter self.ext_mem_config_file = ext_mem_config_file self._ops = [] @@ -56,15 +54,11 @@ def do_create(cls, cfg, args): ext_erase_mode=args.ext_erase_mode, reset=args.reset, tool_opt=args.tool_opt, force=args.force, recover=args.recover, - suit_starter=args.suit_manifest_starter, ext_mem_config_file=args.ext_mem_config_file) @classmethod def do_add_parser(cls, parser): super().do_add_parser(parser) - parser.add_argument('--suit-manifest-starter', required=False, - action='store_true', - help='Use the SUIT manifest starter file') parser.add_argument('--ext-mem-config-file', required=False, dest='ext_mem_config_file', help='path to an JSON file with external memory configuration')