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

Switching between apps with dual bank

Hi,

let's say I program flash with SD, Booloader and merged App1&Ap2 images. I need to switch application (only once, after some self tests) using some command from application.

What would be the best way to do it?

Preferably the App2 image is copied over App1, but if not - that's also acceptable. In both cases DFU must be working after switch.

thanks

Parents
  • I have made an example for the nRF51 DK, where Application 1(blinky) turns on led 1 and 2, waits for 5 seconds and then branches to Application 2(blinky_2), which turns on led 3 and 4.

    Application 1 starts at 0x18000 and ends at 0x19000 and Application 2 starts at 0x19000 and ends at 0x40000.

    The two Keil projects are attached. Please note that this is for SDK v9.0, but it should be easy to migrate it to SDK v11. Unpack the zips to SDK-folder/examples/peripheral.

    Attachments:

    blinky.zip

    blinky_2.zip

  • Bjoern, I must say I can only trust that it works. We have a full blown app with SD and secure bootloader, preserved data app etc. Doing it this way (assembler?!) would be highly inconvienient if the rest of the code relays strictly on SDK(+HK) functionalities. Is there really no way to merge two apps and use bootloader settings to start with one and switch from to another? I can imagine mixing of direct flash access and booloader API, but assembler in the way you suggest just won't work in longer perspective. Thanks anyway.

Reply
  • Bjoern, I must say I can only trust that it works. We have a full blown app with SD and secure bootloader, preserved data app etc. Doing it this way (assembler?!) would be highly inconvienient if the rest of the code relays strictly on SDK(+HK) functionalities. Is there really no way to merge two apps and use bootloader settings to start with one and switch from to another? I can imagine mixing of direct flash access and booloader API, but assembler in the way you suggest just won't work in longer perspective. Thanks anyway.

Children
No Data
Related