How to disable ERASEPROTECT for nRF9160?

Hi,

The memory space of the application core for nRF9160 is empty.

Now,if I set the ERASEPROTCET register located in the UICR to 0( Erase protect will be enabled.), how do I remove it?

According to the nRF9160 Product Specification v2.0,I need to provide a key in the ERASEPROTECT.DISABLE register in order to relieve ERASEPROTECT.

But I don't understand how this is done.

Please tell me the detailed steps.

Thanks for your great support!

Parents
  • Hi,

    This requires your application to write to the register ERASEPROTECT.DISABLE (0x50006504 see section 9.8.6 in nRF91 spec v2.1)  a 32bit non-zero value. And then in your debugger access you also write to the ERASEPROTECT.DISABLE (0x01C see section 9.8.5 in the spec ) same 32bit value. 

    If you haven't programmed anything on the app core it will not be possible to recover.

    Here is an related case that discussed this register that you may want to have a look. 

Reply
  • Hi,

    This requires your application to write to the register ERASEPROTECT.DISABLE (0x50006504 see section 9.8.6 in nRF91 spec v2.1)  a 32bit non-zero value. And then in your debugger access you also write to the ERASEPROTECT.DISABLE (0x01C see section 9.8.5 in the spec ) same 32bit value. 

    If you haven't programmed anything on the app core it will not be possible to recover.

    Here is an related case that discussed this register that you may want to have a look. 

Children
  • Can I assume that if I turn on erase protection for a chip without program (only ERASEPROTECT is enabled, APPROTECT and SECUREAPPROTECT are disable), then the chip will be locked and cannot be reprogrammed?

    At this point, I use "SWD" to write the same 32-bit value into the ERASEPROTECT.DISABLE register (address 0x50006504) and the ERASEPROTECT.DISABLE register in CTRL-AP, can I unlock the chip?

  • Hi,

    My mistake, the following information is not true

    Hung Bui said:

    If you haven't programmed anything on the app core it will not be possible to recover.

    The ERASEPROTECT register only disable the ERASEALL command. It's still possible to write to the application core some code that write to the ERASEPROTECT.DISABLE to recover, as long as you haven't turned on APPROTECT and SECUREAPPROTECT . 

    So you also right that if you haven't locked the SWD interface using APPROTECT/SECUREAPPROTECT you can use SWD to write to the register to unlock ERASEPROTECT.DISABLE.

    Could you let me know why you want to only lock the ERASEALL feature but not locking the debugger ? 

  • Thank you for your help. These answers solve a big problem I had when writing the program.

    Answer to your question: I want to make a programmer for myself that can program nRF9160. There are situations where I need to operate the UICR register, so I need to understand what kind of operation is safe (won't lock the chip).

    Thanks again for your help!

Related