Checking if access port protection is enabled (APPROTECT)

The CTRL-AP - Control Access Port is a custom access port that enables control of the device even if the other access ports in the DAP are being disabled by access port protection.

If access port protection has been enabled in the APPROTECT register (0x10001208) of the UICR, the debugger's read/write access to all CPU registers and memory mapped addresses is blocked.

For more information about CTRL-AP, see section CTRL-AP - Control Access Port in the nRF52832 Product Specification.

Using the standard SWD Arm® CoreSight™ DAP protocol:

  1. Select/connect to the control access port.
    This access port is at index 0x01.
  2. Read the APPROTECTSTATUS register (0x00C) of the CTRL-AP.
    If the least significant bit of this register is ‘0’, access port protection is enabled. Go to Erasing all through CTRL-AP.
    If the least significant bit of this register is ‘1’, access port protection is not enabled. Go to Halting CPU.