Hi all, is there any method to disable SWD in a way that every operation through SWD is blocked? Do the MPU also blocks for reprogram the binary through SWD (maybe disabling debug mode forever)?
Thanks, Davide
Hi all, is there any method to disable SWD in a way that every operation through SWD is blocked? Do the MPU also blocks for reprogram the binary through SWD (maybe disabling debug mode forever)?
Thanks, Davide
Can't answer for nRF51, although of course other M0 chips have true SWD perm lockouts. I know the flaw you are referencing, and I'm not sure if Nordic ever addressed it. I'm not sure but I doubt the nRF52 being on a more advanced M4 core has the same issue, I haven't looked yet.
So whatever answer you get, I'd be interested in the same was true for the nRF52.
Please refer to the nRF51 product specification Chapter 9.1 to see how the MPU works:
Protect all (PALL) is configured by writing '0' to UICR.RBPCONF.PALL. When protect all is enabled, the debugger (SWD) will no longer have access to code region 0, code region 1, RAM or any peripherals except for the following:
Note that the behavior is changed in the nRF52 where the access port is either disabled (0xFF) or enabled (0x00): Access port protection can only be disabled by issuing an ERASEALL command via CTRL-AP. This command will erase the Flash, UICR, and RAM.
Thanks. And (at least on nRF51), since NVMC is enabled, is it possible to issue an ERASEALL and erase all the flash? Making it possible to reprogram all the chip with own firmware?
Yes, it is possible to erase everything to program the chip with your own firmware.
Thanks. Davide.