Skip to content

Commit 64bf17d

Browse files
e-rkfabiobaltieri
authored andcommitted
scripts: west_commands: runners: nrf_common: optional UICR cleanup
The flasher was unconditionally cleaning the UICR area, even when the application didn't have a new configuration generated. This can happen, when CONFIG_NRF_REGTOOL_GENERATE_UICR=n. In such case, keep the old UICR configuration on the device. A real scenario where we should set CONFIG_NRF_REGTOOL_GENERATE_UICR=n is when building multiple firmware images that are meant to run one domain. The primary application build generates the UICR configuration and secondary images don't. Before this change, the flashing process of the primary application would write new UICR configuration, but the flashing process of secondary images would erase it. Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
1 parent 24acc7d commit 64bf17d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/west_commands/runners/nrf_common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,13 +261,13 @@ def program_hex(self):
261261
self.exec_op('erase', core='NRFDL_DEVICE_CORE_NETWORK')
262262

263263
if self.build_conf.getboolean('CONFIG_SOC_NRF54H20_CPUAPP'):
264-
if not self.erase:
264+
if not self.erase and self.build_conf.getboolean('CONFIG_NRF_REGTOOL_GENERATE_UICR'):
265265
self.exec_op('erase', core='NRFDL_DEVICE_CORE_APPLICATION',
266266
chip_erase_mode='ERASE_UICR',
267267
qspi_erase_mode='ERASE_NONE')
268268
core = 'NRFDL_DEVICE_CORE_APPLICATION'
269269
elif self.build_conf.getboolean('CONFIG_SOC_NRF54H20_CPURAD'):
270-
if not self.erase:
270+
if not self.erase and self.build_conf.getboolean('CONFIG_NRF_REGTOOL_GENERATE_UICR'):
271271
self.exec_op('erase', core='NRFDL_DEVICE_CORE_NETWORK',
272272
chip_erase_mode='ERASE_UICR',
273273
qspi_erase_mode='ERASE_NONE')

0 commit comments

Comments
 (0)