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

ping pong in between 2 application base addresses

Hi, I would like to use ping pong mechanism to prevent faulty application update on nRF52840. Is there a way to build a single image to run at 2 different addresses? How should we tweak the linker file?

Thank you, Min-Ching

Parents
  • Hi Min-Ching,

    Could you elaborate a little bit more about the ping pong mechanism ?

    Do you plan to have a bootloader which can choose which application will be executed ?

    In our current implementation, the softdevice will only forward the vector table to the first address right after the softdevice (if there isn't a bootloader).

  • If you going to have the bootloader ( I assume you will use softdevice) what you can do is to create an application image combine of 2 same binaries at different addresses. You can generate the binaries separately. Just modify the start address in the linker file. Then you use mergehex to merge the 2 images.

    When you receive the merged image, the bootloader will simply update the flash with the big image. Then in your bootloader you will have a logic (your ping pong mechanism) to choose which address the bootloader should forward the vector table to (MAIN_APPLICATION_START_ADDR). The call nrf_bootloader_app_start() to jump to application is executed in nrf_dfu_init() and in main().

Reply
  • If you going to have the bootloader ( I assume you will use softdevice) what you can do is to create an application image combine of 2 same binaries at different addresses. You can generate the binaries separately. Just modify the start address in the linker file. Then you use mergehex to merge the 2 images.

    When you receive the merged image, the bootloader will simply update the flash with the big image. Then in your bootloader you will have a logic (your ping pong mechanism) to choose which address the bootloader should forward the vector table to (MAIN_APPLICATION_START_ADDR). The call nrf_bootloader_app_start() to jump to application is executed in nrf_dfu_init() and in main().

Children
No Data
Related