Situation : custom nrf5340/nrf7002 board (very close to production...). Main image is overflowing available internal flash (with a MCUboot 64kB partition).
Secondary slots etc are on 8Mb external flash (QSPI connected)
Up to now, using the 'multi-image build' process (migrated from 2.6->2.8->2.9 in search of stable wifi/networking operation).
I want to move the wifi fw patches (approx 80kB) to the external flash also (CONFIG_WIFI_PATCHES_EXT_FLASH_STORE=y). This forces me to move to sysbuild as the mechanism to generate the required .hex files is not supported in the old mutli-image CMakefiles. This successfully puts the wifi bin file (nrf70.bin) in the external flash...
The build was working, but then when flashed to the board mcuboot refused to run the app. No error or explanation. I tried updating the partition sizes to let it have 64kB so I could also enable serial download over USB.... and now I cannot get the build to complete.
It fails building mcuboot, with an error indicating that 'PM_MCUBOOT_PRIMARY_1_ID' is not defined.
...
oot/bootutil/src/bootutil_public.c
In file included from C:/ncs/v2.9.0/bootloader/mcuboot/boot/zephyr/include/sysflash/sysflash.h:12,
from C:/ncs/v2.9.0/bootloader/mcuboot/boot/bootutil/src/bootutil_public.c:43:
C:/ncs/v2.9.0/bootloader/mcuboot/boot/zephyr/include/sysflash/pm_sysflash.h: In function '__flash_area_ids_for_slot':
C:/ncs/v2.9.0/bootloader/mcuboot/boot/zephyr/include/sysflash/pm_sysflash.h:20:37: error: 'PM_MCUBOOT_PRIMARY_1_ID' undeclared (first use in this function); did you mean 'PM_MCUBOOT_PRIMARY_2_ID'?
20 | #define FLASH_AREA_IMAGE_1_SLOTS PM_MCUBOOT_PRIMARY_1_ID, PM_MCUBOOT_SECONDARY_1_ID,
| ^~~~~~~~~~~~~~~~~~~~~~~
This is the id for the 'ram-flash' partition that simulates the primary partition for the CPU-NET DFU operation (as explained in the tutorials about DFU). The pm_sysflash.h is I think looking for 2 image slots, instead of the 3 it should expect (app, cpu-net, wifi fw).
The generated pm_config.h indeed does not contain this id, despite it being defined in my pm_static.yml: