meta data for this page
  •  

This is an old revision of the document!


APPROTECT

what is APPROTECT

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:

https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/working-with-the-nrf52-series-improved-approtect

recover

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:

  • due to [249] APPROTECT is enabled by default after startup
    • application needs to switch off APPROTECT - it is automatically performed in NRF's startup code.
    • so if flashing is interrupted due to SWD errors (speed to high) MCU will be protected.
  • I suspect nrfjprog is not adapted to latest changes. Usage of –chiperase and –verify cause problems. Intermediate reset between phases (→ APPROTECT enable) ?

bypass APPROTECT