Can not compile Matter examples for XIAO BLE board with p25q16h flash chip due to external flash partition errors.

Hi,

I am trying to develop a matter device, using the XIAO BLE module, which features a p25q16h external flash chip, rather than the mx25r64 present in the DK.  I was able to get it running on the DK, but when I try to create a new board, the build for mcuboot complains about not being able to find the secondary partition.  Looking into what is going on I see that `build/partitions.yml` never gets the partitions written that have been specified in the pm_static.yml file. based upon  https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/scripts/partition_manager/partition_manager.html#external-flash-memory-partitions, it seems that if It doesn't think I have the right drivers installed, it will silently omit the partition from the generated files, which is what is happening.

From what I understand, this flash is operating on QSPI just like the DK, its just a different chip.  I've trawled through the board definitions of the DK and the xiao_ble device, but I can't work out what I need to to do get the flash partitions working. I have tried specifying CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y, and I have tried messing with the partition map file and I have tried pretending the device is still a mx25r64.  nothing seems to make any difference. 

FYI, the xiao_ble board definition is part of the nrf connect toolkit, but I have chosen to specify my own board (named xiao_module) instead so that I don't need to override all the KConfig options it specifies for its arduino bootloader.  I have attempted to take the right components from both the DK and the xiao_ble definitions to get what I want.  I have confirmed that the board definition works with other projects (e.g. blinky, flashed via a JLINK probe over SWD) that don't use the partition manager.  

I've attached a log of a build, but its clear I'm not specifying my flash driver properly. 

I've also uploaded my codebase to https://github.com/brucejcooper/nrf_test - The package I'm attempting to build is 'light_bulb', and my board definition is in boards/arm/xiao_module. 

I'm hoping somebody will be able to help me diagnose what I'm doing wrong.  I understand what is going wrong but I don't understand how to fix it.

Thanks.

 *  Executing task: nRF Connect: Generate config xiao_module for light_bulb 

Building light_bulb
/bin/sh -c west build --build-dir /home/bruce/dev/lightbulb/light_bulb/build /home/bruce/dev/lightbulb/light_bulb --pristine --board xiao_module --no-sysbuild -- -DNCS_TOOLCHAIN_VERSION:STRING="NONE" -DCONF_FILE:STRING="/home/bruce/dev/lightbulb/light_bulb/prj.conf" -DBOARD_ROOT:STRING="/home/bruce/dev/lightbulb"

-- west build: generating a build system
Loading Zephyr default modules (Zephyr base).
-- Application: /home/bruce/dev/lightbulb/light_bulb
-- CMake version: 3.20.5
-- Found Python3: /usr/bin/python3.10 (found suitable exact version "3.10.12") found components: Interpreter 
-- Cache files will be written to: /home/bruce/.cache/zephyr
-- Zephyr version: 3.3.99 (/home/bruce/ncs/v2.4.1/zephyr)
-- Found west (found suitable version "0.13.1", minimum required is "0.7.1")
-- Board: xiao_module
-- Found toolchain: gnuarmemb (/opt/gnuarmemb)
-- Found Dtc: /usr/bin/dtc (found suitable version "1.6.1", minimum required is "1.4.6") 
-- Found BOARD.dts: /home/bruce/dev/lightbulb/boards/arm/xiao_module/xiao_module.dts
-- Generated zephyr.dts: /home/bruce/dev/lightbulb/light_bulb/build/zephyr/zephyr.dts
-- Generated devicetree_generated.h: /home/bruce/dev/lightbulb/light_bulb/build/zephyr/include/generated/devicetree_generated.h
-- Including generated dts.cmake file: /home/bruce/dev/lightbulb/light_bulb/build/zephyr/dts.cmake

warning: Deprecated symbol CPLUSPLUS is enabled.


warning: Deprecated symbol LIB_CPLUSPLUS is enabled.

Parsing /home/bruce/dev/lightbulb/light_bulb/Kconfig
Loaded configuration '/home/bruce/dev/lightbulb/boards/arm/xiao_module/xiao_module_defconfig'
Merged configuration '/home/bruce/dev/lightbulb/light_bulb/prj.conf'
Configuration saved to '/home/bruce/dev/lightbulb/light_bulb/build/zephyr/.config'
Kconfig header saved to '/home/bruce/dev/lightbulb/light_bulb/build/zephyr/include/generated/autoconf.h'
-- Found GnuLd: /opt/gnuarmemb/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.bfd (found version "2.33.1") 
-- The C compiler identification is GNU 9.2.1
-- The CXX compiler identification is GNU 9.2.1
-- The ASM compiler identification is GNU
-- Found assembler: /opt/gnuarmemb/bin/arm-none-eabi-gcc
-- Found Python3: /usr/bin/python3.10 (found version "3.10.12") found components: Interpreter 

=== child image mcuboot -  begin ===
loading initial cache file /home/bruce/dev/lightbulb/light_bulb/build/mcuboot/child_image_preload.cmake
Loading Zephyr default modules (Zephyr base).
-- Application: /home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr
-- CMake version: 3.20.5
-- Found Python3: /usr/bin/python3.10 (found suitable exact version "3.10.12") found components: Interpreter 
-- Cache files will be written to: /home/bruce/.cache/zephyr
-- Zephyr version: 3.3.99 (/home/bruce/ncs/v2.4.1/zephyr)
-- Found west (found suitable version "0.13.1", minimum required is "0.7.1")
-- Board: xiao_module
-- Found toolchain: gnuarmemb (/opt/gnuarmemb)
-- Found Dtc: /usr/bin/dtc (found suitable version "1.6.1", minimum required is "1.4.6") 
-- Found BOARD.dts: /home/bruce/dev/lightbulb/boards/arm/xiao_module/xiao_module.dts
-- Found devicetree overlay: /home/bruce/ncs/v2.4.1/nrf/modules/mcuboot/usb.overlay
-- Found devicetree overlay: /home/bruce/dev/lightbulb/light_bulb/child_image/mcuboot/boards/xiao_module.overlay
-- Generated zephyr.dts: /home/bruce/dev/lightbulb/light_bulb/build/mcuboot/zephyr/zephyr.dts
-- Generated devicetree_generated.h: /home/bruce/dev/lightbulb/light_bulb/build/mcuboot/zephyr/include/generated/devicetree_generated.h
-- Including generated dts.cmake file: /home/bruce/dev/lightbulb/light_bulb/build/mcuboot/zephyr/dts.cmake
Parsing /home/bruce/ncs/v2.4.1/modules/lib/matter/config/nrfconnect/chip-module/Kconfig.mcuboot.root
Loaded configuration '/home/bruce/dev/lightbulb/boards/arm/xiao_module/xiao_module_defconfig'
Merged configuration '/home/bruce/dev/lightbulb/light_bulb/child_image/mcuboot/prj.conf'
Merged configuration '/home/bruce/dev/lightbulb/light_bulb/child_image/mcuboot/boards/xiao_module.conf'
Merged configuration '/home/bruce/ncs/v2.4.1/nrf/subsys/partition_manager/partition_manager_enabled.conf'
Merged configuration '/home/bruce/dev/lightbulb/light_bulb/build/mcuboot/zephyr/misc/generated/extra_kconfig_options.conf'
Configuration saved to '/home/bruce/dev/lightbulb/light_bulb/build/mcuboot/zephyr/.config'
Kconfig header saved to '/home/bruce/dev/lightbulb/light_bulb/build/mcuboot/zephyr/include/generated/autoconf.h'
-- Found GnuLd: /opt/gnuarmemb/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.bfd (found version "2.33.1") 
-- The C compiler identification is GNU 9.2.1
-- The CXX compiler identification is GNU 9.2.1
-- The ASM compiler identification is GNU
-- Found assembler: /opt/gnuarmemb/bin/arm-none-eabi-gcc
CMake Warning at /home/bruce/ncs/v2.4.1/nrf/lib/flash_patch/CMakeLists.txt:8 (message):
  

        ----------------------------------------------------------
        --- WARNING: To maintain the integrity of secure boot, ---
        --- enable CONFIG_DISABLE_FLASH_PATCH in production.   ---
        ----------------------------------------------------------


CMake Warning at /home/bruce/ncs/v2.4.1/zephyr/CMakeLists.txt:839 (message):
  No SOURCES given to Zephyr library: lib__libc__common

  Excluding target from build.


MCUBoot bootloader key file: /home/bruce/ncs/v2.4.1/bootloader/mcuboot/root-ec-p256.pem
-- Configuring done
-- Generating done
-- Build files have been written to: /home/bruce/dev/lightbulb/light_bulb/build/mcuboot
=== child image mcuboot -  end ===

CMake Warning at /home/bruce/ncs/v2.4.1/nrf/modules/mcuboot/CMakeLists.txt:310 (message):
  

          ---------------------------------------------------------
          --- WARNING: Using default MCUBoot key, it should not ---
          --- be used for production.                           ---
          ---------------------------------------------------------
          



CMake Warning at /home/bruce/ncs/v2.4.1/nrfxlib/openthread/cmake/extensions.cmake:113 (message):
   
   Current nrf_security configuration does not provide all MBEDTLS options which are required by precompiled OpenThread libraries.
   The minimum of MBEDTLS configuration is stored at: /home/bruce/ncs/v2.4.1/nrfxlib/openthread/lib/cortex-m4/hard-float/v1.3/ftd/oberon/nrf_security_mbedtls_configuration.h

Call Stack (most recent call first):
  /home/bruce/ncs/v2.4.1/nrfxlib/openthread/CMakeLists.txt:82 (check_openthread_dependencies)


CMake Warning at /home/bruce/ncs/v2.4.1/zephyr/CMakeLists.txt:839 (message):
  No SOURCES given to Zephyr library: lib__libc__common

  Excluding target from build.


CMake Warning at /home/bruce/ncs/v2.4.1/zephyr/CMakeLists.txt:1865 (message):
  __ASSERT() statements are globally ENABLED


-- Found partition manager static configuration: /home/bruce/dev/lightbulb/light_bulb/configuration/xiao_module/pm_static_dfu.yml
Partition 'mcuboot' is not included in the dynamic resolving since it is statically defined.
Partition 'mcuboot_pad' is not included in the dynamic resolving since it is statically defined.
Partition 'mcuboot_primary' is not included in the dynamic resolving since it is statically defined.
Partition 'mcuboot_primary_app' is not included in the dynamic resolving since it is statically defined.
Partition 'settings_storage' is not included in the dynamic resolving since it is statically defined.
Partition 'mcuboot_secondary' is not included in the dynamic resolving since it is statically defined.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/bruce/dev/lightbulb/light_bulb/build
-- west build: building application
[1/522] Preparing syscall dependency handling

[2/522] Creating directories for 'mcuboot_subimage'
[3/522] Generating include/generated/version.h
-- Zephyr version: 3.3.99 (/home/bruce/ncs/v2.4.1/zephyr), build: v3.3.99-ncs1-1
[4/522] No download step for 'mcuboot_subimage'
[5/522] No update step for 'mcuboot_subimage'
[6/522] No patch step for 'mcuboot_subimage'
[7/522] No configure step for 'mcuboot_subimage'
[7/522] Performing build step for 'mcuboot_subimage'
[1/179] Preparing syscall dependency handling

[2/179] Generating include/generated/version.h
-- Zephyr version: 3.3.99 (/home/bruce/ncs/v2.4.1/zephyr), build: v3.3.99-ncs1-1
[3/179] Generating misc/generated/syscalls_subdirs.trigger
[4/179] Generating misc/generated/syscalls.json, misc/generated/struct_tags.json
[5/179] Generating include/generated/syscall_dispatch.c, include/generated/syscall_list.h
[6/179] Generating include/generated/driver-validation.h
[7/179] Generating include/generated/kobj-types-enum.h, include/generated/otype-to-str.h, include/generated/otype-to-size.h
[8/179] Building C object zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj
[9/179] Generating include/generated/offsets.h
[10/179] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/dec.c.obj
[11/179] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/hex.c.obj
[12/179] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/timeutil.c.obj
[13/179] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/multi_heap.c.obj
[14/179] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf_packaged.c.obj
[15/179] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/printk.c.obj
[16/179] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/rb.c.obj
[17/179] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/sem.c.obj
[18/179] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/bitarray.c.obj
[19/179] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc32c_sw.c.obj
[20/179] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc32_sw.c.obj
[21/179] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc16_sw.c.obj
[22/179] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc8_sw.c.obj
[23/179] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/fdtable.c.obj
[24/179] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/thread_entry.c.obj
[25/179] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/heap.c.obj
[26/179] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/heap-validate.c.obj
[27/179] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/notify.c.obj
[28/179] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc7_sw.c.obj
[29/179] Building C object zephyr/CMakeFiles/zephyr.dir/misc/generated/configs.c.obj
[30/179] Building ASM object zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/common/soc_nrf_common.S.obj
[31/179] Generating zephyr/autogen-pubkey.c
[32/179] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/onoff.c.obj
[33/179] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf_complete.c.obj
[34/179] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf.c.obj
[35/179] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/storage/flash_map/flash_map.c.obj
[36/179] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/storage/flash_map/flash_map_layout.c.obj
[37/179] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/tracing/tracing_none.c.obj
[38/179] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/assert.c.obj
[39/179] Building C object zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/validate_enabled_instances.c.obj
[40/179] Building C object zephyr/CMakeFiles/zephyr.dir/home/bruce/ncs/v2.4.1/nrf/subsys/partition_manager/flash_map_partition_manager.c.obj
[41/179] Generating linker_zephyr_pre0.cmd
[42/179] Generating linker_zephyr_pre1.cmd
[43/179] Building C object zephyr/arch/common/CMakeFiles/isr_tables.dir/isr_tables.c.obj
[44/179] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/cpu_idle.S.obj
[45/179] Building C object zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/validate_base_addresses.c.obj
[46/179] Building C object zephyr/CMakeFiles/zephyr.dir/home/bruce/ncs/v2.4.1/nrfxlib/crypto/nrf_cc310_platform/src/nrf_cc3xx_platform_abort_zephyr.c.obj
[47/179] Building C object zephyr/CMakeFiles/zephyr.dir/home/bruce/ncs/v2.4.1/nrfxlib/crypto/nrf_cc310_platform/src/nrf_cc3xx_platform_no_mutex_zephyr.c.obj
[48/179] Building C object zephyr/arch/common/CMakeFiles/arch__common.dir/sw_isr_common.c.obj
[49/179] Building C object CMakeFiles/app.dir/os.c.obj
[50/179] Building C object CMakeFiles/app.dir/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/image_validate.c.obj
[51/179] Building C object CMakeFiles/app.dir/keys.c.obj
[52/179] Building C object CMakeFiles/app.dir/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/tlv.c.obj
[53/179] Building C object CMakeFiles/app.dir/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/encrypted.c.obj
[54/179] Building C object CMakeFiles/app.dir/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/fault_injection_hardening.c.obj
[55/179] Building C object CMakeFiles/app.dir/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/image_ed25519.c.obj
[56/179] Building C object CMakeFiles/app.dir/home/bruce/ncs/v2.4.1/bootloader/mcuboot/ext/mbedtls-asn1/src/platform_util.c.obj
[57/179] Building C object CMakeFiles/app.dir/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/image_rsa.c.obj
[58/179] Building C object CMakeFiles/app.dir/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/image_ec256.c.obj
[59/179] Building C object CMakeFiles/app.dir/home/bruce/ncs/v2.4.1/bootloader/mcuboot/ext/mbedtls-asn1/src/asn1parse.c.obj
[60/179] Building C object CMakeFiles/app.dir/zephyr/autogen-pubkey.c.obj
[61/179] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/nmi_on_reset.S.obj
[62/179] Linking C static library zephyr/libzephyr.a
[63/179] Building C object CMakeFiles/app.dir/main.c.obj
[64/179] Building C object CMakeFiles/app.dir/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/swap_scratch.c.obj
[65/179] Linking C static library zephyr/arch/common/libisr_tables.a
[66/179] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/swap_helper.S.obj
[67/179] Building C object CMakeFiles/app.dir/home/bruce/ncs/v2.4.1/bootloader/mcuboot/ext/nrf/cc310_glue.c.obj
[68/179] Building C object CMakeFiles/app.dir/nrf_cleanup.c.obj
[69/179] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/prep_c.c.obj
[70/179] Building C object CMakeFiles/app.dir/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/caps.c.obj
[71/179] Building C object CMakeFiles/app.dir/arm_cleanup.c.obj
[72/179] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/irq_manage.c.obj
[73/179] Linking C static library zephyr/arch/common/libarch__common.a
[74/179] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/fault_s.S.obj
[75/179] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/nmi.c.obj
[76/179] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/swap.c.obj
[77/179] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/isr_wrapper.S.obj
[78/179] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/exc_exit.S.obj
[79/179] Building C object CMakeFiles/app.dir/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/bootutil_misc.c.obj
FAILED: CMakeFiles/app.dir/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/bootutil_misc.c.obj 
ccache /opt/gnuarmemb/bin/arm-none-eabi-gcc -DKERNEL -DMBEDTLS_CONFIG_FILE=\"/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr/include/mcuboot-mbedtls-cfg.h\" -DNRF52840_XXAA -DUSE_PARTITION_MANAGER=1 -D__PROGRAM_START -D__ZEPHYR__=1 -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr/include -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr/targets -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/include -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/ext/mbedtls-asn1/include -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/ext/nrf -I/home/bruce/ncs/v2.4.1/zephyr/include -Izephyr/include/generated -I/home/bruce/ncs/v2.4.1/zephyr/soc/arm/nordic_nrf/nrf52 -I/home/bruce/ncs/v2.4.1/zephyr/soc/arm/nordic_nrf/common/. -I/home/bruce/ncs/v2.4.1/nrf/include -I/home/bruce/ncs/v2.4.1/nrf/tests/include -I/home/bruce/ncs/v2.4.1/modules/hal/cmsis/CMSIS/Core/Include -I/home/bruce/ncs/v2.4.1/modules/hal/nordic/nrfx -I/home/bruce/ncs/v2.4.1/modules/hal/nordic/nrfx/drivers/include -I/home/bruce/ncs/v2.4.1/modules/hal/nordic/nrfx/mdk -I/home/bruce/ncs/v2.4.1/zephyr/modules/hal_nordic/nrfx/. -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/zephyr/.. -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/zephyr/../include -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/zephyr/../../zephyr/include -I/home/bruce/ncs/v2.4.1/nrfxlib/crypto/nrf_cc310_bl/include -isystem /home/bruce/ncs/v2.4.1/zephyr/lib/libc/minimal/include -isystem /opt/gnuarmemb/bin/../lib/gcc/arm-none-eabi/9.2.1/include -isystem /opt/gnuarmemb/bin/../lib/gcc/arm-none-eabi/9.2.1/include-fixed -isystem /home/bruce/ncs/v2.4.1/nrfxlib/crypto/nrf_cc310_platform/include -fno-strict-aliasing -Os -imacros /home/bruce/dev/lightbulb/light_bulb/build/mcuboot/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfpu=fpv4-sp-d16 -mfloat-abi=hard --sysroot=/opt/gnuarmemb/arm-none-eabi -imacros /home/bruce/ncs/v2.4.1/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 -fno-defer-pop -fmacro-prefix-map=/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr=CMAKE_SOURCE_DIR -fmacro-prefix-map=/home/bruce/ncs/v2.4.1/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/home/bruce/ncs/v2.4.1=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -MD -MT CMakeFiles/app.dir/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/bootutil_misc.c.obj -MF CMakeFiles/app.dir/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/bootutil_misc.c.obj.d -o CMakeFiles/app.dir/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/bootutil_misc.c.obj -c /home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/bootutil_misc.c
In file included from /home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/bootutil_misc.c:32:
/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/bootutil_misc.c: In function 'boot_status_entries':
/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr/include/sysflash/sysflash.h:15:40: error: 'PM_MCUBOOT_SECONDARY_ID' undeclared (first use in this function); did you mean 'PM_MCUBOOT_PRIMARY_ID'?
   15 | #define FLASH_AREA_IMAGE_SECONDARY(x)  PM_MCUBOOT_SECONDARY_ID
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~
/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/bootutil_misc.c:161:35: note: in expansion of macro 'FLASH_AREA_IMAGE_SECONDARY'
  161 |         flash_area_get_id(fap) == FLASH_AREA_IMAGE_SECONDARY(image_index)) {
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr/include/sysflash/sysflash.h:15:40: note: each undeclared identifier is reported only once for each function it appears in
   15 | #define FLASH_AREA_IMAGE_SECONDARY(x)  PM_MCUBOOT_SECONDARY_ID
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~
/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/bootutil_misc.c:161:35: note: in expansion of macro 'FLASH_AREA_IMAGE_SECONDARY'
  161 |         flash_area_get_id(fap) == FLASH_AREA_IMAGE_SECONDARY(image_index)) {
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
[80/179] Building C object CMakeFiles/app.dir/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/loader.c.obj
FAILED: CMakeFiles/app.dir/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/loader.c.obj 
ccache /opt/gnuarmemb/bin/arm-none-eabi-gcc -DKERNEL -DMBEDTLS_CONFIG_FILE=\"/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr/include/mcuboot-mbedtls-cfg.h\" -DNRF52840_XXAA -DUSE_PARTITION_MANAGER=1 -D__PROGRAM_START -D__ZEPHYR__=1 -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr/include -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr/targets -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/include -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/ext/mbedtls-asn1/include -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/ext/nrf -I/home/bruce/ncs/v2.4.1/zephyr/include -Izephyr/include/generated -I/home/bruce/ncs/v2.4.1/zephyr/soc/arm/nordic_nrf/nrf52 -I/home/bruce/ncs/v2.4.1/zephyr/soc/arm/nordic_nrf/common/. -I/home/bruce/ncs/v2.4.1/nrf/include -I/home/bruce/ncs/v2.4.1/nrf/tests/include -I/home/bruce/ncs/v2.4.1/modules/hal/cmsis/CMSIS/Core/Include -I/home/bruce/ncs/v2.4.1/modules/hal/nordic/nrfx -I/home/bruce/ncs/v2.4.1/modules/hal/nordic/nrfx/drivers/include -I/home/bruce/ncs/v2.4.1/modules/hal/nordic/nrfx/mdk -I/home/bruce/ncs/v2.4.1/zephyr/modules/hal_nordic/nrfx/. -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/zephyr/.. -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/zephyr/../include -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/zephyr/../../zephyr/include -I/home/bruce/ncs/v2.4.1/nrfxlib/crypto/nrf_cc310_bl/include -isystem /home/bruce/ncs/v2.4.1/zephyr/lib/libc/minimal/include -isystem /opt/gnuarmemb/bin/../lib/gcc/arm-none-eabi/9.2.1/include -isystem /opt/gnuarmemb/bin/../lib/gcc/arm-none-eabi/9.2.1/include-fixed -isystem /home/bruce/ncs/v2.4.1/nrfxlib/crypto/nrf_cc310_platform/include -fno-strict-aliasing -Os -imacros /home/bruce/dev/lightbulb/light_bulb/build/mcuboot/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfpu=fpv4-sp-d16 -mfloat-abi=hard --sysroot=/opt/gnuarmemb/arm-none-eabi -imacros /home/bruce/ncs/v2.4.1/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 -fno-defer-pop -fmacro-prefix-map=/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr=CMAKE_SOURCE_DIR -fmacro-prefix-map=/home/bruce/ncs/v2.4.1/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/home/bruce/ncs/v2.4.1=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -MD -MT CMakeFiles/app.dir/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/loader.c.obj -MF CMakeFiles/app.dir/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/loader.c.obj.d -o CMakeFiles/app.dir/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/loader.c.obj -c /home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/loader.c
In file included from /home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/bootutil_priv.h:33,
                 from /home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/loader.c:41:
/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/loader.c: In function 'boot_initialize_area':
/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr/include/sysflash/sysflash.h:15:40: error: 'PM_MCUBOOT_SECONDARY_ID' undeclared (first use in this function); did you mean 'PM_MCUBOOT_PRIMARY_ID'?
   15 | #define FLASH_AREA_IMAGE_SECONDARY(x)  PM_MCUBOOT_SECONDARY_ID
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~
/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/loader.c:341:30: note: in expansion of macro 'FLASH_AREA_IMAGE_SECONDARY'
  341 |     } else if (flash_area == FLASH_AREA_IMAGE_SECONDARY(BOOT_CURR_IMG(state))) {
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr/include/sysflash/sysflash.h:15:40: note: each undeclared identifier is reported only once for each function it appears in
   15 | #define FLASH_AREA_IMAGE_SECONDARY(x)  PM_MCUBOOT_SECONDARY_ID
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~
/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/loader.c:341:30: note: in expansion of macro 'FLASH_AREA_IMAGE_SECONDARY'
  341 |     } else if (flash_area == FLASH_AREA_IMAGE_SECONDARY(BOOT_CURR_IMG(state))) {
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/loader.c: In function 'boot_read_sectors':
/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr/include/sysflash/sysflash.h:15:40: error: 'PM_MCUBOOT_SECONDARY_ID' undeclared (first use in this function); did you mean 'PM_MCUBOOT_PRIMARY_ID'?
   15 | #define FLASH_AREA_IMAGE_SECONDARY(x)  PM_MCUBOOT_SECONDARY_ID
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~
/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/loader.c:385:38: note: in expansion of macro 'FLASH_AREA_IMAGE_SECONDARY'
  385 |     rc = boot_initialize_area(state, FLASH_AREA_IMAGE_SECONDARY(image_index));
      |                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~
[81/179] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/fatal.c.obj
[82/179] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/thread.c.obj
[83/179] Building C object CMakeFiles/app.dir/flash_map_extended.c.obj
FAILED: CMakeFiles/app.dir/flash_map_extended.c.obj 
ccache /opt/gnuarmemb/bin/arm-none-eabi-gcc -DKERNEL -DMBEDTLS_CONFIG_FILE=\"/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr/include/mcuboot-mbedtls-cfg.h\" -DNRF52840_XXAA -DUSE_PARTITION_MANAGER=1 -D__PROGRAM_START -D__ZEPHYR__=1 -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr/include -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr/targets -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/include -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/ext/mbedtls-asn1/include -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/ext/nrf -I/home/bruce/ncs/v2.4.1/zephyr/include -Izephyr/include/generated -I/home/bruce/ncs/v2.4.1/zephyr/soc/arm/nordic_nrf/nrf52 -I/home/bruce/ncs/v2.4.1/zephyr/soc/arm/nordic_nrf/common/. -I/home/bruce/ncs/v2.4.1/nrf/include -I/home/bruce/ncs/v2.4.1/nrf/tests/include -I/home/bruce/ncs/v2.4.1/modules/hal/cmsis/CMSIS/Core/Include -I/home/bruce/ncs/v2.4.1/modules/hal/nordic/nrfx -I/home/bruce/ncs/v2.4.1/modules/hal/nordic/nrfx/drivers/include -I/home/bruce/ncs/v2.4.1/modules/hal/nordic/nrfx/mdk -I/home/bruce/ncs/v2.4.1/zephyr/modules/hal_nordic/nrfx/. -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/zephyr/.. -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/zephyr/../include -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/zephyr/../../zephyr/include -I/home/bruce/ncs/v2.4.1/nrfxlib/crypto/nrf_cc310_bl/include -isystem /home/bruce/ncs/v2.4.1/zephyr/lib/libc/minimal/include -isystem /opt/gnuarmemb/bin/../lib/gcc/arm-none-eabi/9.2.1/include -isystem /opt/gnuarmemb/bin/../lib/gcc/arm-none-eabi/9.2.1/include-fixed -isystem /home/bruce/ncs/v2.4.1/nrfxlib/crypto/nrf_cc310_platform/include -fno-strict-aliasing -Os -imacros /home/bruce/dev/lightbulb/light_bulb/build/mcuboot/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfpu=fpv4-sp-d16 -mfloat-abi=hard --sysroot=/opt/gnuarmemb/arm-none-eabi -imacros /home/bruce/ncs/v2.4.1/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 -fno-defer-pop -fmacro-prefix-map=/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr=CMAKE_SOURCE_DIR -fmacro-prefix-map=/home/bruce/ncs/v2.4.1/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/home/bruce/ncs/v2.4.1=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 /home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr/flash_map_extended.c
In file included from /home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr/flash_map_extended.c:15:
/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr/flash_map_extended.c: In function 'flash_area_id_from_multi_image_slot':
/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr/include/sysflash/sysflash.h:15:40: error: 'PM_MCUBOOT_SECONDARY_ID' undeclared (first use in this function); did you mean 'PM_MCUBOOT_PRIMARY_ID'?
   15 | #define FLASH_AREA_IMAGE_SECONDARY(x)  PM_MCUBOOT_SECONDARY_ID
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~
/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr/flash_map_extended.c:56:20: note: in expansion of macro 'FLASH_AREA_IMAGE_SECONDARY'
   56 |     case 1: return FLASH_AREA_IMAGE_SECONDARY(image_index);
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr/include/sysflash/sysflash.h:15:40: note: each undeclared identifier is reported only once for each function it appears in
   15 | #define FLASH_AREA_IMAGE_SECONDARY(x)  PM_MCUBOOT_SECONDARY_ID
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~
/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr/flash_map_extended.c:56:20: note: in expansion of macro 'FLASH_AREA_IMAGE_SECONDARY'
   56 |     case 1: return FLASH_AREA_IMAGE_SECONDARY(image_index);
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr/flash_map_extended.c: In function 'flash_area_id_to_multi_image_slot':
/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr/include/sysflash/sysflash.h:15:40: error: 'PM_MCUBOOT_SECONDARY_ID' undeclared (first use in this function); did you mean 'PM_MCUBOOT_PRIMARY_ID'?
   15 | #define FLASH_AREA_IMAGE_SECONDARY(x)  PM_MCUBOOT_SECONDARY_ID
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~
/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr/flash_map_extended.c:77:20: note: in expansion of macro 'FLASH_AREA_IMAGE_SECONDARY'
   77 |     if (area_id == FLASH_AREA_IMAGE_SECONDARY(image_index)) {
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~
[84/179] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/vector_table.S.obj
[85/179] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/irq_init.c.obj
[86/179] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/reset.S.obj
[87/179] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/thread_abort.c.obj
[88/179] Building C object CMakeFiles/app.dir/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/swap_misc.c.obj
FAILED: CMakeFiles/app.dir/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/swap_misc.c.obj 
ccache /opt/gnuarmemb/bin/arm-none-eabi-gcc -DKERNEL -DMBEDTLS_CONFIG_FILE=\"/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr/include/mcuboot-mbedtls-cfg.h\" -DNRF52840_XXAA -DUSE_PARTITION_MANAGER=1 -D__PROGRAM_START -D__ZEPHYR__=1 -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr/include -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr/targets -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/include -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/ext/mbedtls-asn1/include -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/ext/nrf -I/home/bruce/ncs/v2.4.1/zephyr/include -Izephyr/include/generated -I/home/bruce/ncs/v2.4.1/zephyr/soc/arm/nordic_nrf/nrf52 -I/home/bruce/ncs/v2.4.1/zephyr/soc/arm/nordic_nrf/common/. -I/home/bruce/ncs/v2.4.1/nrf/include -I/home/bruce/ncs/v2.4.1/nrf/tests/include -I/home/bruce/ncs/v2.4.1/modules/hal/cmsis/CMSIS/Core/Include -I/home/bruce/ncs/v2.4.1/modules/hal/nordic/nrfx -I/home/bruce/ncs/v2.4.1/modules/hal/nordic/nrfx/drivers/include -I/home/bruce/ncs/v2.4.1/modules/hal/nordic/nrfx/mdk -I/home/bruce/ncs/v2.4.1/zephyr/modules/hal_nordic/nrfx/. -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/zephyr/.. -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/zephyr/../include -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/zephyr/../../zephyr/include -I/home/bruce/ncs/v2.4.1/nrfxlib/crypto/nrf_cc310_bl/include -isystem /home/bruce/ncs/v2.4.1/zephyr/lib/libc/minimal/include -isystem /opt/gnuarmemb/bin/../lib/gcc/arm-none-eabi/9.2.1/include -isystem /opt/gnuarmemb/bin/../lib/gcc/arm-none-eabi/9.2.1/include-fixed -isystem /home/bruce/ncs/v2.4.1/nrfxlib/crypto/nrf_cc310_platform/include -fno-strict-aliasing -Os -imacros /home/bruce/dev/lightbulb/light_bulb/build/mcuboot/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfpu=fpv4-sp-d16 -mfloat-abi=hard --sysroot=/opt/gnuarmemb/arm-none-eabi -imacros /home/bruce/ncs/v2.4.1/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 -fno-defer-pop -fmacro-prefix-map=/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr=CMAKE_SOURCE_DIR -fmacro-prefix-map=/home/bruce/ncs/v2.4.1/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/home/bruce/ncs/v2.4.1=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -MD -MT CMakeFiles/app.dir/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/swap_misc.c.obj -MF CMakeFiles/app.dir/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/swap_misc.c.obj.d -o CMakeFiles/app.dir/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/swap_misc.c.obj -c /home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/swap_misc.c
In file included from /home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/bootutil_priv.h:33,
                 from /home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/swap_misc.c:25:
/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/swap_misc.c: In function 'swap_status_init':
/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr/include/sysflash/sysflash.h:15:40: error: 'PM_MCUBOOT_SECONDARY_ID' undeclared (first use in this function); did you mean 'PM_MCUBOOT_PRIMARY_ID'?
   15 | #define FLASH_AREA_IMAGE_SECONDARY(x)  PM_MCUBOOT_SECONDARY_ID
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~
/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/swap_misc.c:99:37: note: in expansion of macro 'FLASH_AREA_IMAGE_SECONDARY'
   99 |     rc = boot_read_swap_state_by_id(FLASH_AREA_IMAGE_SECONDARY(image_index),
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr/include/sysflash/sysflash.h:15:40: note: each undeclared identifier is reported only once for each function it appears in
   15 | #define FLASH_AREA_IMAGE_SECONDARY(x)  PM_MCUBOOT_SECONDARY_ID
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~
/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/swap_misc.c:99:37: note: in expansion of macro 'FLASH_AREA_IMAGE_SECONDARY'
   99 |     rc = boot_read_swap_state_by_id(FLASH_AREA_IMAGE_SECONDARY(image_index),
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~
[89/179] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/fpu.c.obj
[90/179] Building C object CMakeFiles/app.dir/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/swap_move.c.obj
FAILED: CMakeFiles/app.dir/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/swap_move.c.obj 
ccache /opt/gnuarmemb/bin/arm-none-eabi-gcc -DKERNEL -DMBEDTLS_CONFIG_FILE=\"/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr/include/mcuboot-mbedtls-cfg.h\" -DNRF52840_XXAA -DUSE_PARTITION_MANAGER=1 -D__PROGRAM_START -D__ZEPHYR__=1 -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr/include -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr/targets -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/include -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/ext/mbedtls-asn1/include -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/ext/nrf -I/home/bruce/ncs/v2.4.1/zephyr/include -Izephyr/include/generated -I/home/bruce/ncs/v2.4.1/zephyr/soc/arm/nordic_nrf/nrf52 -I/home/bruce/ncs/v2.4.1/zephyr/soc/arm/nordic_nrf/common/. -I/home/bruce/ncs/v2.4.1/nrf/include -I/home/bruce/ncs/v2.4.1/nrf/tests/include -I/home/bruce/ncs/v2.4.1/modules/hal/cmsis/CMSIS/Core/Include -I/home/bruce/ncs/v2.4.1/modules/hal/nordic/nrfx -I/home/bruce/ncs/v2.4.1/modules/hal/nordic/nrfx/drivers/include -I/home/bruce/ncs/v2.4.1/modules/hal/nordic/nrfx/mdk -I/home/bruce/ncs/v2.4.1/zephyr/modules/hal_nordic/nrfx/. -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/zephyr/.. -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/zephyr/../include -I/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/zephyr/../../zephyr/include -I/home/bruce/ncs/v2.4.1/nrfxlib/crypto/nrf_cc310_bl/include -isystem /home/bruce/ncs/v2.4.1/zephyr/lib/libc/minimal/include -isystem /opt/gnuarmemb/bin/../lib/gcc/arm-none-eabi/9.2.1/include -isystem /opt/gnuarmemb/bin/../lib/gcc/arm-none-eabi/9.2.1/include-fixed -isystem /home/bruce/ncs/v2.4.1/nrfxlib/crypto/nrf_cc310_platform/include -fno-strict-aliasing -Os -imacros /home/bruce/dev/lightbulb/light_bulb/build/mcuboot/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfpu=fpv4-sp-d16 -mfloat-abi=hard --sysroot=/opt/gnuarmemb/arm-none-eabi -imacros /home/bruce/ncs/v2.4.1/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 -fno-defer-pop -fmacro-prefix-map=/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr=CMAKE_SOURCE_DIR -fmacro-prefix-map=/home/bruce/ncs/v2.4.1/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/home/bruce/ncs/v2.4.1=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -MD -MT CMakeFiles/app.dir/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/swap_move.c.obj -MF CMakeFiles/app.dir/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/swap_move.c.obj.d -o CMakeFiles/app.dir/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/swap_move.c.obj -c /home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/swap_move.c
In file included from /home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/bootutil_priv.h:33,
                 from /home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/swap_move.c:25:
/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/swap_move.c: In function 'swap_status_source':
/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr/include/sysflash/sysflash.h:15:40: error: 'PM_MCUBOOT_SECONDARY_ID' undeclared (first use in this function); did you mean 'PM_MCUBOOT_PRIMARY_ID'?
   15 | #define FLASH_AREA_IMAGE_SECONDARY(x)  PM_MCUBOOT_SECONDARY_ID
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~
/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/swap_move.c:323:37: note: in expansion of macro 'FLASH_AREA_IMAGE_SECONDARY'
  323 |     rc = boot_read_swap_state_by_id(FLASH_AREA_IMAGE_SECONDARY(image_index),
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr/include/sysflash/sysflash.h:15:40: note: each undeclared identifier is reported only once for each function it appears in
   15 | #define FLASH_AREA_IMAGE_SECONDARY(x)  PM_MCUBOOT_SECONDARY_ID
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~
/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/swap_move.c:323:37: note: in expansion of macro 'FLASH_AREA_IMAGE_SECONDARY'
  323 |     rc = boot_read_swap_state_by_id(FLASH_AREA_IMAGE_SECONDARY(image_index),
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/swap_move.c: In function 'swap_run':
/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/zephyr/include/sysflash/sysflash.h:15:40: error: 'PM_MCUBOOT_SECONDARY_ID' undeclared (first use in this function); did you mean 'PM_MCUBOOT_PRIMARY_ID'?
   15 | #define FLASH_AREA_IMAGE_SECONDARY(x)  PM_MCUBOOT_SECONDARY_ID
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~
/home/bruce/ncs/v2.4.1/bootloader/mcuboot/boot/bootutil/src/swap_move.c:528:26: note: in expansion of macro 'FLASH_AREA_IMAGE_SECONDARY'
  528 |     rc = flash_area_open(FLASH_AREA_IMAGE_SECONDARY(image_index), &fap_sec);
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
[91/179] Generating ../../../include/generated/libc/minimal/strerror_table.h
[92/179] Building C object zephyr/soc/arm/common/cortex_m/CMakeFiles/soc__arm__common__cortex_m.dir/arm_mpu_regions.c.obj
[93/179] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/scb.c.obj
[94/179] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/fault.c.obj
[95/179] Building C object zephyr/arch/arch/arm/core/aarch32/mpu/CMakeFiles/arch__arm__core__aarch32__mpu.dir/arm_core_mpu.c.obj
[96/179] Building C object zephyr/arch/arch/arm/core/aarch32/mpu/CMakeFiles/arch__arm__core__aarch32__mpu.dir/arm_mpu.c.obj
ninja: build stopped: subcommand failed.
[227/522] Linking C static library zephyr/soc/arm/nordic_nrf/nrf52/libsoc__arm__nordic_nrf__nrf52.a
FAILED: modules/mcuboot/mcuboot_subimage-prefix/src/mcuboot_subimage-stamp/mcuboot_subimage-build mcuboot/zephyr/zephyr.hex mcuboot/zephyr/zephyr.elf 
cd /home/bruce/dev/lightbulb/light_bulb/build/mcuboot && /home/bruce/cmake/cmake-3.20.5-linux-x86_64/bin/cmake --build . --
[229/522] Linking C static library zephyr/subsys/random/libsubsys__random.a
[230/522] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/fault.c.obj
[231/522] Linking C static library zephyr/subsys/bluetooth/common/libsubsys__bluetooth__common.a
[232/522] Building C object zephyr/subsys/net/CMakeFiles/subsys__net.dir/buf.c.obj
[233/522] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/adv.c.obj
[234/522] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/smp_null.c.obj
[235/522] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/hci_common.c.obj
[236/522] Building C object zephyr/subsys/dfu/boot/CMakeFiles/subsys__dfu__boot.dir/mcuboot.c.obj
[237/522] Building C object zephyr/subsys/net/l2/openthread/CMakeFiles/subsys__net__ip__l2__openthread.dir/openthread_utils.c.obj
[238/522] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/id.c.obj
[239/522] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/l2cap.c.obj
[240/522] Building C object zephyr/subsys/net/ip/CMakeFiles/subsys__net__ip.dir/net_core.c.obj
[241/522] Building C object zephyr/subsys/net/l2/openthread/CMakeFiles/subsys__net__ip__l2__openthread.dir/openthread.c.obj
[242/522] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/conn.c.obj
/home/bruce/ncs/v2.4.1/zephyr/subsys/bluetooth/host/conn.c: In function 'send_frag':
/home/bruce/ncs/v2.4.1/zephyr/subsys/bluetooth/host/conn.c:594:20: warning: 'pending_no_cb' may be used uninitialized in this function [-Wmaybe-uninitialized]
  594 |    (*pending_no_cb)--;
      |    ~~~~~~~~~~~~~~~~^~
/home/bruce/ncs/v2.4.1/zephyr/subsys/bluetooth/host/conn.c:547:12: note: 'pending_no_cb' was declared here
  547 |  uint32_t *pending_no_cb;
      |            ^~~~~~~~~~~~~
[243/522] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/gatt.c.obj
[244/522] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/att.c.obj
[245/522] Building C object zephyr/subsys/bluetooth/host/CMakeFiles/subsys__bluetooth__host.dir/hci_core.c.obj
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /home/bruce/cmake/cmake-3.20.5-linux-x86_64/bin/cmake --build /home/bruce/dev/lightbulb/light_bulb/build

 *  The terminal process terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. 

Related