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

Ncs1.2.0 cannot be upgraded to ncs1.6.0

I need to upgrade NCS1.2.0 to NCS1.6.0, the application firmware is downloaded successfully, but after restarting the IC, it still runs the previous application.I think there should be an error in bootloader.

Here is boot's log:

*** Booting Zephyr OS build v2.1.99-ncs1 ***
[00:00:00.003,021] [0m<inf> mcuboot: Starting bootloader[0m
[00:00:00.009,185] [0m<inf> mcuboot: Primary image: magic=bad, swap_type=0x1, copy_done=0x2, image_ok=0x2[0m
[00:00:00.019,042] [0m<inf> mcuboot: Boot source: none[0m
[00:00:00.024,505] [0m<inf> mcuboot: Swap type: test[0m
[00:00:10.972,961] [1;31m<err> mcuboot: Image in the secondary slot is not valid![0m
[00:00:11.204,101] [0m<inf> mcuboot: Bootloader chainload address offset: 0xc000[0m
[00:00:11.211,730] [0m<inf> mcuboot: Jumping to the first image slot[0m

How can this issue be solved?

Thanks.

  • Hi,

    This is probably because the new version has a different flash partitoning scheme than the old version.

    In, NCS, the partitioning scheme is decided dynamically for each build by the Partition Manager.

    in the build folder for your old version, there should be a pm.yml file.

    If you copy it to your new project folder, and rename it to pm_static.yml, it should apply the old flash partitioning scheme to your new project.

    You can read more in the Partition Manager documentation.

    Best regards,

    Didrik

  • I have done the tests. I copied pm.yml from nCS1.2.0\ bootloader\ McUboot \boot\zephyr\ to nCS1.6.0\ bootloader\ McUboot \boot\zephyr\ and renamed it pm_static.yml,In CmakeLists. TXT added 

    set(PM_STATIC_YML_FILE
    ${CMAKE_CURRENT_SOURCE_DIR}/configuration/${BOARD}/pm_static_${CMAKE_BUILD_TYPE}.yml
    )

    Unfortunately, it doesn't work.

    It still says: "Image in the secondary slot is not valid!" ,then " Jumping to the first image slot "

    Did I do something wrong?

  • You should copy <your 1.2.0 build directory>/partitions.yml (sorry for writing the wrong name previously) to <your 1.6.0 project directory> (where you have your CMakeLists.txt and prj.conf files), and rename it to pm_static.yml.

    You do not need to add anything to your CMakeLists.txt file if you rename it to pm_static.yml.

  • I have done as you suggested.but it does not work.I provide two "partitions.yml" files from ncs1.2.0 and 1.6.0

    Could you help me see how to do it?

     from 1.6.0

    app:
    address: 0x18200
    end_address: 0x7e000
    region: flash_primary
    size: 0x65e00
    mcuboot:
    address: 0x0
    end_address: 0xc000
    placement:
    before:
    - mcuboot_primary
    region: flash_primary
    size: 0xc000
    mcuboot_pad:
    address: 0xc000
    end_address: 0xc200
    placement:
    align:
    start: 0x1000
    before:
    - mcuboot_primary_app
    region: flash_primary
    size: 0x200
    mcuboot_primary:
    address: 0xc000
    end_address: 0x86000
    orig_span: &id001
    - spm
    - mcuboot_pad
    - app
    region: flash_primary
    sharers: 0x1
    size: 0x7a000
    span: *id001
    mcuboot_primary_app:
    address: 0xc200
    end_address: 0x86000
    orig_span: &id002
    - app
    - spm
    region: flash_primary
    size: 0x79e00
    span: *id002
    mcuboot_secondary:
    address: 0x86000
    end_address: 0x100000
    placement:
    after:
    - mcuboot_primary
    align:
    start: 0x1000
    region: flash_primary
    share_size:
    - mcuboot_primary
    size: 0x7a000
    nrf_modem_lib_ctrl:
    address: 0x20010000
    end_address: 0x200104e8
    inside:
    - sram_nonsecure
    placement:
    after:
    - spm_sram
    - start
    region: sram_primary
    size: 0x4e8
    nrf_modem_lib_rx:
    address: 0x200124e8
    end_address: 0x200144e8
    inside:
    - sram_nonsecure
    placement:
    after:
    - nrf_modem_lib_tx
    region: sram_primary
    size: 0x2000
    nrf_modem_lib_sram:
    address: 0x20010000
    end_address: 0x200144e8
    orig_span: &id003
    - nrf_modem_lib_ctrl
    - nrf_modem_lib_tx
    - nrf_modem_lib_rx
    region: sram_primary
    size: 0x44e8
    span: *id003
    nrf_modem_lib_tx:
    address: 0x200104e8
    end_address: 0x200124e8
    inside:
    - sram_nonsecure
    placement:
    after:
    - nrf_modem_lib_ctrl
    region: sram_primary
    size: 0x2000
    nvs_storage:
    address: 0x7e000
    end_address: 0x84000
    placement:
    before:
    - settings_storage
    region: flash_primary
    size: 0x6000
    otp:
    address: 0xff8108
    end_address: 0xff83fc
    region: otp
    size: 0x2f4
    settings_storage:
    address: 0x84000
    end_address: 0x86000
    placement:
    before:
    - end
    region: flash_primary
    size: 0x2000
    spm:
    address: 0xc200
    end_address: 0x18200
    inside:
    - mcuboot_primary_app
    placement:
    before:
    - app
    region: flash_primary
    size: 0xc000
    spm_sram:
    address: 0x20000000
    end_address: 0x20010000
    inside:
    - sram_secure
    placement:
    after:
    - start
    region: sram_primary
    size: 0x10000
    sram_nonsecure:
    address: 0x20010000
    end_address: 0x20040000
    orig_span: &id004
    - sram_primary
    - nrf_modem_lib_ctrl
    - nrf_modem_lib_tx
    - nrf_modem_lib_rx
    region: sram_primary
    size: 0x30000
    span: *id004
    sram_primary:
    address: 0x200144e8
    end_address: 0x20040000
    region: sram_primary
    size: 0x2bb18
    sram_secure:
    address: 0x20000000
    end_address: 0x20010000
    orig_span: &id005
    - spm_sram
    region: sram_primary
    size: 0x10000
    span: *id005

    from 1.2.0

    app:
    address: 0x18200
    size: 0x6de00
    mcuboot:
    address: 0x0
    placement:
    before:
    - mcuboot_primary
    size: 0xc000
    mcuboot_pad:
    address: 0xc000
    placement:
    align:
    start: 0x1000
    before:
    - mcuboot_primary_app
    size: 0x200
    mcuboot_primary:
    address: 0xc000
    orig_span: &id001
    - spm
    - app
    - mcuboot_pad
    sharers: 0x1
    size: 0x7a000
    span: *id001
    mcuboot_primary_app:
    address: 0xc200
    orig_span: &id002
    - app
    - spm
    size: 0x79e00
    span: *id002
    mcuboot_secondary:
    address: 0x86000
    placement:
    after:
    - mcuboot_primary
    align:
    start: 0x1000
    share_size:
    - mcuboot_primary
    size: 0x7a000
    spm:
    address: 0xc200
    inside:
    - mcuboot_primary_app
    placement:
    before:
    - app
    size: 0xc000

  • The two .yml files looks compatible, so it might not be the flash partitioning scheme that is the problem.

    What file are you using when you try to upgrade the firmware?

Related