Full name: Erase all (ERASEALL) and destructive debug recovery.
Definition
ERASEALL is the operation, named after the register that starts it, that erases all user-changeable flash memory §6.6 of a Nordic nRF52 chip at once, including the UICR (User Information Configuration Registers) §16.1 settings. Destructive debug recovery uses it to regain debug access to a chip whose access port protection §16.4 locks out the debugger: the debugger starts it through a control port that protection never closes, and the chip wipes flash, UICR and RAM before letting the debugger in. Factory data in FICR (Factory Information Configuration Registers) §16.2 survives.
The idea
A chip with access port protection must still be reusable: a production line may need to reprogram it, and a chip whose firmware fails must be repairable. A recovery route that let the debugger in with the contents intact would be a readout route for any attacker. A destructive route solves this: whoever uses it gets the hardware back, empty.
The price is that recovery ends the device’s history. A reset restarts the same device with the same keys and records. A firmware update replaces code and leaves data. A recovery erase removes the keys, the counters, the version high-water mark §8.27 (the highest firmware version accepted so far), the stored Bluetooth pairings and the settings. What comes back is new hardware under an old name, because FICR still holds the same device identifier and Bluetooth device address §7.30. A phone restored to factory settings is a fair picture: same serial number, nothing of its owner. The picture stops at copies: backups and servers that hold the owner’s data are untouched when one device is wiped.
How it works
Nordic nRF52 chips have two erase-all operations.
NVMC.ERASEALL, started by firmware through the NVMC (Non-Volatile Memory Controller) §16.3, the circuit that writes and erases flash, after the firmware has switched the controller to erase mode. It erases all flash pages and UICR.CTRL-AP.ERASEALL, started by a debugger through the CTRL-AP (control access port), Nordic’s debug access port that stays usable when protection closes the memory access port. It erases flash, UICR and RAM.
Destructive debug recovery takes these steps.
The debug probe connects to the chip’s SWD §6.25 (Serial Wire Debug) pins and selects the CTRL-AP.
It writes 1 to the CTRL-AP register
ERASEALL.The chip erases all flash, UICR and RAM. The probe reads
ERASEALLSTATUSuntil the erase has finished.The probe reads
APPROTECTSTATUSto confirm that protection is lifted; Nordic’s documentation advises repeating the erase if it is not.The memory access port is now open. On older revisions it stays open, because erased UICR means protection disabled. On revision 3 of the nRF52840 §6.4 it stays open only until the next pin reset, power-on reset §6.17 or brownout reset, so the programming tool writes new firmware and UICR settings in that window.
The chip starts as a new device: firmware without keys, default settings, empty records. Making it trusted again needs fresh key provisioning §5.28: installing keys and records as for a new device.
Two things survive the erase.
FICR: the device identifier, the Bluetooth device address, and the 128-bit values that Nordic names encryption root and identity root.
Everything outside the chip: an external flash chip on the same board, the maker’s provisioning records, servers that know the device’s key, phones that stored a pairing with the device, and backup copies.
Three operations that a maintainer may reach for differ in what they keep.
A reset of any kind keeps flash and UICR; RAM content is not guaranteed.
Reprogramming that erases only the pages a new image covers keeps UICR and every page outside the image.
Erase-all keeps only FICR and what lies outside the chip.
Worked example
A device refuses any firmware update whose version number is below its version high-water mark, the highest version it has committed to, kept in flash. The mark stands at 8. Version 7, signed by the maker, has a known security hole, and an attacker has recorded its signed update package.
A maintainer recovers the device with the CTRL-AP erase-all and provisions it again. The provisioning station writes the same device key as before, which its database still holds, and current firmware. Nobody restores the mark, so it starts at its default of 0. Before recovery the device accepted versions ; now it accepts . Versions 0 to 7, which is versions, are acceptable again. The attacker sends the recorded version-7 package, the device installs it, and because the key is the old one, servers treat the device as the old, trusted device. No signature was forged: resetting the state enlarged what the device accepts.
Either of two repairs prevents this. Re-provisioning restores the mark, here 8, from a record kept off the chip. Or the mark lives where the erase cannot reach it, such as one-time programmable memory on chips that have it, or a monotonic counter §8.28, a counter that can only increase, in a separate secure element §5.38, a chip built to guard keys and counters.
Stated precisely
Write the chip’s state as four parts: , the flash content; , the UICR content; , the RAM content; and , the FICR content. The CTRL-AP erase-all sets every bit of and to 1, erases , and leaves unchanged. The NVMC erase-all does the same to and only. Every record kept in or returns to its default value.
For a version check that accepts exactly when , with the stored high-water mark, recovery replaces the accepted set by , where is the default; with , every version is accepted. An operation preserves credentials only if its erase set, the set of addresses it can erase, excludes every address that holds a credential or a freshness record. The erase-all excludes none of them.
These statements assume that the erase runs to completion, which Nordic advises confirming through APPROTECTSTATUS, and that the product specification of the chip revision in use lists what the erase covers.
Limits and common mistakes
Erasing is not revoking. The erased key still exists in the provisioning database, on servers and in every peer that stored it. When a device leaves its owner’s control, retiring its key needs key revocation §5.32 at those parties, which tells them to stop accepting the key. Destroying the chip’s copy is secret zeroization §5.37, the deliberate erasure of a secret, of one copy only.
The identity survives and the trust does not. A recovered chip presents the same identifier and Bluetooth device address. A server or phone that recognizes the device by identifier alone will take a blank or attacker-programmed chip for the old one; recognition must rest on a key.
Anyone with the debug pins can run the recovery erase; it needs no secret. The threat model §1.2, the written list of what an attacker can do, must include an attacker who wipes the device and installs their own firmware.
Some newer Nordic chips, such as the nRF5340, add erase protection, which also blocks the debugger’s erase-all. Recovery then needs the cooperation of the running firmware.
An erase command is not proof against laboratory recovery. NIST Special Publication 800-88, the United States guideline on media sanitization, distinguishes three methods: clear, purge, which makes recovery infeasible even with state-of-the-art laboratory techniques, and destroy. Whether one chip’s erase reaches the purge level must be shown for that chip, not assumed from the register’s name.
If power fails during the erase, repeat the erase before trusting the chip’s state.
A reset is not a recovery. Watchdog §6.16, pin and software resets keep flash and UICR; only the erase operations destroy them.
Questions answered
How does recovery differ from a credential-preserving reset or reprogramming operation?
Destructive recovery erases the device’s state, while a credential-preserving reset or reprogramming operation keeps it. A reset of any kind, whether pin, watchdog, software or power-on, restarts the same firmware with flash and the UICR (User Information Configuration Registers) settings untouched, so keys, counters, version high-water marks and settings carry on. Credential-preserving reprogramming erases and rewrites only the flash pages that hold code, so the pages and UICR words that hold credentials and freshness records survive. Recovery through the erase-all command of a Nordic nRF52 chip wipes all flash, UICR and RAM before the debugger regains access. Only the factory data in FICR (Factory Information Configuration Registers) survives, so the chip keeps its identifier and Bluetooth address but loses every key and record.
Three consequences follow. Recovery needs no authorization §1.7, because it reveals nothing. Afterwards the device must be provisioned again as a new device, with new keys or with its freshness records restored, because restoring the old key with default records can make superseded messages and updates acceptable again. And the erased key still exists wherever else it was stored, so retiring it needs revocation at those parties.
Related entries: FICR (Factory Information Configuration Registers) (§16.2), Credential-preserving programming (§16.7), Key revocation (§5.32), Secret zeroization (§5.37), Rollback versus anti-rollback (§8.26), Version high-water mark (§8.27), APPROTECT and debug access protection (§16.4), Lifecycle reset and replay across complete reinitialization (§19.3.7). Further reading: [56, 57, 150].