Skip to content

Commit e979314

Browse files
[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 323d9f4 commit e979314

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

scripts/west_commands/runners/nrf_common.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,12 @@ 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 or changing peripheral
277+
# allocations.
278+
self.reset_target()
279+
else:
280+
# Ensure that firmware is not executing while erasing/programming
281+
self.exec_op("reset", option="RESET_VIA_SECDOM")
276282

277283
# Manage SUIT artifacts.
278284
# This logic should be executed only once per build.
@@ -298,16 +304,8 @@ def program_hex(self):
298304
self.op_program(app_root_envelope_hex_file, 'ERASE_NONE', None, defer=True, core='NRFDL_DEVICE_CORE_APPLICATION')
299305

300306
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'})
305307
core = 'NRFDL_DEVICE_CORE_APPLICATION'
306308
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'})
311309
core = 'NRFDL_DEVICE_CORE_NETWORK'
312310
else:
313311
if self.erase:

0 commit comments

Comments
 (0)