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.

  • Hi Frank,

    The solution to copy the code to RAM and do an ERASEALL may work, but as you mentioned it's not safe. Adding another bootloader on top of the softdevice will introduce unwanted interrupt latency, and may cause the softdevice to be malfunctioned.

    Actually, in the next version of the softdevice, v7.0, there will be an added feature to update the softdevice. S110 v7.0 will be released very soon, I would say in a few weeks time.

    I would suggest you to wait for this release.

  • Did the ability to update the S110 ever get released? I can't find anything saying that this functionality exists. Also, what about the S120? Can we overwrite the S120 with the bootloader?

  • Hi Jo-Jo, Yes, the softdevice update feature is available on S110 v7.0. Please have a look at section 9.1 in the S110 Specification v1.3 An experimental DFU example is provided in the SDK v6.0, the documentation could be found here: devzone.nordicsemi.com/.../a00067.html

Related