Access port protection

nRF54LM20A | nRF54LM20B Datasheet

The access ports can be protected to secure the internal assets and resources of the device. While the control access port (CTRL-AP) is always accessible from an external debugger, the system applies various protection mechanisms to control and restrict access to the individual AHB access ports. These mechanisms ensure both secure and non-secure access can be selectively managed and protected.

Protection is controlled by specific registers, which enable or disable debug access at different levels. These registers are part of UICR and TAMPC. The access port is normally protected. The hardware and software configurations of these registers control the access protection policies as shown in the following table.

Table 2. Non-secure Arm Cortex-M33 AHB-AP debug access
Registers Description
UICR.APPROTECT

Hardware control of non-secure debug access. A device reset is required for this configuration to take effect.

Unprotected – CPU controls DBGEN/NIDEN, locks disabled.

Other values – DBGEN/NIDEN disabled and locked.

TAMPC.PROTECT.DOMAIN[0].DBGEN

TAMPC.PROTECT.DOMAIN[0].NIDEN

CPU control of non-secure debug access. The registers can be locked.
Table 3. Secure Arm Cortex-M33 AHB-AP debug access
Registers Description
UICR.SECUREAPPROTECT

Hardware control of secure debug access. A device reset is required for this configuration to take effect.

Unprotected – CPU controls SPIDEN/SPNIDEN, locks disabled.

Other values – SPIDEN/SPNIDEN disabled and locked.

TAMPC.PROTECT.DOMAIN[0].SPIDEN

TAMPC.PROTECT.DOMAIN[0].SPNIDEN

CPU control of secure debug access. The registers can be locked.

Non-secure invasive debug access must be enabled for secure debug access to be enabled.

Table 4. VPR AUX-AP debug access
Registers Description
UICR.AUXAPPROTECT

Hardware control of AUX-AP debug access. A device reset is required for this configuration to take effect.

Unprotected – CPU controls AUX-AP DBGEN, lock disabled.

Other values – AUX-AP DBGEN disabled and locked.

TAMPC.PROTECT.AP[0].DBGEN Software control of AUX-AP debug access. The registers can be locked.
The access port protection is illustrated in the following figures.
Figure 2. AUX access port protection overview
Page-1 Nordic Blue.37 UICR.AUXAPPROTECT UICR.AUXAPPROTECT Nordic Blue.38 TAMPC.PROTECT.AP[0].DBGEN TAMPC.PROTECT.AP[0].DBGEN Dynamic connector.41 Nordic Blue.80 DAP DAP Dynamic connector.82 Dynamic connector.83 Dynamic connector.86 Dynamic connector.87 Dynamic connector.88 Nordic Blue.89 AUX AHB-AP AUXAHB-AP Dynamic connector.91 DBGEN DBGEN Nordic Blue.183 DAP DAP
Figure 3. Arm Cortex-M33 AHB-AP access port protection overview
Arm
Table 5. Erase protection
Registers Description

UICR.APPROTECT

UICR.SECUREAPPROTECT

Hardware control of RRAMC ERASEALL protection in addition to access ports. A device reset is required for this configuration to take effect.

Any value other than Unprotected disables RRAMC ERASEALL.

UICR.ERASEPROTECT

Hardware control of RRAMC ERASEALL and CTRL-AP ERASEALL protection. A device reset is required for this configuration to take effect.

Any value other than Unprotected disables the erase all operations.

TAMPC.PROTECT.ERASEPROTECT Software control of RRAMC ERASEALL and CTRL-AP ERASEALL protection. The register can be locked.
The ERASEALL protection is illustrated in the following figure:
Figure 4. ERASEALL protection overview
Erase all protection overview

The reset behavior of the TAMPC access port and ERASEALL protection is defined in Signal protector. On-chip software must write to the TAMPC registers before a debug access port is opened.

The access port remains open after the completion of the CTRL-AP.ERASEALL operation. CTRL-AP temporarily removes the access port protection until certain conditions are met, after which the protection will be reinstated. The AHB-AP will be protected when one of the following conditions are met:
  • Power-on reset
  • Brownout reset
  • Watchdog timer reset
  • Pin reset
The following figure shows how a device with access port protection enabled can be erased, programmed, and configured to allow debugging. The access port state is determined by operations sent from the debugger and registers written by firmware. Reset in the following figure refers to any of the conditions previously listed for AHB-AP protection. When writing to the TAMPC, the software must first disable write protection, then write the new values. For more details, see TAMPC — Tamper controller.
Figure 5. Access port unlocking
Page-1 Sheet.6 Sheet.7 CTRL-AP ERASEALL CTRL-APERASEALL Sheet.8 Program firmware Program firmware Sheet.9 Sheet.10 Access port state Access port state Sheet.14 Sheet.16 Reset Reset Sheet.17 Sheet.19 Sheet.21 Debugger Debugger Sheet.22 Closed Closed Sheet.23 Open Open Sheet.24 Closed Closed Sheet.25 Sheet.27 Sheet.28 Firmware Firmware Sheet.30 Sheet.31 Open Open Sheet.36 Write TAMPC.PROTECT.DOMAIN[0].DBGEN/SPIDEN Write TAMPC.PROTECT.DOMAIN[0].DBGEN/SPIDEN

The debugger can read the access port protection status in the core's AHB-AP, using the Arm AHB-AP Control/Status Word register (CSW), defined in the Arm CoreSight SoC-400 Technical Reference Manual. The DbgStatus field indicates that the AHB-AP can perform AHB transfers, while the SPIStatus field indicates if secure AHB transfers are permitted. For a list of all debug access ports, see Debug access port.