Syntax

nRF Util

tags
nRF Util

The command uses the following structure:

nrfutil device otp-write [--force] [--file PATH] [--address ARG] [--value ARG] [--serial-number ARG] [--traits ARG] [--remote-jlink ARG] [--family ARG] [--x-force-device ARG] [--x-sdfw-variant ARG] [--append-batch PATH] [--generate] [--help] 
Long Short Values Description
--force - Force writing the OTP memory

This flag needs to be set in order for OTP memory to be written.
--file PATH File containing OTP data (.hex, .ihex, .bin, .elf)

Data outside the OTP memory range leads to an error.

Values at OTP memory addresses not contained in the input file are not changed.

If there is no OPT memory data at all in the file, the operation is aborted.

If the input file is a .bin file, its start address is assumed to be the OTP memory address.
--address ARG Address to write to when using --value to write a word to OTP memory

The address needs to be within OTP memory.

This flag cannot be combined with --file.
--value ARG Word to write to OTP memory when using --address to specify an address within OTP memory

This flag cannot be combined with --file.
--serial-number ARG Select one or more devices based on a comma-separated list of serial numbers: --serial-number SN_1,SN_2,..,SN_n.
--traits ARG Select devices based on a comma-separated list of device traits: --traits TRAIT_1,TRAIT_2,...

The list of device traits is treated as an OR filter. By default, all devices except for devices that only has the usb trait are enumerated and listed.

List of available device traits:
boardController Boardcontroller configuration
broken Indicates a broken device
devkit Device is a Nordic Semiconductor development kit
jlink J-Link probes
mcuBoot Device supports MCUboot
modem Device supports modem
nordicDfu Nordic USB devices with DFU trigger interface
nordicUsb USB devices (with VendorID 0x1915)
seggerUsb Segger USB devices (with VendorID 0x1366)
serialPorts Device has serialports
usb USB devices

nrfutil device uses plugins to enumerate devices and apply device operations. The --traits option activates only the plugins that control the specified traits. Some trait combinations in --traits might therefore make some operations or trait annotations unavailable for devices that should have supported these operations or traits.
--remote-jlink ARG Select one or more remote J-Link probes: --remote-jlink HOST_1[:PORT_1],HOST_2[:PORT_2],..,HOST_n[:PORT_n]

For more information about how to set up a J-Link Remote Server, see https://kb.segger.com/J-Link_Remote_Server.

The connection information passed in this flag is used to connect to the J-Link Remote Server instance, and the remote probe is then treated in the same way as a locally connected device.
--family ARG Set the expected device family for the automatic device detection

The operation will fail if the expected device family does not match the device family of the connected device.
--x-force-device ARG (Experimental) Provide device name to override automatic device identification

The command uses the provided device name to look up the corresponding device in the internal database. If found, the latest known hardware revision is selected. The option is case-insensitive. Compared to when it is not used, the option ignores hardware registers used to identify the device.

The device name is for example nRF54L15. Use the nrfutil device device-info command to list the device name of your connected device.

CAUTION: Make sure that the device identification override matches the connected device. If there is a mismatch (for example forcing nRF5340 identification for the nRF9160 SiP), you are risking bricking the device.
--x-sdfw-variant ARG Select the Secure Domain Firmware (SDFW) variant that is running on the device

If not specified, the tool assumes that the IronSide Secure Enclave firmware is running on the device.
--append-batch PATH Append the operation to the given batch file instead of running it

When this option is set, the command records the operation as JSON in the batch file and exits without performing the operation on a device. The generated batch file can then be executed on devices using nrfutil device batch-execute --batch-file <file_path>.

This flag cannot be used in combination with other device selection options, such as --serial-number, --traits, or --remote-jlink.
--generate -g - Show the JSON definition of the operation.
--help -h - Print help (see a summary with '-h')