I was trying to reflash UICR for the first time on an nrf52840_dongle using nrfjprog. Here is what I tried:
$ nrfjprog --eraseuicr --program /tmp/new-uicr.hex
ERROR: Two arguments were provided that cannot be combined. Use --help to read
ERROR: about the valid argument combinations.
NOTE: For additional output, try running again with logging enabled (--log).
NOTE: Any generated log error messages will be displayed.
$ nrfjprog --eraseuicr
Erasing UICR flash area.
Applying system reset.
`nrfjprog --help` doesn't tell the user that --eraseuicr will reset the chip. This is dangerous behavior, because if UICR.REGOUT0 is cleared back to 1.8V, many common debuggers (which do not have a level shifter) will be unable to communicate with the board. Nordic documentation explicitly warns against resetting the chip after erasing UICR: https://devzone.nordicsemi.com/guides/short-range-guides/b/getting-started/posts/nrf52840-dongle-programming-tutorial
I found that the correct incantation is:
$ nrfjprog --sectoranduicrerase --program /tmp/new-uicr.hex --verify
I would suggest either changing nrfjprog so that --eraseuicr skips the reset, or at least updating the --help page to indicate that it performs a reset and this may cause the chip to come back up using a lower I/O voltage.