NCS2.0 MCUBOOT OTA startup with old firmware not the new one after upload app_update.bin

We follow the OTA guide:  Add DFU support to your application 

Add below code in main.c:

    printk("build time: %s %s Version: %s\n", __DATE__, __TIME__, CONFIG_MCUBOOT_IMAGE_VERSION);
    os_mgmt_register_group();
    img_mgmt_register_group();
    smp_bt_register();

Our prj.conf:

CONFIG_MCUMGR=y
CONFIG_MCUMGR_CMD_IMG_MGMT=y
CONFIG_MCUMGR_CMD_OS_MGMT=y
CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_MCUMGR_SMP_BT=y
CONFIG_MCUMGR_SMP_BT_AUTHEN=n
CONFIG_IMG_ERASE_PROGRESSIVELY=y
CONFIG_MCUBOOT_SIGNATURE_KEY_FILE="child_image/mcuboot/mcuboot_private.pem"
CONFIG_MCUBOOT_IMAGE_VERSION="0.0.0+0"
......
Mcuboot prj.conf:
CONFIG_SIZE_OPTIMIZATIONS=y
CONFIG_HW_STACK_PROTECTION=n
CONFIG_SYSTEM_CLOCK_NO_WAIT=y
CONFIG_PM=n
CONFIG_MAIN_STACK_SIZE=10240
CONFIG_BOOT_BOOTSTRAP=n
CONFIG_BOOT_ENCRYPT_RSA=n
CONFIG_BOOT_SIGNATURE_TYPE_RSA=y
CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256=y
CONFIG_BOOT_SIGNATURE_KEY_FILE="mcuboot_private.pem"
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
CONFIG_FLASH=y
CONFIG_BOOT_ERASE_PROGRESSIVELY=y
CONFIG_SOC_FLASH_NRF_EMULATE_ONE_BYTE_WRITE_ACCESS=y
CONFIG_USE_SEGGER_RTT=y
CONFIG_LOG=y
CONFIG_LOG_DEFAULT_LEVEL=2
CONFIG_LOG_MAX_LEVEL=3
CONFIG_LOG_PRINTK=y
CONFIG_LOG_MODE_IMMEDIATE=y
CONFIG_LOG_BACKEND_SHOW_COLOR=n
CONFIG_LOG_BACKEND_FORMAT_TIMESTAMP=n
Build the project, then flash to device, the rtt log:
Then we change CONFIG_MCUBOOT_IMAGE_VERSION="0.0.1+0", rebuild project, and use nRF Connect update the app_update.bin to device, everything is ok, but after device reboot, the rtt log is the same with old one:
The nRF Connect log:
The mcuboot exec the old firmware after upload app_update.bin success, how can this happen? What i missed?
Parents
  • Hi Jimmy, 

    Have you tried to change the content of the application and rebuild ? Can be just as little as the text in the log. As far as I know if the hash of the image binary matches with the current image(s) on the chip it will reject the image upload. 

  • This is my partitions.yml file in build folder:

    app:
      address: 0xc200
      end_address: 0x45000
      region: flash_primary
      size: 0x38e00
    mcuboot:
      address: 0x0
      end_address: 0xc000
      placement:
        before:
        - mcuboot_primary
      region: flash_primary
      size: 0xc000
    mcuboot_pad:
      address: 0xc000
      end_address: 0xc200
      placement:
        before:
        - mcuboot_primary_app
      region: flash_primary
      size: 0x200
    mcuboot_primary:
      address: 0xc000
      end_address: 0x45000
      orig_span: &id001
      - mcuboot_pad
      - app
      region: flash_primary
      sharers: 0x1
      size: 0x39000
      span: *id001
    mcuboot_primary_app:
      address: 0xc200
      end_address: 0x45000
      orig_span: &id002
      - app
      region: flash_primary
      size: 0x38e00
      span: *id002
    mcuboot_secondary:
      address: 0x45000
      end_address: 0x7e000
      placement:
        after:
        - mcuboot_primary
        align:
          start: 0x1000
      region: flash_primary
      share_size:
      - mcuboot_primary
      size: 0x39000
    settings_storage:
      address: 0x7e000
      end_address: 0x80000
      placement:
        align:
          start: 0x1000
        before:
        - end
      region: flash_primary
      size: 0x2000
    sram_primary:
      address: 0x20000000
      end_address: 0x20020000
      region: sram_primary
      size: 0x20000
    

Reply
  • This is my partitions.yml file in build folder:

    app:
      address: 0xc200
      end_address: 0x45000
      region: flash_primary
      size: 0x38e00
    mcuboot:
      address: 0x0
      end_address: 0xc000
      placement:
        before:
        - mcuboot_primary
      region: flash_primary
      size: 0xc000
    mcuboot_pad:
      address: 0xc000
      end_address: 0xc200
      placement:
        before:
        - mcuboot_primary_app
      region: flash_primary
      size: 0x200
    mcuboot_primary:
      address: 0xc000
      end_address: 0x45000
      orig_span: &id001
      - mcuboot_pad
      - app
      region: flash_primary
      sharers: 0x1
      size: 0x39000
      span: *id001
    mcuboot_primary_app:
      address: 0xc200
      end_address: 0x45000
      orig_span: &id002
      - app
      region: flash_primary
      size: 0x38e00
      span: *id002
    mcuboot_secondary:
      address: 0x45000
      end_address: 0x7e000
      placement:
        after:
        - mcuboot_primary
        align:
          start: 0x1000
      region: flash_primary
      share_size:
      - mcuboot_primary
      size: 0x39000
    settings_storage:
      address: 0x7e000
      end_address: 0x80000
      placement:
        align:
          start: 0x1000
        before:
        - end
      region: flash_primary
      size: 0x2000
    sram_primary:
      address: 0x20000000
      end_address: 0x20020000
      region: sram_primary
      size: 0x20000
    

Children
No Data
Related