This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion



I have a JLink script which sets APPROTECT in the UICR to enable readback protection and disable the debug interface.

For development purposes, I would like to be able to clear these. The process seems to be to write certain values to the CTRL-AP registers. However, I cannot find the base memory address for the DAP or CTRL-AP registers anywhere in the nRF52832 1. 0 data sheet. Does anyone know the base address for this register set? If not part of the memory space register, how would I command JLink to write data to the appropriate place to erase the chip after read back protection has been enabled?



  • Hi Eric!

    Did you find a solution for your problem? I get the same ERROR when trying to erase the chip with the JLink Commander.

  • In our factory programming script, we do the following with via JLink:

    //Clear App Protect and Erase All
    SWDSelect //Selects the SWD Interface
    SWDWriteDP 1 0x50000000 //Enables power
    SWDWriteDP 2 0x01000000 //Selects the 0x01XXXXXX Access Port and 0xXXXX00XX Register bank in the access port
    SWDWriteAP 1 0x00000001 //CTRL-AP Bank 0, register offset 1 (ERASEALL 0x004): Erase all command
    sleep 1000 
    SWDReadAP 2 //CTRL-AP Bank 0, register offset 2 (ERASEALL 0x008): Erase all command status
    SWDReadAP 2 //Second read returns the value
    SWDWriteAP 0 0x00000001 
    SWDWriteAP 0 0x00000000 
    SWDWriteAP 1 0x00000000 
    SWDReadAP 3 //CTRL-AP Bank 0, register offset 3 (APPROTECTSTATUS 0x00C): Access port protection status
    SWDReadAP 3 //Second read returns the value: 0: enabled 1: not enabled