How to enable Serial Recovery mode on the nrf5340_audio application (Sysbuild)?

Hi there,

The nrf5340_audio application provides a -DFILE_SUFFIX=fota overlay that adds FOTA capabilities to the application. This FOTA is introduced via Sysbuild configuration files. This configuration compiles successfully.

Instead of FOTA, I would like to enable Serial Recovery mode with CDC ACM transport.

I have successfully enabled this mode on the nRF5340 with other samples that don't use Sysbuild. I achieved this by following the relevant samples at https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples/serial_recovery. This allows me to update the application and network core with two separate .bin files contained within the dfu_application.zip. I believe this is called non-simultaneous DFU.

However, I can't get the same KConfig options working in Sysbuild in the nrf5340_audio application. 

My file structure is:

sysbuild.conf

Fullscreen
1
2
3
4
# Enable bootloaders for both cores
SB_CONFIG_BOOTLOADER_MCUBOOT=y
SB_CONFIG_SECURE_BOOT_NETCORE=y
SB_CONFIG_NETCORE_APP_UPDATE=y
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

sysbuild/mcuboot.conf
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
CONFIG_MAIN_STACK_SIZE=10240
# Flash
CONFIG_FLASH=y
CONFIG_FPROTECT=y
# MCUBoot serial
CONFIG_MCUBOOT_SERIAL=y
CONFIG_MCUBOOT_SERIAL_DIRECT_IMAGE_UPLOAD=y
# Decrease memory footprint
CONFIG_CBPRINTF_NANO=y
CONFIG_TIMESLICING=n
CONFIG_BOOT_BANNER=n
CONFIG_CONSOLE=n
CONFIG_CONSOLE_HANDLER=n
CONFIG_UART_CONSOLE=n
CONFIG_RTT_CONSOLE=n
CONFIG_USE_SEGGER_RTT=n
CONFIG_LOG=n
CONFIG_RESET_ON_FATAL_ERROR=n
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The build error I am receiving during the building of the final image, mcuboot, is:
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
In file included from /Users/FARLY7/workspace/aura/aura-firmware/bootloader/mcuboot/boot/zephyr/include/sysflash/sysflash.h:10,
from /Users/FARLY7/workspace/aura/aura-firmware/bootloader/mcuboot/boot/bootutil/src/bootutil_priv.h:33,
from /Users/FARLY7/workspace/aura/aura-firmware/bootloader/mcuboot/boot/bootutil/src/tlv.c:24:
/Users/FARLY7/workspace/aura/aura-firmware/bootloader/mcuboot/boot/zephyr/include/sysflash/pm_sysflash.h: In function '__flash_area_ids_for_slot':
/Users/FARLY7/workspace/aura/aura-firmware/bootloader/mcuboot/boot/zephyr/include/sysflash/pm_sysflash.h:48:62: error: 'PM_MCUBOOT_SECONDARY_1_ID' undeclared (first use in this function); did you mean 'PM_MCUBOOT_SECONDARY_ID'?
48 | #define FLASH_AREA_IMAGE_1_SLOTS PM_MCUBOOT_PRIMARY_1_ID, PM_MCUBOOT_SECONDARY_1_ID
| ^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/FARLY7/workspace/aura/aura-firmware/bootloader/mcuboot/boot/zephyr/include/sysflash/pm_sysflash.h:55:29: note: in expansion of macro 'FLASH_AREA_IMAGE_1_SLOTS'
55 | FLASH_AREA_IMAGE_1_SLOTS
| ^~~~~~~~~~~~~~~~~~~~~~~~
/Users/FARLY7/workspace/aura/aura-firmware/bootloader/mcuboot/boot/zephyr/include/sysflash/pm_sysflash.h:67:9: note: in expansion of macro 'ALL_AVAILABLE_SLOTS'
67 | ALL_AVAILABLE_SLOTS
| ^~~~~~~~~~~~~~~~~~~
/Users/FARLY7/workspace/aura/aura-firmware/bootloader/mcuboot/boot/zephyr/include/sysflash/pm_sysflash.h:48:62: note: each undeclared identifier is reported only once for each function it appears in
48 | #define FLASH_AREA_IMAGE_1_SLOTS PM_MCUBOOT_PRIMARY_1_ID, PM_MCUBOOT_SECONDARY_1_ID
| ^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/FARLY7/workspace/aura/aura-firmware/bootloader/mcuboot/boot/zephyr/include/sysflash/pm_sysflash.h:55:29: note: in expansion of macro 'FLASH_AREA_IMAGE_1_SLOTS'
55 | FLASH_AREA_IMAGE_1_SLOTS
| ^~~~~~~~~~~~~~~~~~~~~~~~
/Users/FARLY7/workspace/aura/aura-firmware/bootloader/mcuboot/boot/zephyr/include/sysflash/pm_sysflash.h:67:9: note: in expansion of macro 'ALL_AVAILABLE_SLOTS'
67 | ALL_AVAILABLE_SLOTS
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
It seems the error is perhaps related to partitions and slots, so I think there is a missing/wrong KConfig option or something not taking effect?
Thanks a lot,
Sean