Sysbuild configuration for a updatable section containing firmware image and meta-data for external component

NCS 2.7

NRF52840

Building with sysbuild, MCUBOOT, and 2 different applications (mfg and end-user)

My custom board includes a sensor fusion IMU from bosch.  The firmware that must be loaded for this IMU is ~133 KB.  My initial development effort embedded the imu firmware into the application image.  The resulting update image consumes more than 50% of the flash space, and therefore would require reserving space in the external flash for updates. 

The IMU is an excellent candidate for independent update.  It has a well defined communication interface that remains constant across versions.  It may also only need 1-2 updates over the product lifecycle.  

I modified my static partition to create a ext_fw partition area to contain the external firmware image. 

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
xt_fw:
address: 0xc200
end_address: 0x2F000
region: flash_primary
size: 0x22200
app:
address: 0x2F000
end_address: 0x94000
region: flash_primary
size: 0x65000
mcuboot:
address: 0x0
end_address: 0xc000
placement:
before:
- mcuboot_primary
region: flash_primary
size: 0xc000
mcuboot_pad:
address: 0xc000
end_address: 0xc200
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

From the board dts,I defined two zephyr memory regions.  One region holds meta data such as the image size, and external firmware image kernel version and a pointer to the firmware image data.  The other memory region holds the firmware image itself.

  

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
flash@C200 {
compatible = "zephyr,memory-region";
reg = <0xC200 0x100>;
zephyr,memory-region = "ext_fw_meta";
status = "okay";
};
flash@C300 {
compatible = "zephyr,memory-region";
reg = <0xC300 0x22D00>;
zephyr,memory-region = "ext_fw_data";
status = "okay";
};
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

I'm trying to figure out how to proceed with sysbuild to add another buildable image.

I added a sysbuild.cmake as documented docs.nordicsemi.com/.../index.html:

Fullscreen
1
2
3
4
ExternalZephyrProject_Add(
APPLICATION xx_bhi360_ext_fw_xx
SOURCE_DIR ${ZEPHYR_BASE}/../app.git/bhi360_ext_fw
)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

When I run the build by adding a build configuration within VS Code NRF Connect Extension I get an error about that the directory is empty:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
-- west build: generating a build system
Loading Zephyr module(s) (Zephyr base): sysbuild_default
-- Found Python3: C:/ncs/toolchains/ce3b5ff664/opt/bin/python.exe (found suitable version "3.9.13", minimum required is "3.8") found components: Interpreter
-- Cache files will be written to: D:/Flipperz/flipper_workspace/zephyr/.cache
-- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
-- Board: thomas_b, qualifiers: nrf52840
Parsing D:/Flipperz/flipper_workspace/zephyr/share/sysbuild/Kconfig
Loaded configuration 'D:/Flipperz/flipper_workspace/app.git/app/build_1/_sysbuild/empty.conf'
Merged configuration 'D:/Flipperz/flipper_workspace/app.git/app/sysbuild.conf'
Configuration saved to 'D:/Flipperz/flipper_workspace/app.git/app/build_1/zephyr/.config'
Kconfig header saved to 'D:/Flipperz/flipper_workspace/app.git/app/build_1/_sysbuild/autoconf.h'
CMake Error at C:/ncs/toolchains/ce3b5ff664/opt/share/cmake-3.21/Modules/ExternalProject.cmake:2866 (message):
No download info given for 'bhi360_ext_fw' and its source directory:
D:/Flipperz/flipper_workspace/app.git/app/build_1/bhi360_ext_fw
is not an existing non-empty directory. Please specify one of:
* SOURCE_DIR with an existing non-empty directory
* DOWNLOAD_COMMAND
* URL
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

cmake doesn't seem to be copying the files from app.git/bhi360_ext_fw into the build folder.

Is this a fault in NCS 2.7 sysbuild that might be fixed if I go to a more recent release?

Is there an existing example of using sysbuild to add an additional image?

What configuration will I need to add for mcuboot to be able to update (one-at-a-time) both the application and the ext_fw partition?