External Flash (SPI) - MCUBoot - OTA

I have been able to set up external flash for MCUBoot for FOTA.

But after rebooting, the image is the same than before the image upgrade.

I used a sniffer so i could see SPI transmission with external flash during the process but all i can see is writing the new image to the flash, not reading it when swapping.

That's how my partitions are built

And here is my mcuboot.conf in child_image folder

  • Hi,

     

    Is your partition layout equal on original image vs. the updated .bin file?

    You can ensure that this happens if you take the original_project/build/partitions.yml and copy this to the updated_project/pm_static.yml, and then build the "updated_project".

     

    And here is my mcuboot.conf in child_image folder

    Have you setup the mcuboot overlay for your external flash?

    That should be located in child_image/mcuboot/boards/($MY_BOARD).overlay.

    Note that it must be the secure board, for instance nrf9160dk_nrf9160.overlay, and not the _ns prefixed board.

     

    Kind regards,

    Håkon

  • Thanks for your reply,

    Actually, i don't have any pm_static_yml file since it uses dynamic partitioning. 

    Partition layout on updated and original image are the same because the updated image is exactly the same image than the old one, except that i edited a "Firmware Version" ressource for lwm2m

    I just added the mcuboot overlay but it's not working yet.

  • Hi,

     

    MehdiChelouah said:
    Actually, i don't have any pm_static_yml file since it uses dynamic partitioning. 

    You should use a pm_static.yml file, to ensure that all updated builds have the exact same partition layout.

    This is done by copying my_project/build/partitions.yml to my_project/pm_static.yml.

     

    MehdiChelouah said:
    Partition layout on updated and original image are the same because the updated image is exactly the same image than the old one, except that i edited a "Firmware Version" ressource for lwm2m

    You must have defined the &spiX in the overlay for the mcuboot (can be in the main board file as well) to ensure that it picks up the external flash.

    The print outs indicates that your logic is done in the application space. Can you share how you handle this after a successful download?

     

    Kind regards,

    Håkon

  • Can you share how you handle this after a successful download?

    It's more or less from lwm2m_firmware.c from nrf/subsys

    Also, i marked as comment the log info of counter value.

    That's what i get now -->

    Also, it still doesn't work after i added pm_static.yaml file into my project 

  • How does the DT overlay for your mcuboot project look?

    This file can be found in build/mcuboot/zephyr/zephyr.dts.

    This should be fairly equal to the application dts, which is located in build/zephyr/zephyr.dts.

     

    Could you attach both of these?

     

    Kind regards,

    Håkon

Related