The following programming options can be used with the --options parameter in nrfutil device program. These options allow you to control erase behavior, verification, and reset actions during programming operations.
| Option | Description and values |
|---|---|
chip_erase_mode |
Set pre-program erase mode for the internal memory. Values: - ERASE_NONE: Do not erase the internal memory.- ERASE_ALL: Erase the UICR and internal memory that belongs to the core. On some devices, this corresponds to a hardware ERASEALL. (Default)- ERASE_RANGES_TOUCHED_BY_FIRMWARE: Erase the memory ranges the firmware would be programmed to.- ERASE_CTRL_AP: Erase the UICR and internal memory that belongs to the core using the CTRL-AP. This erase method removes APPROTECTION if ERASEPROTECT is not enabled. On some devices, this corresponds to a hardware ERASEALL. |
ext_mem_erase_mode |
Set pre-program erase mode for the external memory. Values: - ERASE_NONE: Do not erase the external memory.- ERASE_ALL: Erase all external memory.- ERASE_RANGES_TOUCHED_BY_FIRMWARE: Erase the external memory ranges the firmware would be programmed to. |
verify |
Set post-program verify action. Values: - VERIFY_NONE: Do not verify the programmed data. (Default)- VERIFY_READ: Read back and verify the programmed data. |
reset |
Set post-program reset action. Values: - RESET_NONE: Do not reset the device after programming. (Default)- RESET_SYSTEM: Trigger an ARM system reset by setting the SYSRESETREQ bit in the AIRCR register of the CPU. On devices with Secure Domain firmware (SecDom FW), this is supported only on the secure core.- RESET_SOFT: Trigger a soft reset over the CTRL-AP. Supported only for devices with CTRL-AP that has this functionality.- RESET_PIN: Trigger a pin reset by toggling the reset pin.- RESET_HARD: Trigger a hard reset over the CTRL-AP. Supported only for devices with CTRL-AP that has this functionality.- RESET_DEFAULT: Select the predefined reset type for your device family: for nRF51, nRF52, nRF53, nRF54L, nRF91 Series, use RESET_SYSTEM; for nRF54H Series, use RESET_HARD.- RESET_VIA_SECDOM: Send a reset command to the SecDom FW. The SecDom FW handles the reset of other domains and defines how this process is carried out. Supported on devices with SecDom FW. |
These options can be combined in a single command. For example, you can use the following command to combine the steps in the procedure above (remember to replace <serial_number> and the /path/ to the firmware file):
nrfutil device program --serial-number <serial_number> --firmware /path/fw.hex --options chip_erase_mode=ERASE_ALL,reset=RESET_SYSTEM