How to disable JLINK port?

Dear,

We want to disable the JLINK port.   I read a couple of threads related to this question but couldn't find the specific answer we are looking for.

Please let us know how to disable the JLINK port.

Also, can you please review what we tested?

1) If NRF_UICR->APPROTECT = 0x00;, it looked that all UART and JLINK port are disabled.  Is it expected?

2) If we apply the code below, it looked that JLINK port was disabled but UART was still active.  Is it expected?

        /* Prevent processor from unlocking APPROTECT soft branch after this point. */
        NRF_CTRLAP_S->APPROTECT.LOCK = 0;
        /* Prevent processor from unlocking SECURE APPROTECT soft branch after this point. */
        NRF_CTRLAP_S->SECUREAPPROTECT.LOCK = 0;

        NRF_CTRLAP_S->APPROTECT.DISABLE = 0;
        NRF_CTRLAP_S->SECUREAPPROTECT.DISABLE = 0;

        /* Prevent processor from unlocking APPROTECT soft branch after this point. */
        NRF_CTRLAP_S->APPROTECT.LOCK = 1;
        /* Prevent processor from unlocking SECURE APPROTECT soft branch after this point. */
        NRF_CTRLAP_S->SECUREAPPROTECT.LOCK = 1;

Parents
  • Hi,

    1)
    NRF_UICR->APPROTECT = 0x00
    Access Port Protection (APPROTECT) is used to block debugger's read/write access to all memory-mapped and CPU addresses. When you set the value of APPROTECT to 0x00, debugger's read/write access is not allowed.
    Regarding UART, you may not have enabled UART logging or you may have removed uart from your device tree configuration.

    2)
    NRF_CTRLAP_S->APPROTECT.LOCK = 0;
    NRF_CTRLAP_S->SECUREAPPROTECT.LOCK = 0;
    Putting APPROTECT.LOCK TO 0 allows for writing to APPROTECT.DISABLE. In other words, APPROTECT.DISABLE is not locked for writing. SECUREAPPROTECT.LOCK = 0 allows writing to SECUREAPPROTECT.DISABLE register.

    NRF_CTRLAP_S->APPROTECT.DISABLE = 0;
    NRF_CTRLAP_S->SECUREAPPROTECT.DISABLE = 0;
    This will not disable APPROTECT and SECUREAPPROTECT, and not enable debug access to either non-secure or secure mode.

     NRF_CTRLAP_S->APPROTECT.LOCK = 1;
     NRF_CTRLAP_S->SECUREAPPROTECT.LOCK = 1;
    Both  APPROTECT.DISABLE and  SECUREAPPROTECT.DISABLE are locked from being written to and APPROTECT will not be disabled.

    Best regards,
    Dejan

Reply
  • Hi,

    1)
    NRF_UICR->APPROTECT = 0x00
    Access Port Protection (APPROTECT) is used to block debugger's read/write access to all memory-mapped and CPU addresses. When you set the value of APPROTECT to 0x00, debugger's read/write access is not allowed.
    Regarding UART, you may not have enabled UART logging or you may have removed uart from your device tree configuration.

    2)
    NRF_CTRLAP_S->APPROTECT.LOCK = 0;
    NRF_CTRLAP_S->SECUREAPPROTECT.LOCK = 0;
    Putting APPROTECT.LOCK TO 0 allows for writing to APPROTECT.DISABLE. In other words, APPROTECT.DISABLE is not locked for writing. SECUREAPPROTECT.LOCK = 0 allows writing to SECUREAPPROTECT.DISABLE register.

    NRF_CTRLAP_S->APPROTECT.DISABLE = 0;
    NRF_CTRLAP_S->SECUREAPPROTECT.DISABLE = 0;
    This will not disable APPROTECT and SECUREAPPROTECT, and not enable debug access to either non-secure or secure mode.

     NRF_CTRLAP_S->APPROTECT.LOCK = 1;
     NRF_CTRLAP_S->SECUREAPPROTECT.LOCK = 1;
    Both  APPROTECT.DISABLE and  SECUREAPPROTECT.DISABLE are locked from being written to and APPROTECT will not be disabled.

    Best regards,
    Dejan

Children
No Data
Related