Skip to content

JTAG/SWD locking nrf52840 #1215

Answered by flit
lawrencek52 asked this question in Q&A
Sep 21, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Hi @lawrencek52, to lock an nRF52 you need to program the APPROTECT field of the UICR region of flash. In nRF52840_PS_v1.2.pdf this is §4.5.1.5 on page 44.

To do this with pyocd:

  1. Create a 0x400 byte (1 KiB) binary file containing all 0xFF bytes.
  2. Set the byte at offset 0x208 to 0x00. This changes the PALL field of APPROTECT to enable debug port protection.
  3. Use pyocd to load this binary file to base address 0x10001000, the start of UICR: pyocd load -a 0x10001000 my_uicr.bin.
  4. After resetting the device (not sure if a cold reset is required), you should no longer be able to connect to the device without getting a "No cores found" warning.

Please note that I haven't tried locking an nRF52 my…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lawrencek52
Comment options

Answer selected by lawrencek52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants