how to implement simultaneous dfu on 5340 ncs2.4 without external flash

As title, I try to implement simultaneous dfu without external flash on 5340, but it always show that  'PM_MCUBOOT_PRIMARY_1_ID' undeclared.

if use external flash, my project can work well. when i disabled QSPI and  add pm_static.yml as below, the project compilation reported the error.

so  how to implement simultaneous dfu on 5340 ncs2.4 without external flash.

【pm_static.yml】

app:
  address: 0xc200
  region: flash_primary
  size: 0x5AE00
mcuboot:
  address: 0x0
  region: flash_primary
  size: 0xc000
mcuboot_pad:
  address: 0xc000
  region: flash_primary
  size: 0x200
mcuboot_primary:
  address: 0xc000
  orig_span: &id001
  - mcuboot_pad
  - app
  region: flash_primary
  size: 0x5B000
  span: *id001
mcuboot_primary_app:
  address: 0xc200
  orig_span: &id002
  - app
  region: flash_primary
  size: 0x5AE00
  span: *id002
mcuboot_secondary:
  address: 0x67000
  size: 0x5B000
  region: flash_primary
mcuboot_primary_1:
  address: 0x0
  size: 0x3a000
  device: nordic_ram_flash_controller
  region: ram_flash
ram_flash_empty:
  address: 0x3a000
  size: 0x6000
  device: nordic_ram_flash_controller
  region: ram_flash  
mcuboot_secondary_1:
  address: 0xC2000
  size: 0x3a000
  region: flash_primary
settings_storage:
  address: 0xfc000
  region: flash_primary
  size: 0x4000 

[mcuboot.conf]

# Enable flash simulator
CONFIG_FLASH=y
CONFIG_FPROTECT=y
CONFIG_PCD_APP=y
CONFIG_FLASH_SIMULATOR=y
CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y
CONFIG_FLASH_SIMULATOR_STATS=n

CONFIG_MAIN_STACK_SIZE=10240
CONFIG_BOOT_MAX_IMG_SECTORS=256

CONFIG_NRF53_MULTI_IMAGE_UPDATE=y
CONFIG_UPDATEABLE_IMAGE_NUMBER=2

CONFIG_BOOT_UPGRADE_ONLY=y
CONFIG_BOOT_IMAGE_ACCESS_HOOK_NRF5340=y
CONFIG_BOOT_IMAGE_ACCESS_HOOKS=y

  • Here is a sample:

    5700.peripheral_lbs_dfu.zip

    Disclaimer: This code/configuration is not thoroughly tested or qualified and should be considered provided “as-is”. Please test it with your application and let me know if you find any issues.

    This sample points the partition manager to an external flash even though it does not exist. That is becasuse it automates some building processes.
    However, this should be fixed soon, see

    https://github.com/nrfconnect/sdk-nrf/pull/10060

    https://github.com/nrfconnect/sdk-mcuboot/pull/235

    There PRs are not nessecary for you to patch yet, the sample should work without them as is.

    Regards,
    Sigurd Hellesvik

  • I am currently working on an nRF5340 project and am also interested in simultaneous dfu without external flash.

    Unfortunately, I can't get the 5700.peripheral_lbs_dfu example to work on ncs 2.5.0.

    If I understand it correctly from the github links above, this may be a new feature in ncs 2.6.0. Is that correct?

    Regards,

    Mark

  • MarkK said:
    Unfortunately, I can't get the 5700.peripheral_lbs_dfu example to work on ncs 2.5.0.

    The sample should work I beleive. Can you explain your issue?

    MarkK said:
    If I understand it correctly from the github links above, this may be a new feature in ncs 2.6.0. Is that correct?

    Tge PRs are still Open, so I can not say anything about when they will be merged and included into the nRF Connect SDK.

  • When I build peripheral_lbs_dfu "as-is" from the attached zip file (5700.peripheral_lbs_dfu.zip) for "nrf5340dk_nrf5340_cpuapp_ns" on ncs 2.5.0, I get the following:

    H:/Documenten/Projects/ZephyrTestProjects/peripheral_lbs_dfu/prj.conf:21: warning: attempt to assign the value '"2.3.0+0"' to the undefined symbol MCUBOOT_IMAGE_VERSION

    error: Aborting due to Kconfig warnings

    When I comment (#) the MCUBOOT_IMAGE_VERSION in prj.conf, to exclude it, then I get the following error:

    error: BOOT_ENCRYPT_RSA (defined at C:/ncs/v2.5.0/bootloader/mcuboot/boot/zephyr/Kconfig:338) is
    assigned in a configuration file, but is not directly user-configurable (has no prompt). It gets its
    value indirectly from other symbols. See
    docs.zephyrproject.org/.../kconfig.html and/or look up
    BOOT_ENCRYPT_RSA in the menuconfig/guiconfig interface. The Application Development Primer, Setting
    Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful
    too.

    Parsing C:/ncs/v2.5.0/bootloader/mcuboot/boot/zephyr/Kconfig
    Loaded configuration 'C:/ncs/v2.5.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp_defconfig'
    Merged configuration 'H:/Documenten/Projects/ZephyrTestProjects/peripheral_lbs_dfu/child_image/mcuboot/boards/nrf5340dk_nrf5340_cpuapp.conf'
    Merged configuration 'C:/ncs/v2.5.0/nrf/subsys/pcd/pcd.conf'
    Merged configuration 'C:/ncs/v2.5.0/nrf/modules/mcuboot/tfm.conf'
    Merged configuration 'C:/ncs/v2.5.0/nrf/modules/mcuboot/fih_low_enable.conf'
    Merged configuration 'C:/ncs/v2.5.0/nrf/subsys/partition_manager/partition_manager_enabled.conf'
    Merged configuration 'H:/Documenten/Projects/ZephyrTestProjects/peripheral_lbs_dfu/build/mcuboot/zephyr/misc/generated/extra_kconfig_options.conf'
    CMake Error at C:/ncs/v2.5.0/zephyr/cmake/modules/kconfig.cmake:348 (message):
    command failed with return code: 1
    Call Stack (most recent call first):
    C:/ncs/v2.5.0/nrf/cmake/modules/kconfig.cmake:29 (include)
    C:/ncs/v2.5.0/zephyr/cmake/modules/zephyr_default.cmake:129 (include)
    C:/ncs/v2.5.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
    C:/ncs/v2.5.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
    CMakeLists.txt:31 (find_package)

    -- Configuring incomplete, errors occurred!
    CMake Error at C:/ncs/v2.5.0/nrf/cmake/multi_image.cmake:449 (message):
    CMake generation for mcuboot failed, aborting. Command: 1
    Call Stack (most recent call first):
    C:/ncs/v2.5.0/nrf/cmake/multi_image.cmake:178 (add_child_image_from_source)
    C:/ncs/v2.5.0/nrf/modules/mcuboot/CMakeLists.txt:268 (add_child_image)

  • The version error is due to the new versioning system in v2.5.0

    MarkK said:
    error: BOOT_ENCRYPT_RSA (defined at C:/ncs/v2.5.0/bootloader/mcuboot/boot/zephyr/Kconfig:338) is

    Try to remove CONFIG_BOOT_ENCRYPT_RSA from child_image/mcuboot.conf then?

Related