JTAG/SWD locking nrf52840 #1215
-
The documentation in https://github.com/pyocd/pyOCD/blob/main/docs/security.md does a great job of describing how to unlock a chip if it is locked (although it seems a little out of date, some of the sample commands returned errors). But security.md fails to describe how to lock a chip if it is unlocked. Can someone help me discover the correct incantation to lock a chip please? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @lawrencek52, to lock an nRF52 you need to program the To do this with pyocd:
Please note that I haven't tried locking an nRF52 myself, I've only tested writing to the UICR. (Thanks for mentioning the command errors in the security docs.) |
Beta Was this translation helpful? Give feedback.
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:
PALL
field ofAPPROTECT
to enable debug port protection.pyocd load -a 0x10001000 my_uicr.bin
.Please note that I haven't tried locking an nRF52 my…