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

Stuck after FOTA nrf9160 application from sdk 1.2.0 to sdk 1.3.0

Hi,

Our device ( nrf9160) is running application ( non secur) built with sdk 1.2.0 (toolchain v4.42) , we've updated it using FOTA download to  the application built with sdk 1.3.0 ( with latest toolchain v4.52), but after downloading, it reboots and is stuct at [00:00:20.506,347] <inf> mcuboot: Jumping to the first image slot, If I reset power, our device stil runs with old application normally.

....
[00:04:17.007,171] <inf> download_client: Download complete
[00:04:17.020,111] <inf> fota_flash_block: Erasing sector at offset 0x000ff000
[00:04:17.115,997] <inf> dfu_target_mcuboot: MCUBoot image upgrade scheduled. Reset the device to apply

*** Booting Zephyr OS build v2.1.99-ncs1  ***
[00:00:00.004,028] <inf> mcuboot: Starting bootloader
[00:00:00.010,284] <inf> mcuboot: Primary image: magic=good, swap_type=0x2, copy_done=0x1, image_ok=0x1
[00:00:00.020,324] <inf> mcuboot: Boot source: none
[00:00:00.025,817] <inf> mcuboot: Swap type: test
*** Booting Zephyr OS build v2.1.99-ncs1  ***
[00:00:00.004,608] <inf> mcuboot: Starting bootloader
[00:00:00.012,695] <inf> mcuboot: Primary image: magic=good, swap_type=0x2, copy_done=0x3, image_ok=0x3
[00:00:00.025,665] <inf> mcuboot: Boot source: primary slot
[00:00:22.990,783] <inf> mcuboot: Bootloader chainload address offset: 0xc000
[00:00:22.998,474] <inf> mcuboot: Jumping to the first image slot

Pls help to fix this issue.

Thanks

Viet Nguyen

  • Hi

    When building your project, a script runs, which places all images into the flash at fitting places. The bootloader is then given that map of the flash and uses it to know where to jump to. Likewise, the application uses the partition map to know where to store update images, and where to write to the bootloader that the image is OK. 

    So, it's important that the image you update has the same partition map as the image you upgrade from and as the bootloader. However. as the partition map is generated for each build, there might be changes between two versions. So you'll have to extract the partition map from the build that is flashed onto the device so that the same map can be used in later builds.

    This can be done by copying the partitions.yml file into the project folder and renaming it to pm_static.yml.

    _________________________________________________________________________________________

    To check if the problem is with the image or the FOTA process, could you do the following test:

    1. Flash the program as normal.

    2. In a command line, navigate to the build folder and run the following commands (This will write the update image to the secondary_image sot in Flash):

    cd zephyr
    nrfjprog --program app_moved_test_update.hex

    3. Reset the device.

    You should now see the MCUBoot trying to update the firmware.

    Best regards,

    Simon

Related