nrf9160 always recovers when updating applications

Hello,

I used two samples, application_update and SLM, to test and try updating the app from application_update to SLM. I first downloaded the firmware of application_update v1 version to 9160, and the LED 1 on 9160dk lit up to indicate that the v1 version was being used. Then, I renamed the bin file of SLM to app_2RF9160dk_2.50_v2. bin and uploaded it to the server. Next, I pressed the button 1, 9160dk to download the v2 firmware normally (but in reality, it was SLM). After downloading, I pressed the button 1 again to update the app to SLM, 9160dk also successfully ran SLM,but after restarting, the bootloader restored the firmware to application_update, even though I had already called boot_writd_img_confirmed in the main function of SLM. I also try to call boot_is_img_confirmed in the main function of slm to check whether the firmware is confirmed. The return value is 0, indicating that it is normal.

When I tested with application_update, everything was fine. 9160 can switch between v1 and v2 versions without automatically restoring to the previous version, but replacing v2's bin with SLM is not possible. I don't know which step I overlooked or made wrong?

Thank you.

Parents
  • The SLM-application is most likely built with a different partition table, as I assume you're not using same pm_static.yml (at least for the relevant parts).



    Updating the application does not update the bootloader, so the bootloader in your DK is built with the partitions defined in your application_update build. This defines which address the bootloader will check when determining whether to revert the image or not.
    Now, your SLM build probably has a different partition table, so when you call boot_writd_img_confirmed() it writes to a different address, defined by your partition table in that build.

Reply
  • The SLM-application is most likely built with a different partition table, as I assume you're not using same pm_static.yml (at least for the relevant parts).



    Updating the application does not update the bootloader, so the bootloader in your DK is built with the partitions defined in your application_update build. This defines which address the bootloader will check when determining whether to revert the image or not.
    Now, your SLM build probably has a different partition table, so when you call boot_writd_img_confirmed() it writes to a different address, defined by your partition table in that build.

Children
Related