Jump from SoftDevice to Application A or B

We have an existing application for the NRF52840 using SDKv15. This application will handle writing a new application to a free bank.  I need to add the ability to jump from SoftDevice to the new Application (A or B).  Can I specify what address to jump to from SoftDevice?  If not, then would the SoftDevice jump to a small main application, then jump to either application A or B?

Example flash layout

- Application B

- Application A

- Soft Device

- MBR

~~~~~

Or would it go like this: Bootloader -> Softdevice->Application A or B:

- Bootloader

- Application B

- Application A

- Soft Device

- MBR

Parents
  • Hi,

    You will need a bootloader for this. The bootloader in the SDK does not support jumping to any address out of the box, but it is possible.

    The way this will work is that the MBR runs first, and then jumps to the bootloader. Then the bootloader can jump to either App 1 or App 2. (The default behavior in the bootloader in SDK version >= 15.0.0, is to jump to the SoftDevice, but then the SoftDevice will always jump to the application that is right above it.)

    See this post for details on how can be done with SDK 15.

  • Thank you for providing that example.  However, as I understand it, that suggests a custom bootloader that jumps to Application A or B.  I need to also run SoftDevice:

    ------MBR-->SoftDevice-->Application A or B.

    If SoftDevice always runs whatever is immediately after, and that is fixed, is there a way to jump to Application A or B after running SoftDevice? 

    -----MBR-->SoftDevice--"Bootloader" -->Application A or B

    Perhaps I need two SoftDevice sectors?

    -----MBR-->Bootloader--> (SoftDeviceA-->Application A) || (SoftDeviceB-->ApplicationB)

    Thank you for your guidance.

  • Softdevice only works in its specific flash location.

    Note that this also applies to any apps on Cortex-M3, at least last time I checked there was little support for position-independent code.

    One solution could be

    MBR->Bootloader->Softdevice->Stub App C deciding wether to ececute-> either A or B

  • Is there a way for the bootloader to tell the SoftDevice what address to jump to for the application?

    See Bootloader Documentation

    The bootloader is responsible for determining the start address of the application. It uses sd_softdevice_vector_table_base_set(uint32_t address) to tell the SoftDevice where the application starts.

    Did I read that wrong?  Is this to set where the bootloader jumps to (either application or SoftDevice)?

Reply Children
No Data
Related