Skip to content

Commit 48129bf

Browse files
jonathannilsenhakonfam
authored andcommitted
[nrf noup] scripts: west_commands: runners: nrf: workarounds for SDFW v8.0.0
SDFW v8.0.0 introduces certain changes that require matching changes in nrfutil device to ensure that west flash works properly on nrf54h20dk and nrf9280pdk. This commit adds a few temporary workarounds to ensure that west flash works with an older nrfutil device version as well: 1. Don't erase UICR, as this tries to erase the extended UICR regions as well, and those regions no longer exist (resulting in an error). 2. Reset after erasing domains with west flash --erase. This is needed for the memory owned by the different domains to be freely accessible and able to be allocated to different domains. 2. Unless doing a west flash --erase, do a RESET_VIA_SECDOM reset before programming firmware. This ensures that all the cores are stopped before writing firmware. Removing the UICR erase step seemed to cause some instability when programming, which is suspected to be caused by the firmware running while programming. Signed-off-by: Jonathan Nilsen <[email protected]>
1 parent 16c7620 commit 48129bf

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

scripts/west_commands/runners/nrf_common.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,11 @@ def program_hex(self):
273273
if self.erase:
274274
self.exec_op('erase', core='NRFDL_DEVICE_CORE_APPLICATION')
275275
self.exec_op('erase', core='NRFDL_DEVICE_CORE_NETWORK')
276+
# A reset is needed if repartitioning the device memory
277+
self.reset_target()
278+
else:
279+
# Ensure that firmware is not executing while erasing/programming
280+
self.exec_op("reset", option="RESET_VIA_SECDOM")
276281

277282
# Manage SUIT artifacts.
278283
# This logic should be executed only once per build.
@@ -298,16 +303,8 @@ def program_hex(self):
298303
self.op_program(app_root_envelope_hex_file, 'ERASE_NONE', None, defer=True, core='NRFDL_DEVICE_CORE_APPLICATION')
299304

300305
if cpuapp:
301-
if not self.erase and self.build_conf.getboolean('CONFIG_NRF_REGTOOL_GENERATE_UICR'):
302-
self.exec_op('erase', core='NRFDL_DEVICE_CORE_APPLICATION',
303-
option={'chip_erase_mode': 'ERASE_UICR',
304-
'qspi_erase_mode': 'ERASE_NONE'})
305306
core = 'NRFDL_DEVICE_CORE_APPLICATION'
306307
elif cpurad:
307-
if not self.erase and self.build_conf.getboolean('CONFIG_NRF_REGTOOL_GENERATE_UICR'):
308-
self.exec_op('erase', core='NRFDL_DEVICE_CORE_NETWORK',
309-
option={'chip_erase_mode': 'ERASE_UICR',
310-
'qspi_erase_mode': 'ERASE_NONE'})
311308
core = 'NRFDL_DEVICE_CORE_NETWORK'
312309
else:
313310
if self.erase:

0 commit comments

Comments
 (0)