Partition manager config for child image

Hello,

We created a custom board around nrf7002-DK (which includes nrf5340 and nrf7002 for wifi). We are using TF-M (including a custom secure partition), BT (child image) and WIFI.

The problem with flash space raised and we started to lower the partitions for everything since not all of them are correctly optimized.

For example, in TF-M case we reduced 50% of it by using the config entry CONFIG_PM_PARTITION_SIZE_TFM and everything is fine here.

The problem is with the BLE child image. Since there is no config entry for this, from what I researched in documentation, there is need for a static configuration file for partition manager for child image, which I created under the board directory with the name pm_static_<custom_name>_nrf5340_cpunet.yml and I see in the build flow that this file is taken into account. The problem is that the generated partition yml that I see in the build/hci_ipc/partitions_CPUNET.yml is wrong and the end result is of course wrong.

The generated yml takes into account the lowered app entry from 0x40000 to 0x20000 but the hci_ipc entry is still 0x40000. And what about the regions ? How we change that? If I put those also in the same paritition manager static config file the script cannot parse them.

The defined static partition manager config file for child image:

app:
  address: 0x1000000
  end_address: 0x1020000
  orig_span: &id001
  - hci_ipc
  region: flash_primary
  size: 0x20000
  span: *id001
hci_ipc:
  address: 0x1000000
  end_address: 0x1020000
  region: flash_primary
  size: 0x20000
sram_primary:
  address: 0x21000000
  end_address: 0x21010000
  region: sram_primary
  size: 0x10000

The generated partitions_CPUNET.yml

app:
  address: 0x1000000
  end_address: 0x1020000
  orig_span: &id001
  - hci_ipc
  region: flash_primary
  size: 0x20000
  span: *id001
hci_ipc:
  address: 0x1000000
  end_address: 0x1040000
  region: flash_primary
  size: 0x40000
sram_primary:
  address: 0x21000000
  end_address: 0x21010000
  region: sram_primary
  size: 0x10000

Related