This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to Close SWD

Hi there, We are developing bluetooth bracelet using 51xx and 52xx Bluetooth chip and the hard hardware part has been done.However, for safety considerations,we need to disable SWD after the program is downloaded. We want to disable SWD by sending a command through bluetooth communication. If that doesn't work, Do you have any other way to do it,For example, By controlling registers or interrupts associated with SWD to implement the control of SWD.

Any help would be greatly appreciated!

  • You can disable debugger by enabling read-back protection in UICR by writing to APPROTECT register. This can be indeed done from within the FW any time so you can define your way how to trigger it over BLE. Note that this is one-time action, on nRF51 there is similar register but with different name (RBPCONF) and address in UICR space. Also note that due to bug/design limitation this protection isn't really effective on nRF51 family.

Related