From 8ca8c63337b87c727cc04a8cf0177bfb00047689 Mon Sep 17 00:00:00 2001 From: Georgios Vasilakis Date: Mon, 13 Oct 2025 17:12:53 +0200 Subject: [PATCH] [to be fromlist] scripts: west: nrf_common: Provision slot invalidation json The nRF54L series use a json file which helps to provision 2 KMU slots which are used for invalidating the Protected RAM. This change checks if this file exists and runs the provisioning command of nrfutil with it in order fill the relevant slots. Signed-off-by: Georgios Vasilakis --- scripts/west_commands/runners/nrf_common.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/west_commands/runners/nrf_common.py b/scripts/west_commands/runners/nrf_common.py index afa4665d8f4..a0e7d2e11ce 100644 --- a/scripts/west_commands/runners/nrf_common.py +++ b/scripts/west_commands/runners/nrf_common.py @@ -390,6 +390,12 @@ def program_hex(self): self.op_program(self.hex_, erase_arg, ext_mem_erase_opt, defer=True, core=core) + # provision relevant slots if prot_ram_inv_slots.json exists in the build directory + prot_ram_inv_slots = Path(self.cfg.build_dir).parent / 'prot_ram_inv_slots.json' + if prot_ram_inv_slots.exists(): + self.logger.info(f'Provisioning key file: {prot_ram_inv_slots}') + self.exec_op('x-provision-keys', keyfile=str(prot_ram_inv_slots), defer=True) + if self.erase or self.recover: # provision keys if keyfile.json exists in the build directory keyfile = Path(self.cfg.build_dir).parent / 'keyfile.json'