Access port protection mechanism (AP-Protect). When enabled, this mechanism blocks the debugger from read and write access to all CPU registers and memory-mapped addresses. Accessing these registers and addresses again requires disabling the mechanism and erasing the flash.
Due to easiness of bypass of APPROTECT by power glitching latest revisions of chips contains extended implementation: to disable it it has to be disabled by “HW” (UICR
) and software APPROTECT.DISABLE
. See details:
Sometimes flashing of NRF chip fails without reason. Next flash fails also because device is locked and recover
is needed.
This means that chip flash is protected and cannot be read or written. Removing of protection is needed.
Summary:
3rdParty/nrf5-sdk/modules/nrfx/mdk/system_nrf52.c
nrfjprog
is not adapted to latest changes. Usage of –chiperase
and –verify
cause problems. Intermediate reset between phases (→ APPROTECT enable) …UICR.APPROTECT
to HwDisabled
and programs a small piece of firmware to the flash to ensure that the device continues to unlock itself at reset.”