Simultaneous DFU on nrf5340 and NCS 2.9.0 without external flash

Hello,

I am using NCS 2.9.0, an nRF5340, custom board files (see attached), and no external flash and I would like to use simultaneous DFU over BLE. I believe this should be possible because my application core image is only ~118kB and my netcore image is ~175kB (it has a custom synch protocol on top of the hci icp logic). I've done my best to read through the intermediate dev zone academy lessons regarding the mcu bootloader and it mentions that simultaneous updates should be possible without external flash:

but then links to this devacedmay blog post that only shows how to do this utilizing external flash. I believe it should be possible because in my mind I see the following: 


Where mcu primary is the app core code that is currently running, mcu secondary is where the new app core code goes, and mcu secondary_1 is where the new netcore code goes when an application update happens. So I have tried to add the following pm_static.yml file:

EMPTY_0:
  address: 0xfc000
  end_address: 0x100000
  placement:
    after:
    - mcuboot_secondary
  region: flash_primary
  size: 0x4000
app:
  address: 0x14000
  end_address: 0x84000
  region: flash_primary
  size: 0x70000
mcuboot:
  address: 0x0
  end_address: 0xc000
  placement:
    align:
      end: 0x1000
    before:
    - mcuboot_primary
  region: flash_primary
  size: 0xc000
mcuboot_pad:
  address: 0xc000
  end_address: 0xc200
  placement:
    align:
      start: 0x4000
    before:
    - mcuboot_primary_app
  region: flash_primary
  size: 0x200
mcuboot_primary:
  address: 0xc000
  end_address: 0x84000
  orig_span: &id001
  - app
  - tfm
  - mcuboot_pad
  region: flash_primary
  sharers: 0x1
  size: 0x78000
  span: *id001
mcuboot_primary_app:
  address: 0xc200
  end_address: 0x84000
  orig_span: &id002
  - app
  - tfm
  region: flash_primary
  size: 0x77e00
  span: *id002
mcuboot_secondary:
  address: 0x84000
  end_address: 0xfc000
  placement:
    after:
    - mcuboot_primary
    align:
      start: 0x4000
    align_next: 0x4000
  region: flash_primary
  share_size:
  - mcuboot_primary
  size: 0x78000
mcuboot_sram:
  address: 0x20000000
  end_address: 0x20008000
  orig_span: &id003
  - tfm_sram
  region: sram_primary
  size: 0x8000
  span: *id003
otp:
  address: 0xff8100
  end_address: 0xff83fc
  region: otp
  size: 0x2fc
rpmsg_nrf53_sram:
  address: 0x20070840
  end_address: 0x20080000
  placement:
    before:
    - end
  region: sram_primary
  size: 0xf7c0
sram_nonsecure:
  address: 0x20008000
  end_address: 0x20080000
  orig_span: &id004
  - sram_primary
  - rpmsg_nrf53_sram
  region: sram_primary
  size: 0x78000
  span: *id004
sram_primary:
  address: 0x20008000
  end_address: 0x20070840
  region: sram_primary
  size: 0x68840
sram_secure:
  address: 0x20000000
  end_address: 0x20008000
  orig_span: &id005
  - tfm_sram
  region: sram_primary
  size: 0x8000
  span: *id005
tfm:
  address: 0xc200
  end_address: 0x14000
  inside:
  - mcuboot_primary_app
  placement:
    before:
    - app
  region: flash_primary
  size: 0x7e00
tfm_nonsecure:
  address: 0x14000
  end_address: 0x84000
  orig_span: &id006
  - app
  region: flash_primary
  size: 0x70000
  span: *id006
tfm_secure:
  address: 0xc000
  end_address: 0x14000
  orig_span: &id007
  - mcuboot_pad
  - tfm
  region: flash_primary
  size: 0x8000
  span: *id007
tfm_sram:
  address: 0x20000000
  end_address: 0x20008000
  inside:
  - sram_secure
  placement:
    after:
    - start
  region: sram_primary
  size: 0x8000


The names are bit different than my diagram but I followed the advice of other similar posts and documentation regarding DFU and copied a build partitions.yml file from one of my successful builds. I have also added the following configs to my sysbuild.conf:

SB_CONFIG_REMOTE_BOARD="candi/nrf5340/cpunet"
SB_CONFIG_BOOTLOADER_MCUBOOT=y
SB_CONFIG_NETCORE_APP_UPDATE=y
SB_CONFIG_SECURE_BOOT_NETCORE=y
SB_CONFIG_MCUBOOT_UPDATEABLE_IMAGES=2
SB_CONFIG_MCUBOOT_NRF53_MULTI_IMAGE_UPDATE=y
SB_CONFIG_MCUBOOT_MODE_OVERWRITE_ONLY=y


Added these two lines to my prj.conf:

CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y


Do I need to set configs for utilizing flash even tho there is no external flash? When I build with the above configs I get the following errors:



I'm not sure how to proceed because I'm having a hard time understanding what these pm_static.yaml file names are supposed to be and I'm not getting the same sort of errors as these previous related posts:

- simultaneous DFU on nRF5340 and NCS 2.6.1 without external flash
- nrf5340 custom board non-simultaneous updates without external flash with sysbuild on ncs2.7.0+

---
I know from the "Official Simultaneous multi-image DFU with nRF5340 DK" docs that I need to have the following partitions:
1) mcuboot_primary
2) mcuboot_secondary
3) mcuboot_rimary_1
4) mcuboot_secondary_1
5) pcd_sram 

and I see the note regarding the placement of mcuboot_primary_1 inside of ram_flash region but I don't understand the second comment about "CONFIG_FLASH_SIMULATOR" within the docs. I'm having a hard time understanding how to get this running because I'm not even hitting the errors I would expect to hit. Instead I'm getting stuff related to the partition_manager.py scripts' arguments... 
---

Do I need to setup a pm_static.yaml file for my custom netcore image too? I don't think so from the docs but I can't find the exact reference that makes me think this but I'm asking just in case. 

---
I utilize the following shared memory overlay within my code base and I don't think I'm correctly partitioning for it within my pm_static.yaml file:

Can you help with this too? It is the only reason I think that adding a partition file for the network core might be needed in addition but I'm really not sure. 

Thank you so much for all of your help and time. 

Respectfully,
Brady Adcock

Parents Reply Children
No Data
Related