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

How to update the MCUboot in nRF Connect on nRF52840DK

Hi,

I press Button 1 and Reset to put the nRF52840 DK in to DFU mode that is programmed with a immutable bootloader (B0), mcuboot, and application. This works well to update the application (app_update.bin) using mcumgr over USB. However, during the mcuboot update (signed_by_mcuboot_and_b0_s1_image_update.bin), the application area is over-written and the application enters in a infinite loop after reset. I verified the over-write by reading the flash memory using the nRF programmer. 

Since mcumgr doesn't accept an address or slot parameter, I think the DFU mode is initialized with the application address. 

Are there different ways to enter the DFU mode to update the application and to update the mcuboot?

Thanks,

Ram

Parents
  • Hi,

     It's the Partition Manager that sets the start address in a multi-image build. See this link for more information: http://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.4.0/nrf/scripts/partition_manager/partition_manager.html

    In your build folder, how does partitions_nrf52840dk_nrf52840.yml and pm_nrf52840dk_nrf52840.config look like ?

  • PM_B0_ADDRESS=0x0
    PM_B0_SIZE=0x8000
    PM_B0_NAME=b0
    PM_B0_ID=0
    PM_b0_ID=PM_B0_ID
    PM_0_LABEL=B0
    PM_B0_SPAN="b0_image provision"
    PM_B0_IMAGE_ADDRESS=0x0
    PM_B0_IMAGE_SIZE=0x7000
    PM_B0_IMAGE_NAME=b0_image
    PM_B0_IMAGE_ID=1
    PM_b0_image_ID=PM_B0_IMAGE_ID
    PM_1_LABEL=B0_IMAGE
    PM_PROVISION_ADDRESS=0x7000
    PM_PROVISION_SIZE=0x1000
    PM_PROVISION_NAME=provision
    PM_PROVISION_ID=2
    PM_provision_ID=PM_PROVISION_ID
    PM_2_LABEL=PROVISION
    PM_S0_ADDRESS=0x8000
    PM_S0_SIZE=0x10200
    PM_S0_NAME=s0
    PM_S0_ID=3
    PM_s0_ID=PM_S0_ID
    PM_3_LABEL=S0
    PM_S0_SPAN="mcuboot s0_pad"
    PM_S0_PAD_ADDRESS=0x8000
    PM_S0_PAD_SIZE=0x200
    PM_S0_PAD_NAME=s0_pad
    PM_S0_PAD_ID=4
    PM_s0_pad_ID=PM_S0_PAD_ID
    PM_4_LABEL=S0_PAD
    PM_MCUBOOT_ADDRESS=0x8200
    PM_MCUBOOT_SIZE=0x10000
    PM_MCUBOOT_NAME=mcuboot
    PM_MCUBOOT_ID=5
    PM_mcuboot_ID=PM_MCUBOOT_ID
    PM_5_LABEL=MCUBOOT
    PM_S0_IMAGE_ADDRESS=0x8200
    PM_S0_IMAGE_SIZE=0x10000
    PM_S0_IMAGE_NAME=s0_image
    PM_S0_IMAGE_ID=6
    PM_s0_image_ID=PM_S0_IMAGE_ID
    PM_6_LABEL=S0_IMAGE
    PM_S0_IMAGE_SPAN="mcuboot"
    PM_EMPTY_0_ADDRESS=0x18200
    PM_EMPTY_0_SIZE=0xe00
    PM_EMPTY_0_NAME=EMPTY_0
    PM_EMPTY_0_ID=7
    PM_empty_0_ID=PM_EMPTY_0_ID
    PM_7_LABEL=EMPTY_0
    PM_S1_ADDRESS=0x19000
    PM_S1_SIZE=0x10200
    PM_S1_NAME=s1
    PM_S1_ID=8
    PM_s1_ID=PM_S1_ID
    PM_8_LABEL=S1
    PM_S1_SPAN="s1_pad s1_image"
    PM_S1_PAD_ADDRESS=0x19000
    PM_S1_PAD_SIZE=0x200
    PM_S1_PAD_NAME=s1_pad
    PM_S1_PAD_ID=9
    PM_s1_pad_ID=PM_S1_PAD_ID
    PM_9_LABEL=S1_PAD
    PM_EMPTY_1_ADDRESS=0x19200
    PM_EMPTY_1_SIZE=0xe00
    PM_EMPTY_1_NAME=EMPTY_1
    PM_EMPTY_1_ID=10
    PM_empty_1_ID=PM_EMPTY_1_ID
    PM_10_LABEL=EMPTY_1
    PM_S1_IMAGE_ADDRESS=0x1a000
    PM_S1_IMAGE_SIZE=0x10000
    PM_S1_IMAGE_NAME=s1_image
    PM_S1_IMAGE_ID=11
    PM_s1_image_ID=PM_S1_IMAGE_ID
    PM_11_LABEL=S1_IMAGE
    PM_MCUBOOT_PAD_ADDRESS=0x2a000
    PM_MCUBOOT_PAD_SIZE=0x200
    PM_MCUBOOT_PAD_NAME=mcuboot_pad
    PM_MCUBOOT_PAD_ID=12
    PM_mcuboot_pad_ID=PM_MCUBOOT_PAD_ID
    PM_12_LABEL=MCUBOOT_PAD
    PM_MCUBOOT_PRIMARY_ADDRESS=0x2a000
    PM_MCUBOOT_PRIMARY_SIZE=0x6b000
    PM_MCUBOOT_PRIMARY_NAME=mcuboot_primary
    PM_MCUBOOT_PRIMARY_ID=13
    PM_mcuboot_primary_ID=PM_MCUBOOT_PRIMARY_ID
    PM_13_LABEL=MCUBOOT_PRIMARY
    PM_MCUBOOT_PRIMARY_SPAN="app mcuboot_pad"
    PM_APP_ADDRESS=0x2a200
    PM_APP_SIZE=0x6ae00
    PM_APP_NAME=app
    PM_APP_ID=14
    PM_app_ID=PM_APP_ID
    PM_14_LABEL=APP
    PM_MCUBOOT_PRIMARY_APP_ADDRESS=0x2a200
    PM_MCUBOOT_PRIMARY_APP_SIZE=0x6ae00
    PM_MCUBOOT_PRIMARY_APP_NAME=mcuboot_primary_app
    PM_MCUBOOT_PRIMARY_APP_ID=15
    PM_mcuboot_primary_app_ID=PM_MCUBOOT_PRIMARY_APP_ID
    PM_15_LABEL=MCUBOOT_PRIMARY_APP
    PM_MCUBOOT_PRIMARY_APP_SPAN="app"
    PM_SPM_APP_ADDRESS=0x2a200
    PM_SPM_APP_SIZE=0x6ae00
    PM_SPM_APP_NAME=spm_app
    PM_SPM_APP_ID=16
    PM_spm_app_ID=PM_SPM_APP_ID
    PM_16_LABEL=SPM_APP
    PM_SPM_APP_SPAN="app"
    PM_MCUBOOT_SECONDARY_ADDRESS=0x95000
    PM_MCUBOOT_SECONDARY_SIZE=0x6b000
    PM_MCUBOOT_SECONDARY_NAME=mcuboot_secondary
    PM_MCUBOOT_SECONDARY_ID=17
    PM_mcuboot_secondary_ID=PM_MCUBOOT_SECONDARY_ID
    PM_17_LABEL=MCUBOOT_SECONDARY
    PM_SRAM_PRIMARY_ADDRESS=0x20000000
    PM_SRAM_PRIMARY_SIZE=0x40000
    PM_SRAM_PRIMARY_NAME=sram_primary
    PM_NUM=18
    PM_ALL_BY_SIZE="mcuboot_pad s0_pad s1_pad EMPTY_0 EMPTY_1 provision b0_image b0 mcuboot s1_image s0_image s0 s1 sram_primary app mcuboot_primary_app spm_app mcuboot_secondary mcuboot_primary"

Reply
  • PM_B0_ADDRESS=0x0
    PM_B0_SIZE=0x8000
    PM_B0_NAME=b0
    PM_B0_ID=0
    PM_b0_ID=PM_B0_ID
    PM_0_LABEL=B0
    PM_B0_SPAN="b0_image provision"
    PM_B0_IMAGE_ADDRESS=0x0
    PM_B0_IMAGE_SIZE=0x7000
    PM_B0_IMAGE_NAME=b0_image
    PM_B0_IMAGE_ID=1
    PM_b0_image_ID=PM_B0_IMAGE_ID
    PM_1_LABEL=B0_IMAGE
    PM_PROVISION_ADDRESS=0x7000
    PM_PROVISION_SIZE=0x1000
    PM_PROVISION_NAME=provision
    PM_PROVISION_ID=2
    PM_provision_ID=PM_PROVISION_ID
    PM_2_LABEL=PROVISION
    PM_S0_ADDRESS=0x8000
    PM_S0_SIZE=0x10200
    PM_S0_NAME=s0
    PM_S0_ID=3
    PM_s0_ID=PM_S0_ID
    PM_3_LABEL=S0
    PM_S0_SPAN="mcuboot s0_pad"
    PM_S0_PAD_ADDRESS=0x8000
    PM_S0_PAD_SIZE=0x200
    PM_S0_PAD_NAME=s0_pad
    PM_S0_PAD_ID=4
    PM_s0_pad_ID=PM_S0_PAD_ID
    PM_4_LABEL=S0_PAD
    PM_MCUBOOT_ADDRESS=0x8200
    PM_MCUBOOT_SIZE=0x10000
    PM_MCUBOOT_NAME=mcuboot
    PM_MCUBOOT_ID=5
    PM_mcuboot_ID=PM_MCUBOOT_ID
    PM_5_LABEL=MCUBOOT
    PM_S0_IMAGE_ADDRESS=0x8200
    PM_S0_IMAGE_SIZE=0x10000
    PM_S0_IMAGE_NAME=s0_image
    PM_S0_IMAGE_ID=6
    PM_s0_image_ID=PM_S0_IMAGE_ID
    PM_6_LABEL=S0_IMAGE
    PM_S0_IMAGE_SPAN="mcuboot"
    PM_EMPTY_0_ADDRESS=0x18200
    PM_EMPTY_0_SIZE=0xe00
    PM_EMPTY_0_NAME=EMPTY_0
    PM_EMPTY_0_ID=7
    PM_empty_0_ID=PM_EMPTY_0_ID
    PM_7_LABEL=EMPTY_0
    PM_S1_ADDRESS=0x19000
    PM_S1_SIZE=0x10200
    PM_S1_NAME=s1
    PM_S1_ID=8
    PM_s1_ID=PM_S1_ID
    PM_8_LABEL=S1
    PM_S1_SPAN="s1_pad s1_image"
    PM_S1_PAD_ADDRESS=0x19000
    PM_S1_PAD_SIZE=0x200
    PM_S1_PAD_NAME=s1_pad
    PM_S1_PAD_ID=9
    PM_s1_pad_ID=PM_S1_PAD_ID
    PM_9_LABEL=S1_PAD
    PM_EMPTY_1_ADDRESS=0x19200
    PM_EMPTY_1_SIZE=0xe00
    PM_EMPTY_1_NAME=EMPTY_1
    PM_EMPTY_1_ID=10
    PM_empty_1_ID=PM_EMPTY_1_ID
    PM_10_LABEL=EMPTY_1
    PM_S1_IMAGE_ADDRESS=0x1a000
    PM_S1_IMAGE_SIZE=0x10000
    PM_S1_IMAGE_NAME=s1_image
    PM_S1_IMAGE_ID=11
    PM_s1_image_ID=PM_S1_IMAGE_ID
    PM_11_LABEL=S1_IMAGE
    PM_MCUBOOT_PAD_ADDRESS=0x2a000
    PM_MCUBOOT_PAD_SIZE=0x200
    PM_MCUBOOT_PAD_NAME=mcuboot_pad
    PM_MCUBOOT_PAD_ID=12
    PM_mcuboot_pad_ID=PM_MCUBOOT_PAD_ID
    PM_12_LABEL=MCUBOOT_PAD
    PM_MCUBOOT_PRIMARY_ADDRESS=0x2a000
    PM_MCUBOOT_PRIMARY_SIZE=0x6b000
    PM_MCUBOOT_PRIMARY_NAME=mcuboot_primary
    PM_MCUBOOT_PRIMARY_ID=13
    PM_mcuboot_primary_ID=PM_MCUBOOT_PRIMARY_ID
    PM_13_LABEL=MCUBOOT_PRIMARY
    PM_MCUBOOT_PRIMARY_SPAN="app mcuboot_pad"
    PM_APP_ADDRESS=0x2a200
    PM_APP_SIZE=0x6ae00
    PM_APP_NAME=app
    PM_APP_ID=14
    PM_app_ID=PM_APP_ID
    PM_14_LABEL=APP
    PM_MCUBOOT_PRIMARY_APP_ADDRESS=0x2a200
    PM_MCUBOOT_PRIMARY_APP_SIZE=0x6ae00
    PM_MCUBOOT_PRIMARY_APP_NAME=mcuboot_primary_app
    PM_MCUBOOT_PRIMARY_APP_ID=15
    PM_mcuboot_primary_app_ID=PM_MCUBOOT_PRIMARY_APP_ID
    PM_15_LABEL=MCUBOOT_PRIMARY_APP
    PM_MCUBOOT_PRIMARY_APP_SPAN="app"
    PM_SPM_APP_ADDRESS=0x2a200
    PM_SPM_APP_SIZE=0x6ae00
    PM_SPM_APP_NAME=spm_app
    PM_SPM_APP_ID=16
    PM_spm_app_ID=PM_SPM_APP_ID
    PM_16_LABEL=SPM_APP
    PM_SPM_APP_SPAN="app"
    PM_MCUBOOT_SECONDARY_ADDRESS=0x95000
    PM_MCUBOOT_SECONDARY_SIZE=0x6b000
    PM_MCUBOOT_SECONDARY_NAME=mcuboot_secondary
    PM_MCUBOOT_SECONDARY_ID=17
    PM_mcuboot_secondary_ID=PM_MCUBOOT_SECONDARY_ID
    PM_17_LABEL=MCUBOOT_SECONDARY
    PM_SRAM_PRIMARY_ADDRESS=0x20000000
    PM_SRAM_PRIMARY_SIZE=0x40000
    PM_SRAM_PRIMARY_NAME=sram_primary
    PM_NUM=18
    PM_ALL_BY_SIZE="mcuboot_pad s0_pad s1_pad EMPTY_0 EMPTY_1 provision b0_image b0 mcuboot s1_image s0_image s0 s1 sram_primary app mcuboot_primary_app spm_app mcuboot_secondary mcuboot_primary"

Children
  • EMPTY_0:
    address: 0x18200
    placement:
    before:
    - s1_pad
    region: flash_primary
    size: 0xe00
    EMPTY_1:
    address: 0x19200
    placement:
    before:
    - s1_image
    region: flash_primary
    size: 0xe00
    app:
    address: 0x2a200
    region: flash_primary
    size: 0x6ae00
    b0:
    address: 0x0
    orig_span: &id001
    - b0_image
    - provision
    region: flash_primary
    size: 0x8000
    span: *id001
    b0_image:
    address: 0x0
    placement:
    after:
    - start
    region: flash_primary
    size: 0x7000
    mcuboot:
    address: 0x8200
    placement:
    before:
    - mcuboot_primary
    region: flash_primary
    sharers: 0x1
    size: 0x10000
    mcuboot_pad:
    address: 0x2a000
    placement:
    align:
    start: 0x1000
    before:
    - mcuboot_primary_app
    region: flash_primary
    sharers: 0x2
    size: 0x200
    mcuboot_primary:
    address: 0x2a000
    orig_span: &id002
    - app
    - mcuboot_pad
    region: flash_primary
    sharers: 0x1
    size: 0x6b000
    span: *id002
    mcuboot_primary_app:
    address: 0x2a200
    orig_span: &id003
    - app
    region: flash_primary
    size: 0x6ae00
    span: *id003
    mcuboot_secondary:
    address: 0x95000
    placement:
    after:
    - mcuboot_primary
    align:
    start: 0x1000
    region: flash_primary
    share_size:
    - mcuboot_primary
    size: 0x6b000
    provision:
    address: 0x7000
    placement:
    after:
    - b0_image
    align:
    start: 0x1000
    region: flash_primary
    size: 0x1000
    s0:
    address: 0x8000
    orig_span: &id004
    - mcuboot
    - s0_pad
    region: flash_primary
    size: 0x10200
    span: *id004
    s0_image:
    address: 0x8200
    orig_span: &id005
    - mcuboot
    region: flash_primary
    size: 0x10000
    span: *id005
    s0_pad:
    address: 0x8000
    placement:
    after:
    - b0
    align:
    start: 0x1000
    region: flash_primary
    share_size:
    - mcuboot_pad
    size: 0x200
    s1:
    address: 0x19000
    orig_span: &id006
    - s1_pad
    - s1_image
    region: flash_primary
    size: 0x10200
    span: *id006
    s1_image:
    address: 0x1a000
    placement:
    after:
    - s1_pad
    - s0
    align:
    end: 0x1000
    region: flash_primary
    share_size:
    - mcuboot
    size: 0x10000
    s1_pad:
    address: 0x19000
    placement:
    after:
    - s0
    align:
    start: 0x1000
    region: flash_primary
    share_size:
    - mcuboot_pad
    size: 0x200
    spm_app:
    address: 0x2a200
    orig_span: &id007
    - app
    region: flash_primary
    size: 0x6ae00
    span: *id007
    sram_primary:
    address: 0x20000000
    region: sram_primary
    size: 0x40000

Related