This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to overwrite SoftDevice using a bootloader?

The documentation for the nRF51 says only code from code region 0 can execute the erase and write command on code inside code region 0. This means that my bootloader in code region 1 cannot write to code region 0 (region 0 containing SoftDevice)

Is there any way around this that is safe?

One way I can think of is to copy code to RAM that does a full chip erase instead, but if power is lost during this, then the bootloader is permanently lost as well, so this is not safe.

Another way I can think of is to append a second bootloader into code region 0 itself by manually appending my bootloader's hex into the s110 hex, making sure that CLENR0 is modified accordingly. However I don't know if this will cause all of the interrupt vectors to malfunction. If SoftDevice uses absolute addresses for user application interrupt vectors, then everything will break because then the bootloader's vector will be called instead of the user application's vectors.

Related