Hello,
we are using an nRF5340-DK board together with SDK 2.4.2.
We want to to integrate the "ble simultaneious boot" feature into our application.
It should be possible to update both images (app-corr / net-net) simultanious via BLE while the
the secondary images resides in external flash.
So we studied the following example:
samples_for_nrf_connect_sdk/bootloader_samples/nrf5340/mcuboot_smp_ble_simultaneous at main · hellesvik-nordic/samples_for_nrf_connect_sdk · GitHub
After modifiyng our application according to this example we get compiler errors:
* Executing task: nRF Connect: Build: BleCan_CAB11A/build (active)
Building BleCan_CAB11A
C:\WINDOWS\system32\cmd.exe /d /s /c "west build --build-dir c:/Projekte/BleCan_CAB11A/build c:/Projekte/BleCan_CAB11A"
[0/34] Performing build step for 'mcuboot_subimage'
[1/21] Building C object CMakeFiles/app.dir/flash_map_extended.c.obj
FAILED: CMakeFiles/app.dir/flash_map_extended.c.obj
C:\DevTools\ncs\toolchains\31f4403e35\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -DKERNEL -DMBEDTLS_CONFIG_FILE=\"mcuboot-mbedtls-cfg.h\" -DNRF5340_XXAA_APPLICATION -DNRF_SKIP_FICR_NS_COPY_TO_RAM -DUSE_PARTITION_MANAGER=1 -D__PROGRAM_START -D__ZEPHYR__=1 -IC:/DevTools/ncs/v2.4.2/bootloader/mcuboot/boot/zephyr/include -IC:/DevTools/ncs/v2.4.2/bootloader/mcuboot/boot/zephyr/targets -IC:/DevTools/ncs/v2.4.2/bootloader/mcuboot/boot/bootutil/include -IC:/DevTools/ncs/v2.4.2/zephyr/include -Izephyr/include/generated -IC:/DevTools/ncs/v2.4.2/zephyr/soc/arm/nordic_nrf/nrf53 -IC:/DevTools/ncs/v2.4.2/zephyr/soc/arm/nordic_nrf/common/. -IC:/DevTools/ncs/v2.4.2/nrf/include -IC:/DevTools/ncs/v2.4.2/nrf/tests/include -IC:/DevTools/ncs/v2.4.2/modules/hal/cmsis/CMSIS/Core/Include -IC:/DevTools/ncs/v2.4.2/modules/hal/nordic/nrfx -IC:/DevTools/ncs/v2.4.2/modules/hal/nordic/nrfx/drivers/include -IC:/DevTools/ncs/v2.4.2/modules/hal/nordic/nrfx/mdk -IC:/DevTools/ncs/v2.4.2/zephyr/modules/hal_nordic/nrfx/. -IC:/DevTools/ncs/v2.4.2/modules/crypto/mbedtls/include -IC:/DevTools/ncs/v2.4.2/modules/crypto/mbedtls/library -IC:/DevTools/ncs/v2.4.2/zephyr/modules/mbedtls/configs -IC:/DevTools/ncs/v2.4.2/zephyr/modules/mbedtls/include -IC:/DevTools/ncs/v2.4.2/bootloader/mcuboot/boot/bootutil/zephyr/.. -IC:/DevTools/ncs/v2.4.2/bootloader/mcuboot/boot/bootutil/zephyr/../include -IC:/DevTools/ncs/v2.4.2/bootloader/mcuboot/boot/bootutil/zephyr/../../zephyr/include -isystem C:/DevTools/ncs/v2.4.2/zephyr/lib/libc/minimal/include -isystem c:/devtools/ncs/toolchains/31f4403e35/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/include -isystem c:/devtools/ncs/toolchains/31f4403e35/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/include-fixed -isystem C:/DevTools/ncs/v2.4.2/nrfxlib/crypto/nrf_cc312_platform/include -fno-strict-aliasing -Os -imacros C:/Projekte/BleCan_CAB11A/build/mcuboot/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m33 -mthumb -mabi=aapcs --sysroot=C:/DevTools/ncs/toolchains/31f4403e35/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros C:/DevTools/ncs/v2.4.2/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=C:/DevTools/ncs/v2.4.2/bootloader/mcuboot/boot/zephyr=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/DevTools/ncs/v2.4.2/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/DevTools/ncs/v2.4.2=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -MD -MT CMakeFiles/app.dir/flash_map_extended.c.obj -MF CMakeFiles\app.dir\flash_map_extended.c.obj.d -o CMakeFiles/app.dir/flash_map_extended.c.obj -c C:/DevTools/ncs/v2.4.2/bootloader/mcuboot/boot/zephyr/flash_map_extended.c
In file included from C:\DevTools\ncs\v2.4.2\bootloader\mcuboot\boot\zephyr\flash_map_extended.c:15:
C:/DevTools/ncs/v2.4.2/bootloader/mcuboot/boot/zephyr/flash_map_extended.c: In function 'flash_area_id_from_multi_image_slot':
C:\DevTools\ncs\v2.4.2\bootloader\mcuboot\boot\zephyr\include\sysflash\sysflash.h:45:12: error: 'PM_MCUBOOT_PRIMARY_1_ID' undeclared (first use in this function); did you mean 'PM_MCUBOOT_PRIMARY_ID'?
45 | PM_MCUBOOT_PRIMARY_1_ID : \
| ^~~~~~~~~~~~~~~~~~~~~~~
C:\DevTools\ncs\v2.4.2\bootloader\mcuboot\boot\zephyr\flash_map_extended.c:54:20: note: in expansion of macro 'FLASH_AREA_IMAGE_PRIMARY'
54 | case 0: return FLASH_AREA_IMAGE_PRIMARY(image_index);
| ^~~~~~~~~~~~~~~~~~~~~~~~
C:\DevTools\ncs\v2.4.2\bootloader\mcuboot\boot\zephyr\include\sysflash\sysflash.h:45:12: note: each undeclared identifier is reported only once for each function it appears in
45 | PM_MCUBOOT_PRIMARY_1_ID : \
| ^~~~~~~~~~~~~~~~~~~~~~~
C:\DevTools\ncs\v2.4.2\bootloader\mcuboot\boot\zephyr\flash_map_extended.c:54:20: note: in expansion of macro 'FLASH_AREA_IMAGE_PRIMARY'
54 | case 0: return FLASH_AREA_IMAGE_PRIMARY(image_index);
| ^~~~~~~~~~~~~~~~~~~~~~~~
C:\DevTools\ncs\v2.4.2\bootloader\mcuboot\boot\zephyr\include\sysflash\sysflash.h:52:12: error: 'PM_MCUBOOT_SECONDARY_1_ID' undeclared (first use in this function); did you mean 'PM_MCUBOOT_SECONDARY_ID'?
52 | PM_MCUBOOT_SECONDARY_1_ID: \
| ^~~~~~~~~~~~~~~~~~~~~~~~~
When comparing the pm.config files of our application (left) and the example (right) we see the missing definitions.
Here is our prj.config:
CONFIG_LOG=y CONFIG_BT=y #CONFIG_BT_DEBUG_LOG=y CONFIG_BT_SMP=y CONFIG_BT_SIGNING=y CONFIG_BT_PERIPHERAL=y #GS CONFIG_BT_DIS=y CONFIG_BT_ATT_PREPARE_COUNT=5 CONFIG_BT_DEVICE_NAME="SEW-??:??:??:??:??:??" CONFIG_BT_DEVICE_APPEARANCE=833 ...Code
Best regards,
Georg