This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

FOTA Firmware is not kept after Reset

Hi,

Today I realized something interesting for our devices: The Update from an older Software Version build with SDK 1.6.X was on it and I updated via AWS FOTA to new version build with some changes and SDK 1.7.0 . The Update works fine and the firmware works perfect. The Image gets also confirmed via boot_write_img_confirmed();

After reset the device waits some time (like it does after the reboot after OTA) and then it starts again the old Image. I dont know how I can debug because it is always described that "boot_write_img_confirmed();" keeps the current image. 

What can be the reason for this?

Thanks and best regards

  • Hi Daniel,

    I did a quick check, there is no issue on my side when I FOTA NCS v1.6.1 to NCS v1.7.0 nrf9106/http_update/application_update sample. Just share my log with you. I added "printk("Current APP version:%d\n",CONFIG_APPLICATION_VERSION);" to make it easy to find the version change.

    *** Booting Zephyr OS build v2.6.0-rc1-ncs1  ***
    
    I: Starting bootloader
    
    I: Primary image: magic=good, swap_type=0x2, copy_done=0x1, image_ok=0x1
    
    I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
    
    I: Boot source: none
    
    I: Swap type: none
    
    I: Bootloader chainload address offset: 0x10000
    
    I: Jumping to the first image slot
    *** Booting Zephyr OS build v2.6.0-rc1-ncs1  ***
    
    Flash regions           Domain          Permissions
    
    00 03 0x00000 0x20000   Secure          rwxl
    
    04 31 0x20000 0x100000  Non-Secure      rwxl
    
    
    
    Non-secure callable region 0 placed in flash region 3 with size 32.
    
    
    
    SRAM region             Domain          Permissions
    
    00 07 0x00000 0x10000   Secure          rwxl
    
    08 31 0x10000 0x40000   Non-Secure      rwxl
    
    
    
    Peripheral              Domain          Status
    
    00 NRF_P0               Non-Secure      OK
    
    01 NRF_CLOCK            Non-Secure      OK
    
    02 NRF_RTC0             Non-Secure      OK
    
    03 NRF_RTC1             Non-Secure      OK
    
    04 NRF_NVMC             Non-Secure      OK
    
    05 NRF_UARTE1           Non-Secure      OK
    
    06 NRF_UARTE2           Secure          SKIP
    
    07 NRF_TWIM2            Non-Secure      OK
    
    08 NRF_SPIM3            Non-Secure      OK
    
    09 NRF_TIMER0           Non-Secure      OK
    
    10 NRF_TIMER1           Non-Secure      OK
    
    11 NRF_TIMER2           Non-Secure      OK
    
    12 NRF_SAADC            Non-Secure      OK
    
    13 NRF_PWM0             Non-Secure      OK
    
    14 NRF_PWM1             Non-Secure      OK
    
    15 NRF_PWM2             Non-Secure      OK
    
    16 NRF_PWM3             Non-Secure      OK
    
    17 NRF_WDT              Non-Secure      OK
    
    18 NRF_IPC              Non-Secure      OK
    
    19 NRF_VMC              Non-Secure      OK
    
    20 NRF_FPU              Non-Secure      OK
    
    21 NRF_EGU1             Non-Secure      OK
    
    22 NRF_EGU2             Non-Secure      OK
    
    23 NRF_DPPIC            Non-Secure      OK
    
    24 NRF_REGULATORS       Non-Secure      OK
    
    25 NRF_PDM              Non-Secure      OK
    
    26 NRF_I2S              Non-Secure      OK
    
    27 NRF_GPIOTE1          Non-Secure      OK
    
    
    
    SPM: NS image at 0x20200
    
    SPM: NS MSP at 0x2001ac70
    
    SPM: NS reset vector at 0x23a51
    
    SPM: prepare to jump to Non-Secure image.
    
    *** Booting Zephyr OS build v2.6.0-rc1-ncs1  ***
    
    HTTP application update sample started
    
    LTE Link Connecting ...
    
    LTE Link Connected!
    
    Press Button 1 to perform application firmware update
    
    I: Configuring socket timeout (30 s)
    
    I: Connecting to nrf9160-fota-test.s3.eu-west-1.amazonaws.com
    
    I: Downloading: app_update.bin [0]
    
    I: Downloaded 2048/167239 bytes (1%)
    
    I: Downloaded 4096/167239 bytes (2%)
    
    I: Downloaded 6144/167239 bytes (3%)
    
    I: Downloaded 8192/167239 bytes (4%)
    
    I: Downloaded 10240/167239 bytes (6%)
    
    I: Downloaded 12288/167239 bytes (7%)
    
    I: Downloaded 14336/167239 bytes (8%)
    
    I: Downloaded 16384/167239 bytes (9%)
    
    I: Downloaded 18432/167239 bytes (11%)
    
    I: Downloaded 20480/167239 bytes (12%)
    
    I: Downloaded 22528/167239 bytes (13%)
    
    I: Downloaded 24576/167239 bytes (14%)
    
    I: Downloaded 26624/167239 bytes (15%)
    
    I: Downloaded 28672/167239 bytes (17%)
    
    I: Downloaded 30720/167239 bytes (18%)
    
    I: Downloaded 32768/167239 bytes (19%)
    
    I: Downloaded 34816/167239 bytes (20%)
    
    I: Downloaded 36864/167239 bytes (22%)
    
    I: Downloaded 38912/167239 bytes (23%)
    
    I: Downloaded 40960/167239 bytes (24%)
    
    I: Downloaded 43008/167239 bytes (25%)
    
    I: Downloaded 45056/167239 bytes (26%)
    
    I: Downloaded 47104/167239 bytes (28%)
    
    I: Downloaded 49152/167239 bytes (29%)
    
    I: Downloaded 51200/167239 bytes (30%)
    
    I: Downloaded 53248/167239 bytes (31%)
    
    I: Downloaded 55296/167239 bytes (33%)
    
    I: Downloaded 57344/167239 bytes (34%)
    
    I: Downloaded 59392/167239 bytes (35%)
    
    I: Downloaded 61440/167239 bytes (36%)
    
    I: Downloaded 63488/167239 bytes (37%)
    
    I: Downloaded 65536/167239 bytes (39%)
    
    I: Downloaded 67584/167239 bytes (40%)
    
    I: Downloaded 69632/167239 bytes (41%)
    
    I: Downloaded 71680/167239 bytes (42%)
    
    I: Downloaded 73728/167239 bytes (44%)
    
    I: Downloaded 75776/167239 bytes (45%)
    
    I: Downloaded 77824/167239 bytes (46%)
    
    I: Downloaded 79872/167239 bytes (47%)
    
    I: Downloaded 81920/167239 bytes (48%)
    
    I: Downloaded 83968/167239 bytes (50%)
    
    I: Downloaded 86016/167239 bytes (51%)
    
    I: Downloaded 88064/167239 bytes (52%)
    
    I: Downloaded 90112/167239 bytes (53%)
    
    I: Downloaded 92160/167239 bytes (55%)
    
    I: Downloaded 94208/167239 bytes (56%)
    
    I: Downloaded 96256/167239 bytes (57%)
    
    I: Downloaded 98304/167239 bytes (58%)
    
    I: Downloaded 100352/167239 bytes (60%)
    
    I: Downloaded 102400/167239 bytes (61%)
    
    I: Downloaded 104448/167239 bytes (62%)
    
    I: Downloaded 106496/167239 bytes (63%)
    
    I: Downloaded 108544/167239 bytes (64%)
    
    I: Downloaded 110592/167239 bytes (66%)
    
    I: Downloaded 112640/167239 bytes (67%)
    
    I: Downloaded 114688/167239 bytes (68%)
    
    I: Downloaded 116736/167239 bytes (69%)
    
    I: Downloaded 118784/167239 bytes (71%)
    
    I: Downloaded 120832/167239 bytes (72%)
    
    I: Downloaded 122880/167239 bytes (73%)
    
    I: Downloaded 124928/167239 bytes (74%)
    
    I: Downloaded 126976/167239 bytes (75%)
    
    I: Downloaded 129024/167239 bytes (77%)
    
    I: Downloaded 131072/167239 bytes (78%)
    
    I: Downloaded 133120/167239 bytes (79%)
    
    I: Downloaded 135168/167239 bytes (80%)
    
    I: Downloaded 137216/167239 bytes (82%)
    
    I: Downloaded 139264/167239 bytes (83%)
    
    I: Downloaded 141312/167239 bytes (84%)
    
    I: Downloaded 143360/167239 bytes (85%)
    
    I: Downloaded 145408/167239 bytes (86%)
    
    I: Downloaded 147456/167239 bytes (88%)
    
    I: Downloaded 149504/167239 bytes (89%)
    
    I: Downloaded 151552/167239 bytes (90%)
    
    I: Downloaded 153600/167239 bytes (91%)
    
    I: Downloaded 155648/167239 bytes (93%)
    
    I: Downloaded 157696/167239 bytes (94%)
    
    I: Downloaded 159744/167239 bytes (95%)
    
    I: Downloaded 161792/167239 bytes (96%)
    
    I: Downloaded 163840/167239 bytes (97%)
    
    I: Downloaded 165888/167239 bytes (99%)
    
    I: Downloaded 167239/167239 bytes (100%)
    
    I: Download complete
    
    I: MCUBoot image upgrade scheduled. Reset device to apply
    
    *** Booting Zephyr OS build v2.6.0-rc1-ncs1  ***
    
    I: Starting bootloader
    
    I: Primary image: magic=good, swap_type=0x2, copy_done=0x1, image_ok=0x1
    
    I: Secondary image: magic=good, swap_type=0x2, copy_done=0x3, image_ok=0x3
    
    I: Boot source: none
    
    I: Swap type: test
    
    I: Bootloader chainload address offset: 0x10000
    
    I: Jumping to the first image slot
    *** Booting Zephyr OS build v2.6.99-ncs1  ***
    
    Flash regions           Domain          Permissions
    
    00 03 0x00000 0x20000   Secure          rwxl
    
    04 31 0x20000 0x100000  Non-Secure      rwxl
    
    
    
    Non-secure callable region 0 placed in flash region 3 with size 32.
    
    
    
    SRAM region             Domain          Permissions
    
    00 07 0x00000 0x10000   Secure          rwxl
    
    08 31 0x10000 0x40000   Non-Secure      rwxl
    
    
    
    Peripheral              Domain          Status
    
    00 NRF_P0               Non-Secure      OK
    
    01 NRF_CLOCK            Non-Secure      OK
    
    02 NRF_RTC0             Non-Secure      OK
    
    03 NRF_RTC1             Non-Secure      OK
    
    04 NRF_NVMC             Non-Secure      OK
    
    05 NRF_UARTE1           Non-Secure      OK
    
    06 NRF_UARTE2           Secure          SKIP
    
    07 NRF_TWIM2            Non-Secure      OK
    
    08 NRF_SPIM3            Non-Secure      OK
    
    09 NRF_TIMER0           Non-Secure      OK
    
    10 NRF_TIMER1           Non-Secure      OK
    
    11 NRF_TIMER2           Non-Secure      OK
    
    12 NRF_SAADC            Non-Secure      OK
    
    13 NRF_PWM0             Non-Secure      OK
    
    14 NRF_PWM1             Non-Secure      OK
    
    15 NRF_PWM2             Non-Secure      OK
    
    16 NRF_PWM3             Non-Secure      OK
    
    17 NRF_WDT              Non-Secure      OK
    
    18 NRF_IPC              Non-Secure      OK
    
    19 NRF_VMC              Non-Secure      OK
    
    20 NRF_FPU              Non-Secure      OK
    
    21 NRF_EGU1             Non-Secure      OK
    
    22 NRF_EGU2             Non-Secure      OK
    
    23 NRF_DPPIC            Non-Secure      OK
    
    24 NRF_REGULATORS       Non-Secure      OK
    
    25 NRF_PDM              Non-Secure      OK
    
    26 NRF_I2S              Non-Secure      OK
    
    27 NRF_GPIOTE1          Non-Secure      OK
    
    
    
    SPM: NS image at 0x20200
    
    SPM: NS MSP at 0x2001ac08
    
    SPM: NS reset vector at 0x23a61
    
    SPM: prepare to jump to Non-Secure image.
    
    *** Booting Zephyr OS build v2.6.99-ncs1  ***
    
    HTTP application update sample started
    
    Current APP version:2
    
    LTE Link Connecting ...
    
    LTE Link Connected!
    
    Press Button 1 to perform application firmware update
    

    Can you retry with freshly new NCS installations? Please share the log file if you still have the issue.

    Best regards,

    Charlie

  • can also other settings changes in prj.conf cause this issue? I will investigate more tomorrow and share the data

  • Okay, some new Infos, first I was wrong the Firmware came from SDK 1.5.1 so I reproduced everything by compiling and testing. I did a small protocol :

    Modem 1.2.3, Steps:

    1. Erase All
    2. Flash via JLINK Firmware: 1.2.13 (SEGGGER RTT. SDK 1.5.1)
    3. Boot Works -> Log 1
    4. OTA via AWS to Firmware: 1.4.6 (Compiled SDK 1.7.0) -> Log2
    5. Boot after OTA -> Log 3
    6. Reset via Button
    7. Boot after Reset (after some time, loads old Fimrware) -> Log 4

    In Common DTS File there is a change that may can be an issue

    Also here is my prj.conf files with some differences:

    Left is 1.2.13 right is 1.4.6

    https://editor.mergely.com/t0iSkJDJ/

    Thanks for your help here and best regards


    Daniel

  • one more investigation: I can change the mamory maps in common.dts and also in partition_conf.dts to identical, the issue is not solved. so the problem seems not these maps

  • Hi Daniel,

    I realized you have done lots of modifications to the configuration files. It increased the risk of  FOTA failure.

    On product development, you should choose a fixed SDK version as the basement of your development and only update if it has critical bugs fixed or new features you need are added, because a new version may introduce new issues. The best practice of FOTA usage should also keep an NCS major version like v1.7.x and only update your application's codes for bug fixing once you have released your products.

    If you have to do such a FOTA on your setup, please start with the original NCS examples, and add the new configuration piece by piece to invest in the cause of failure. The result is unpredictable and you should avoid this on your real product.

    Best regards,

    Charlie

Related