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

  • 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).

  • Hi Hung, We will have a boot loader to choose different application addresses accordingly. The same binary could be loaded to and run from 2 different addresses. I'm not sure how we can tweak the linker script to achieve this. (There's application vector table contains fixed address.) Can you please explain more on the last comment?

    Thank you, Min-Ching

  • 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().

Related