BLE DFU with Zephyr OS

Hello,

I'm tring to get OAD DFU working on an nrf52840 using Zephyr OS. Relevant information:

  • Host OS: Ubuntu 22.04, kernel 6.5.0
  • Zephyr SDK Version: 0.16.3
  • MCUBoot Version: 2.0.0

The problem is when I build my project, which I modified from the peripheral_hr project, I get the following build errors:

$ west build -p -b nrf52840dk_nrf52840 dfu-oad/ -d build-dfu-oad -- -DCONFIG_MCUBOOT_SIGNATURE_KEY_FILE=\"bootloader/mcuboot/root-rsa-2048.pem\"               [56/173]-- west build: making build dir /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/zephyrproject/build-dfu-oad pristine
-- west build: generating a build system                                                                                                                                                                                                    
Loading Zephyr default modules (Zephyr base).                                                                                                                                                                                               
-- Application: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/zephyrproject/dfu-oad
-- CMake version: 3.27.4                                   
-- Found Python3: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/zephyrproject/.venv/bin/python3 (found suitable version "3.10.12", minimum required is "3.8") found components: Interpreter
-- Cache files will be written to: /home/thomasokeeffe/.cache/zephyr                                                  
-- Zephyr version: 3.5.99 (/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/zephyrproject/zephyr)      
-- Found west (found suitable version "1.2.0", minimum required is "0.14.0")                                                                                                                                                                
-- Board: nrf52840dk_nrf52840                                                                                         
-- ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK                                                      
-- Found host-tools: zephyr 0.16.3 (/opt/zephyr-sdk-0.16.3)                                                           
-- Found toolchain: zephyr 0.16.3 (/opt/zephyr-sdk-0.16.3)                                                            
-- Found Dtc: /opt/zephyr-sdk-0.16.3/sysroots/x86_64-pokysdk-linux/usr/bin/dtc (found suitable version "1.6.0", minimum required is "1.4.6")
-- Found BOARD.dts: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/zephyrproject/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts
-- Generated zephyr.dts: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/zephyrproject/build-dfu-oad/zephyr/zephyr.dts
-- Generated devicetree_generated.h: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/zephyrproject/build-dfu-oad/zephyr/include/generated/devicetree_generated.h
-- Including generated dts.cmake file: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/zephyrproject/build-dfu-oad/zephyr/dts.cmake
Parsing /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/zephyrproject/zephyr/Kconfig                  
Loaded configuration '/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/zephyrproject/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840_defconfig'
Merged configuration '/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/zephyrproject/dfu-oad/prj.conf'
Merged configuration '/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/zephyrproject/build-dfu-oad/zephyr/misc/generated/extra_kconfig_options.conf'
Configuration saved to '/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/zephyrproject/build-dfu-oad/zephyr/.config'
Kconfig header saved to '/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/zephyrproject/build-dfu-oad/zephyr/include/generated/autoconf.h'
-- Found GnuLd: /opt/zephyr-sdk-0.16.3/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd (found version "2.38")
-- The C compiler identification is GNU 12.2.0                                                                        
-- The CXX compiler identification is GNU 12.2.0                                                                      
-- The ASM compiler identification is GNU                                                                             
-- Found assembler: /opt/zephyr-sdk-0.16.3/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc                                    
-- Including signing script: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/zephyrproject/zephyr/cmake/mcuboot.cmake
-- Configuring done (4.5s)                                                                                            
-- Generating done (0.1s)                                  
-- Build files have been written to: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/zephyrproject/build-dfu-oad
-- west build: building application                                                                                   
[1/276] Preparing syscall dependency handling

[3/276] Generating include/generated/version.h                                                                        
-- Zephyr version: 3.5.99 (/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/zephyrproject/zephyr), build: zephyr-v3.5.0-1183-gec202d852f8d                                                                                   
[22/276] Building C object CMakeFiles/app.dir/src/main.c.obj                                                                
FAILED: CMakeFiles/app.dir/src/main.c.obj                                                                             
/opt/zephyr-sdk-0.16.3/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DKERNEL -DNRF52840_XXAA -DPICOLIBC_INTEGER_PRINTF_SCANF -D_FORTIFY_SOURCE=1 -D_POSIX_C_SOURCE=200809 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -I/home/t
homasokeeffe/Documents/school/drexel/research/CTS_sensor/zephyrproject/zephyr/samples/bluetooth -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/zephyrproject/zephyr/include -I/home/thomasokeeffe/Documents/school/drexel
/research/CTS_sensor/zephyrproject/build-dfu-oad/zephyr/include/generated -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/zephyrproject/zephyr/soc/arm/nordic_nrf/nrf52 -I/home/thomasokeeffe/Documents/school/drexel/rese
arch/CTS_sensor/zephyrproject/zephyr/soc/arm/nordic_nrf/common/. -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/zephyrproject/zephyr/subsys/mgmt/mcumgr/util/include -I/home/thomasokeeffe/Documents/school/drexel/resear
ch/CTS_sensor/zephyrproject/zephyr/subsys/mgmt/mcumgr/transport/include -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/zephyrproject/zephyr/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/nrfx_glue -I/home/thomasoke
effe/Documents/school/drexel/research/CTS_sensor/zephyrproject/zephyr/subsys/bluetooth -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/zephyrproject/modules/hal/cmsis/CMSIS/Core/Include -I/home/thomasokeeffe/Documents/
school/drexel/research/CTS_sensor/zephyrproject/zephyr/modules/cmsis/. -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/zephyrproject/modules/hal/nordic/nrfx -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_se
nsor/zephyrproject/modules/hal/nordic/nrfx/drivers/include -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/zephyrproject/modules/hal/nordic/nrfx/mdk -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/zep
hyrproject/zephyr/modules/hal_nordic/nrfx/. -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/zephyrproject/modules/debug/segger/SEGGER -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/zephyrproject/modu
les/debug/segger/Config -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/zephyrproject/modules/crypto/tinycrypt/lib/include -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/zephyrproject/modules/lib/zcb
or/include -fno-strict-aliasing -Os -imacros /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/zephyrproject/build-dfu-oad/zephyr/include/generated/autoconf.h -fno-printf-return-value -fno-common -g -gdwarf-4 -fdiagnostics
-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfp16-format=ieee -mtp=soft --sysroot=/opt/zephyr-sdk-0.16.3/arm-zephyr-eabi/arm-zephyr-eabi -imacros /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/zephyrproject/zephy
r/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-asynch
ronous-unwind-tables -ftls-model=local-exec -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/zephyrproject/dfu-oad=CMAKE_SOURCE_DIR -fmacro-p
refix-map=/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/zephyrproject/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/zephyrproject=WEST_TOPDIR -ffunction-sections
-fdata-sections --specs=picolibc.specs -std=c99 -MD -MT CMakeFiles/app.dir/src/main.c.obj -MF CMakeFiles/app.dir/src/main.c.obj.d -o CMakeFiles/app.dir/src/main.c.obj -c /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ze
phyrproject/dfu-oad/src/main.c                                                                                        
In file included from /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/zephyrproject/dfu-oad/src/main.c:28:
/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/zephyrproject/zephyr/include/zephyr/mgmt/mcumgr/grp/img_mgmt/img_mgmt.h:14:10: fatal error: bootutil/image.h: No such file or directory
   14 | #include <bootutil/image.h>                                                                                   
      |          ^~~~~~~~~~~~~~~~~~                        
compilation terminated.                                                                                                                                                                                                                     
[39/276] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/logging/log_core.c.obj                                 
ninja: build stopped: subcommand failed.                                                                              
FATAL ERROR: command exited with status 1: /usr/bin/cmake --build /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/zephyrproject/build-dfu-oad

I am able to build and flash the USB DFU example project, and update the image via DFU, so I know my setup is functioning.

I have attached the relevant code and config files. I was attempting to follow this guide: https://getwavecake.com/blog/adding-ota-dfu-to-a-nordic-zephyr-project/. I ran into some problems with the KConfig options, but I think I found a solution to that here: DFU with nrf connect 2.4. However, with those changes I get the above build error. Please let me know what I can do to fix this.

/* main.c - Application main entry point */

/*
 * Copyright (c) 2015-2016 Intel Corporation
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include <zephyr/types.h>
#include <stddef.h>
#include <string.h>
#include <errno.h>
#include <zephyr/sys/printk.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
#include <zephyr/usb/usb_device.h>

#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/conn.h>
#include <zephyr/bluetooth/uuid.h>
#include <zephyr/bluetooth/gatt.h>
#include <zephyr/bluetooth/services/bas.h>
#include <zephyr/bluetooth/services/hrs.h>

#include <zephyr/mgmt/mcumgr/transport/smp_bt.h>
#include <zephyr/mgmt/mcumgr/grp/img_mgmt/img_mgmt.h>
#include <zephyr/mgmt/mcumgr/grp/os_mgmt/os_mgmt.h>

LOG_MODULE_REGISTER(main);

static const struct bt_data ad[] = {
	BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)),
	BT_DATA_BYTES(BT_DATA_UUID16_ALL,
		      BT_UUID_16_ENCODE(BT_UUID_HRS_VAL),
		      BT_UUID_16_ENCODE(BT_UUID_BAS_VAL),
		      BT_UUID_16_ENCODE(BT_UUID_DIS_VAL))
};

static void connected(struct bt_conn *conn, uint8_t err)
{
	if (err) {
		printk("Connection failed (err 0x%02x)\n", err);
	} else {
		printk("Connected\n");
	}
}

static void disconnected(struct bt_conn *conn, uint8_t reason)
{
	printk("Disconnected (reason 0x%02x)\n", reason);
}

BT_CONN_CB_DEFINE(conn_callbacks) = {
	.connected = connected,
	.disconnected = disconnected,
};

static void bt_ready(void)
{
	int err;

	printk("Bluetooth initialized\n");

	err = bt_le_adv_start(BT_LE_ADV_CONN_NAME, ad, ARRAY_SIZE(ad), NULL, 0);
	if (err) {
		printk("Advertising failed to start (err %d)\n", err);
		return;
	}

	printk("Advertising successfully started\n");
}

static void auth_cancel(struct bt_conn *conn)
{
	char addr[BT_ADDR_LE_STR_LEN];

	bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr));

	printk("Pairing cancelled: %s\n", addr);
}

static struct bt_conn_auth_cb auth_cb_display = {
	.cancel = auth_cancel,
};

static void bas_notify(void)
{
	uint8_t battery_level = bt_bas_get_battery_level();

	battery_level--;

	if (!battery_level) {
		battery_level = 100U;
	}

	bt_bas_set_battery_level(battery_level);
}

static void hrs_notify(void)
{
	static uint8_t heartrate = 90U;

	/* Heartrate measurements simulation */
	heartrate++;
	if (heartrate == 160U) {
		heartrate = 90U;
	}

	bt_hrs_notify(heartrate);
}

int main(void)
{
	int err;

	err = usb_enable(NULL);
	if (err != 0) {
		LOG_ERR("Failed to enable USB");
		return 0;
	}

	LOG_INF("This device supports USB DFU class.\n");

    os_mgmt_register_group();
    img_mgmt_register_group();
    stat_mgmt_register_group();

	err = bt_enable(NULL);
	if (err) {
		printk("Bluetooth init failed (err %d)\n", err);
		return 0;
	}

	bt_ready();

	bt_conn_auth_cb_register(&auth_cb_display);

    err = smp_bt_register();

    if (err) {
        printk("SMP BT register failed (err: %d)", err);
    }

	/* Implement notification. At the moment there is no suitable way
	 * of starting delayed work so we do it here
	 */
	while (1) {
		k_sleep(K_SECONDS(1));

		/* Heartrate measurements simulation */
		hrs_notify();

		/* Battery level simulation */
		bas_notify();
	}
	return 0;
}

4670.prj.conf

Parents
  • Hi,

    • Zephyr SDK Version: 0.16.3
    • MCUBoot Version: 2.0.0

    Our support is based on nRF Connect SDK (NCS), so I would suggest you use the latest NCS v.2.5.0. Check out this similar question with NCS v2.5.0. 

    Regards,
    Amanda H.

  • Hi, I installed NCS v2.5.0 and rebuilt the same project in the NCS environment. It appears to be the same error. Here is the full build output:

    $ west build -p -b nrf52840dk_nrf52840 dfu-oad/ -d build-dfu-oad -- -DCONFIG_MCUBOOT_SIGNATURE_KEY_FILE=\"bootloader/mcuboot/root-rsa-2048.pem\"                       [117/4130]
    -- west build: generating a build system                                                                                                                                                                                                    
    Loading Zephyr default modules (Zephyr base).                                                                         
    -- Application: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/dfu-oad                                                                                                                                                 
    -- CMake version: 3.27.5                                                                                              
    -- Found Python3: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/.venv/bin/python3 (found suitable version "3.10.12", minimum required is "3.8") found components: Interpreter                                         
    -- Cache files will be written to: /home/thomasokeeffe/.cache/zephyr                                                                                                                                                                        
    -- Zephyr version: 3.4.99 (/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr)                                                                                                                                      
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")                                                                                                                                                                
    -- Board: nrf52840dk_nrf52840                              
    -- ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK                                                      
    -- Found host-tools: zephyr 0.16.3 (/opt/zephyr-sdk-0.16.3)                                                           
    -- Found toolchain: zephyr 0.16.3 (/opt/zephyr-sdk-0.16.3)                                                            
    -- Found Dtc: /opt/zephyr-sdk-0.16.3/sysroots/x86_64-pokysdk-linux/usr/bin/dtc (found suitable version "1.6.0", minimum required is "1.4.6") 
    -- Found BOARD.dts: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts
    -- Generated zephyr.dts: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/build-dfu-oad/zephyr/zephyr.dts                                                                                                                
    -- Generated devicetree_generated.h: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/build-dfu-oad/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/build-dfu-oad/zephyr/dts.cmake
    Parsing /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/Kconfig                                                                                                                                                  
    Loaded configuration '/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840_defconfig'
    Merged configuration '/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/dfu-oad/prj.conf'                                                                                                                                 
    Merged configuration '/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/build-dfu-oad/zephyr/misc/generated/extra_kconfig_options.conf'
    Configuration saved to '/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/build-dfu-oad/zephyr/.config'                                                                                                                   
    Kconfig header saved to '/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/build-dfu-oad/zephyr/include/generated/autoconf.h'
    -- Found GnuLd: /opt/zephyr-sdk-0.16.3/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd (found version "2.38") 
    -- The C compiler identification is GNU 12.2.0                                                                        
    -- The CXX compiler identification is GNU 12.2.0                                                                      
    -- The ASM compiler identification is GNU                                                                             
    -- Found assembler: /opt/zephyr-sdk-0.16.3/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc                                                                                                                                                          
    -- Found Python3: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/.venv/bin/python3 (found version "3.10.12") found components: Interpreter
    
    === child image mcuboot -  begin ===                                                                                                                                                                                               [86/4130]
    loading initial cache file /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/build-dfu-oad/mcuboot/child_image_preload.cmake
    Loading Zephyr default modules (Zephyr base).                                                                         
    -- Application: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/bootloader/mcuboot/boot/zephyr                                                                                                                          
    -- CMake version: 3.27.5                                   
    -- Found Python3: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/.venv/bin/python3 (found suitable version "3.10.12", minimum required is "3.8") found components: Interpreter 
    -- Cache files will be written to: /home/thomasokeeffe/.cache/zephyr                                                                                                                                                                        
    -- Zephyr version: 3.4.99 (/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr)                                                                                                                                      
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")                                                                                                                                                                
    -- Board: nrf52840dk_nrf52840                              
    -- Found host-tools: zephyr 0.16.3 (/opt/zephyr-sdk-0.16.3)                                                           
    -- Found toolchain: zephyr 0.16.3 (/opt/zephyr-sdk-0.16.3)                                                            
    -- Found Dtc: /opt/zephyr-sdk-0.16.3/sysroots/x86_64-pokysdk-linux/usr/bin/dtc (found suitable version "1.6.0", minimum required is "1.4.6") 
    -- Found BOARD.dts: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts
    -- Found devicetree overlay: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrf/modules/mcuboot/usb.overlay                                                                                                            
    -- Generated zephyr.dts: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/build-dfu-oad/mcuboot/zephyr/zephyr.dts                                                                                                        
    -- Generated devicetree_generated.h: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/build-dfu-oad/mcuboot/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/build-dfu-oad/mcuboot/zephyr/dts.cmake
    Parsing /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/bootloader/mcuboot/boot/zephyr/Kconfig                                                                                                                          
    Loaded configuration '/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840_defconfig'
    Merged configuration '/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/bootloader/mcuboot/boot/zephyr/prj.conf'                                                                                                          
    Merged configuration '/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/bootloader/mcuboot/boot/zephyr/boards/nrf52840dk_nrf52840.conf'
    Merged configuration '/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrf/subsys/partition_manager/partition_manager_enabled.conf'
    Merged configuration '/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/build-dfu-oad/mcuboot/zephyr/misc/generated/extra_kconfig_options.conf'
    Configuration saved to '/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/build-dfu-oad/mcuboot/zephyr/.config'                                                                                                           
    Kconfig header saved to '/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/build-dfu-oad/mcuboot/zephyr/include/generated/autoconf.h'
    -- Found GnuLd: /opt/zephyr-sdk-0.16.3/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd (found version "2.38") 
    -- The C compiler identification is GNU 12.2.0                                                                        
    -- The CXX compiler identification is GNU 12.2.0                                                                      
    -- The ASM compiler identification is GNU                                                                             
    -- Found assembler: /opt/zephyr-sdk-0.16.3/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc                                                                                                                                                          
    CMake Warning at /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrf/lib/flash_patch/CMakeLists.txt:8 (message):                                                                                                        
                                                               
    
            ----------------------------------------------------------                                                                                                                                                                          
            --- WARNING: To maintain the integrity of secure boot, ---                                                                                                                                                                          
            --- enable CONFIG_DISABLE_FLASH_PATCH in production.   ---                                                                                                                                                                          
            ----------------------------------------------------------                                                                                                                                                                          
    
    
    MCUBoot bootloader key file: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/bootloader/mcuboot/root-ec-p256.pem                                                                                                        
    -- Configuring done (3.1s)                                 
    -- Generating done (0.1s)                                  
    -- Build files have been written to: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/build-dfu-oad/mcuboot                                                                                                              
    === child image mcuboot -  end ===
    
    CMake Warning at /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrf/modules/mcuboot/CMakeLists.txt:320 (message):                                                                                             [40/4130]
                                                               
    
              ---------------------------------------------------------                                                                                                                                                                         
              --- WARNING: Using default MCUBoot key, it should not ---                                                                                                                                                                         
              --- be used for production.                           ---                                                                                                                                                                         
              ---------------------------------------------------------                                                                                                                                                                         
                                                               
    
    
    
    CMake Warning at /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrf/modules/mcuboot/CMakeLists.txt:707 (message):
      CONFIG_MCUBOOT_SIGNATURE_KEY_FILE is set to                                                                         
      "bootloader/mcuboot/root-rsa-2048.pem".                                                                             
    
      You are using the NCS Mcuboot signing, which means this option will be                                                                                                                                                                    
      ignored.                                                 
    
      Image signing in NCS is done via the MCUboot image's                                                                
      CONFIG_BOOT_SIGNATURE_KEY_FILE option.                                                                              
    
      Consider setting CONFIG_MCUBOOT_SIGNATURE_KEY_FILE in your application                                                                                                                                                                    
      image back to its default value, the empty string.                                                                  
    
    
    CMake Warning at /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrf/cmake/partition_manager.cmake:79 (message):                                                                                                        
                                                               
    
              ---------------------------------------------------------------------                                                                                                                                                             
              --- WARNING: Using a bootloader without pm_static.yml.            ---                                                                                                                                                             
              --- There are cases where a deployed product can consist of       ---                                                                                                                                                             
              --- multiple images, and only a subset of these images can be     ---                                                                                                                                                             
              --- upgraded through a firmware update mechanism. In such cases,  ---                                                                                                                                                             
              --- the upgradable images must have partitions that are static    ---                                                                                                                                                             
              --- and are matching the partition map used by the bootloader     ---                                                                                                                                                             
              --- programmed onto the device.                                   ---                                                                                                                                                             
              ---------------------------------------------------------------------                                                                                                                                                             
                                                               
    
    Call Stack (most recent call first):                                                                                  
      /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/cmake/modules/kernel.cmake:247 (include)                                                                                                                       
      /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/cmake/modules/zephyr_default.cmake:138 (include)                                                                                                               
      /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
      /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      CMakeLists.txt:5 (find_package)                                                                                     
    
    
    -- Configuring done (6.9s)                                 
    -- Generating done (0.1s)                                  
    -- Build files have been written to: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/build-dfu-oad                                                                                                                      
    -- west build: building application                                                                                   
    [1/268] Preparing syscall dependency handling                                                                         
    
    [5/268] Generating include/generated/version.h                                                                        
    -- Zephyr version: 3.4.99 (/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr), build: v3.4.99-ncs1                                                                                                                 
    [9/268] Performing build step for 'mcuboot_subimage'                                                                                                                                                                                        
    [1/187] Preparing syscall dependency handling
    
    [4/187] Generating include/generated/version.h                                                                        
    -- Zephyr version: 3.4.99 (/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr), build: v3.4.99-ncs1                                                                                                                 
    [187/187] Linking C executable zephyr/zephyr.elf                                                                                                                                                                                            
    Memory region         Used Size  Region Size  %age Used                                                               
               FLASH:       31870 B        48 KB     64.84%                                                               
                 RAM:       17728 B       256 KB      6.76%                                                               
            IDT_LIST:          0 GB         2 KB      0.00%                                                               
    [30/268] Building C object CMakeFiles/app.dir/src/main.c.obj                                                          
    FAILED: CMakeFiles/app.dir/src/main.c.obj                                                                             
    ccache /opt/zephyr-sdk-0.16.3/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DKERNEL -DNRF52840_XXAA -DPICOLIBC_INTEGER_PRINTF_SCANF -DUSE_PARTITION_MANAGER=1 -D_FORTIFY_SOURCE=1 -D_POSIX_C_SOURCE=200809 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGR
    AM_START -D__ZEPHYR__=1 -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/samples/bluetooth -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrf/drivers/mpsl/clock_control -I/home/thomasok
    eeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/include -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/build-dfu-oad/zephyr/include/generated -I/home/thomasokeeffe/Documents/school/drexel/research/CTS
    _sensor/ncs/zephyr/soc/arm/nordic_nrf/nrf52 -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/soc/arm/nordic_nrf/common/. -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/subsys/mgm
    t/mcumgr/util/include -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/subsys/mgmt/mcumgr/transport/include -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/subsys/bluetooth -I/hom
    e/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrf/include -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrf/lib/multithreading_lock/. -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_s
    ensor/ncs/nrf/subsys/bluetooth/controller/. -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/drivers/flash -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrf/tests/include -I/home/thoma
    sokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/modules/hal/cmsis/CMSIS/Core/Include -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/modules/cmsis/. -I/home/thomasokeeffe/Documents/school/drexel/res
    earch/CTS_sensor/ncs/modules/hal/nordic/nrfx -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/modules/hal/nordic/nrfx/drivers/include -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/modules/hal
    /nordic/nrfx/mdk -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/modules/hal_nordic/nrfx/. -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/modules/debug/segger/SEGGER -I/home/thomasokee
    ffe/Documents/school/drexel/research/CTS_sensor/ncs/modules/debug/segger/Config -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/modules/crypto/tinycrypt/lib/include -I/home/thomasokeeffe/Documents/school/drexel/res
    earch/CTS_sensor/ncs/modules/lib/zcbor/include -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrfxlib/mpsl/fem/common/include -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrfxlib/mpsl/fem/
    nrf21540_gpio/include -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrfxlib/mpsl/fem/nrf21540_gpio_spi/include -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrfxlib/mpsl/fem/simple_gpio/in
    clude -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrfxlib/mpsl/fem/include -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrfxlib/mpsl/fem/include/protocol -I/home/thomasokeeffe/Documents
    /school/drexel/research/CTS_sensor/ncs/nrfxlib/mpsl/include -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrfxlib/mpsl/include/protocol -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrfxli
    b/softdevice_controller/include -isystem /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrfxlib/crypto/nrf_cc310_platform/include -fno-strict-aliasing -Os -imacros /home/thomasokeeffe/Documents/school/drexel/researc
    h/CTS_sensor/ncs/build-dfu-oad/zephyr/include/generated/autoconf.h -fno-printf-return-value -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfp16-format=ieee --sysroot=/opt/zephyr-sdk-0.16.3/arm-
    zephyr-eabi/arm-zephyr-eabi -imacros /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-pointer-sign -Wpointe
    r-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -ftls-model=local-exec -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=/h
    ome/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/dfu-oad=CMAKE_SOURCE_DIR -fmacro-prefix-map=/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/home/thomasokeeffe/
    Documents/school/drexel/research/CTS_sensor/ncs=WEST_TOPDIR -ffunction-sections -fdata-sections --specs=picolibc.specs -std=c99 -MD -MT CMakeFiles/app.dir/src/main.c.obj -MF CMakeFiles/app.dir/src/main.c.obj.d -o CMakeFiles/app.dir/src/
    main.c.obj -c /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/dfu-oad/src/main.c
    In file included from /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/dfu-oad/src/main.c:28:                                                                                                                            
    /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/include/zephyr/mgmt/mcumgr/grp/img_mgmt/img_mgmt.h:14:10: fatal error: bootutil/image.h: No such file or directory
       14 | #include <bootutil/image.h>                                                                                   
          |          ^~~~~~~~~~~~~~~~~~                                                                                   
    compilation terminated.                                    
    [46/268] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf_complete.c.obj                                                                                                                                                      
    ninja: build stopped: subcommand failed.                                                                              
    FATAL ERROR: command exited with status 1: /usr/bin/cmake --build /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/build-dfu-oad

Reply
  • Hi, I installed NCS v2.5.0 and rebuilt the same project in the NCS environment. It appears to be the same error. Here is the full build output:

    $ west build -p -b nrf52840dk_nrf52840 dfu-oad/ -d build-dfu-oad -- -DCONFIG_MCUBOOT_SIGNATURE_KEY_FILE=\"bootloader/mcuboot/root-rsa-2048.pem\"                       [117/4130]
    -- west build: generating a build system                                                                                                                                                                                                    
    Loading Zephyr default modules (Zephyr base).                                                                         
    -- Application: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/dfu-oad                                                                                                                                                 
    -- CMake version: 3.27.5                                                                                              
    -- Found Python3: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/.venv/bin/python3 (found suitable version "3.10.12", minimum required is "3.8") found components: Interpreter                                         
    -- Cache files will be written to: /home/thomasokeeffe/.cache/zephyr                                                                                                                                                                        
    -- Zephyr version: 3.4.99 (/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr)                                                                                                                                      
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")                                                                                                                                                                
    -- Board: nrf52840dk_nrf52840                              
    -- ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK                                                      
    -- Found host-tools: zephyr 0.16.3 (/opt/zephyr-sdk-0.16.3)                                                           
    -- Found toolchain: zephyr 0.16.3 (/opt/zephyr-sdk-0.16.3)                                                            
    -- Found Dtc: /opt/zephyr-sdk-0.16.3/sysroots/x86_64-pokysdk-linux/usr/bin/dtc (found suitable version "1.6.0", minimum required is "1.4.6") 
    -- Found BOARD.dts: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts
    -- Generated zephyr.dts: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/build-dfu-oad/zephyr/zephyr.dts                                                                                                                
    -- Generated devicetree_generated.h: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/build-dfu-oad/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/build-dfu-oad/zephyr/dts.cmake
    Parsing /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/Kconfig                                                                                                                                                  
    Loaded configuration '/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840_defconfig'
    Merged configuration '/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/dfu-oad/prj.conf'                                                                                                                                 
    Merged configuration '/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/build-dfu-oad/zephyr/misc/generated/extra_kconfig_options.conf'
    Configuration saved to '/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/build-dfu-oad/zephyr/.config'                                                                                                                   
    Kconfig header saved to '/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/build-dfu-oad/zephyr/include/generated/autoconf.h'
    -- Found GnuLd: /opt/zephyr-sdk-0.16.3/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd (found version "2.38") 
    -- The C compiler identification is GNU 12.2.0                                                                        
    -- The CXX compiler identification is GNU 12.2.0                                                                      
    -- The ASM compiler identification is GNU                                                                             
    -- Found assembler: /opt/zephyr-sdk-0.16.3/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc                                                                                                                                                          
    -- Found Python3: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/.venv/bin/python3 (found version "3.10.12") found components: Interpreter
    
    === child image mcuboot -  begin ===                                                                                                                                                                                               [86/4130]
    loading initial cache file /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/build-dfu-oad/mcuboot/child_image_preload.cmake
    Loading Zephyr default modules (Zephyr base).                                                                         
    -- Application: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/bootloader/mcuboot/boot/zephyr                                                                                                                          
    -- CMake version: 3.27.5                                   
    -- Found Python3: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/.venv/bin/python3 (found suitable version "3.10.12", minimum required is "3.8") found components: Interpreter 
    -- Cache files will be written to: /home/thomasokeeffe/.cache/zephyr                                                                                                                                                                        
    -- Zephyr version: 3.4.99 (/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr)                                                                                                                                      
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")                                                                                                                                                                
    -- Board: nrf52840dk_nrf52840                              
    -- Found host-tools: zephyr 0.16.3 (/opt/zephyr-sdk-0.16.3)                                                           
    -- Found toolchain: zephyr 0.16.3 (/opt/zephyr-sdk-0.16.3)                                                            
    -- Found Dtc: /opt/zephyr-sdk-0.16.3/sysroots/x86_64-pokysdk-linux/usr/bin/dtc (found suitable version "1.6.0", minimum required is "1.4.6") 
    -- Found BOARD.dts: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts
    -- Found devicetree overlay: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrf/modules/mcuboot/usb.overlay                                                                                                            
    -- Generated zephyr.dts: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/build-dfu-oad/mcuboot/zephyr/zephyr.dts                                                                                                        
    -- Generated devicetree_generated.h: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/build-dfu-oad/mcuboot/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/build-dfu-oad/mcuboot/zephyr/dts.cmake
    Parsing /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/bootloader/mcuboot/boot/zephyr/Kconfig                                                                                                                          
    Loaded configuration '/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840_defconfig'
    Merged configuration '/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/bootloader/mcuboot/boot/zephyr/prj.conf'                                                                                                          
    Merged configuration '/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/bootloader/mcuboot/boot/zephyr/boards/nrf52840dk_nrf52840.conf'
    Merged configuration '/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrf/subsys/partition_manager/partition_manager_enabled.conf'
    Merged configuration '/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/build-dfu-oad/mcuboot/zephyr/misc/generated/extra_kconfig_options.conf'
    Configuration saved to '/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/build-dfu-oad/mcuboot/zephyr/.config'                                                                                                           
    Kconfig header saved to '/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/build-dfu-oad/mcuboot/zephyr/include/generated/autoconf.h'
    -- Found GnuLd: /opt/zephyr-sdk-0.16.3/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd (found version "2.38") 
    -- The C compiler identification is GNU 12.2.0                                                                        
    -- The CXX compiler identification is GNU 12.2.0                                                                      
    -- The ASM compiler identification is GNU                                                                             
    -- Found assembler: /opt/zephyr-sdk-0.16.3/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc                                                                                                                                                          
    CMake Warning at /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrf/lib/flash_patch/CMakeLists.txt:8 (message):                                                                                                        
                                                               
    
            ----------------------------------------------------------                                                                                                                                                                          
            --- WARNING: To maintain the integrity of secure boot, ---                                                                                                                                                                          
            --- enable CONFIG_DISABLE_FLASH_PATCH in production.   ---                                                                                                                                                                          
            ----------------------------------------------------------                                                                                                                                                                          
    
    
    MCUBoot bootloader key file: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/bootloader/mcuboot/root-ec-p256.pem                                                                                                        
    -- Configuring done (3.1s)                                 
    -- Generating done (0.1s)                                  
    -- Build files have been written to: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/build-dfu-oad/mcuboot                                                                                                              
    === child image mcuboot -  end ===
    
    CMake Warning at /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrf/modules/mcuboot/CMakeLists.txt:320 (message):                                                                                             [40/4130]
                                                               
    
              ---------------------------------------------------------                                                                                                                                                                         
              --- WARNING: Using default MCUBoot key, it should not ---                                                                                                                                                                         
              --- be used for production.                           ---                                                                                                                                                                         
              ---------------------------------------------------------                                                                                                                                                                         
                                                               
    
    
    
    CMake Warning at /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrf/modules/mcuboot/CMakeLists.txt:707 (message):
      CONFIG_MCUBOOT_SIGNATURE_KEY_FILE is set to                                                                         
      "bootloader/mcuboot/root-rsa-2048.pem".                                                                             
    
      You are using the NCS Mcuboot signing, which means this option will be                                                                                                                                                                    
      ignored.                                                 
    
      Image signing in NCS is done via the MCUboot image's                                                                
      CONFIG_BOOT_SIGNATURE_KEY_FILE option.                                                                              
    
      Consider setting CONFIG_MCUBOOT_SIGNATURE_KEY_FILE in your application                                                                                                                                                                    
      image back to its default value, the empty string.                                                                  
    
    
    CMake Warning at /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrf/cmake/partition_manager.cmake:79 (message):                                                                                                        
                                                               
    
              ---------------------------------------------------------------------                                                                                                                                                             
              --- WARNING: Using a bootloader without pm_static.yml.            ---                                                                                                                                                             
              --- There are cases where a deployed product can consist of       ---                                                                                                                                                             
              --- multiple images, and only a subset of these images can be     ---                                                                                                                                                             
              --- upgraded through a firmware update mechanism. In such cases,  ---                                                                                                                                                             
              --- the upgradable images must have partitions that are static    ---                                                                                                                                                             
              --- and are matching the partition map used by the bootloader     ---                                                                                                                                                             
              --- programmed onto the device.                                   ---                                                                                                                                                             
              ---------------------------------------------------------------------                                                                                                                                                             
                                                               
    
    Call Stack (most recent call first):                                                                                  
      /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/cmake/modules/kernel.cmake:247 (include)                                                                                                                       
      /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/cmake/modules/zephyr_default.cmake:138 (include)                                                                                                               
      /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
      /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      CMakeLists.txt:5 (find_package)                                                                                     
    
    
    -- Configuring done (6.9s)                                 
    -- Generating done (0.1s)                                  
    -- Build files have been written to: /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/build-dfu-oad                                                                                                                      
    -- west build: building application                                                                                   
    [1/268] Preparing syscall dependency handling                                                                         
    
    [5/268] Generating include/generated/version.h                                                                        
    -- Zephyr version: 3.4.99 (/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr), build: v3.4.99-ncs1                                                                                                                 
    [9/268] Performing build step for 'mcuboot_subimage'                                                                                                                                                                                        
    [1/187] Preparing syscall dependency handling
    
    [4/187] Generating include/generated/version.h                                                                        
    -- Zephyr version: 3.4.99 (/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr), build: v3.4.99-ncs1                                                                                                                 
    [187/187] Linking C executable zephyr/zephyr.elf                                                                                                                                                                                            
    Memory region         Used Size  Region Size  %age Used                                                               
               FLASH:       31870 B        48 KB     64.84%                                                               
                 RAM:       17728 B       256 KB      6.76%                                                               
            IDT_LIST:          0 GB         2 KB      0.00%                                                               
    [30/268] Building C object CMakeFiles/app.dir/src/main.c.obj                                                          
    FAILED: CMakeFiles/app.dir/src/main.c.obj                                                                             
    ccache /opt/zephyr-sdk-0.16.3/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DKERNEL -DNRF52840_XXAA -DPICOLIBC_INTEGER_PRINTF_SCANF -DUSE_PARTITION_MANAGER=1 -D_FORTIFY_SOURCE=1 -D_POSIX_C_SOURCE=200809 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGR
    AM_START -D__ZEPHYR__=1 -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/samples/bluetooth -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrf/drivers/mpsl/clock_control -I/home/thomasok
    eeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/include -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/build-dfu-oad/zephyr/include/generated -I/home/thomasokeeffe/Documents/school/drexel/research/CTS
    _sensor/ncs/zephyr/soc/arm/nordic_nrf/nrf52 -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/soc/arm/nordic_nrf/common/. -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/subsys/mgm
    t/mcumgr/util/include -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/subsys/mgmt/mcumgr/transport/include -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/subsys/bluetooth -I/hom
    e/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrf/include -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrf/lib/multithreading_lock/. -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_s
    ensor/ncs/nrf/subsys/bluetooth/controller/. -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/drivers/flash -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrf/tests/include -I/home/thoma
    sokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/modules/hal/cmsis/CMSIS/Core/Include -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/modules/cmsis/. -I/home/thomasokeeffe/Documents/school/drexel/res
    earch/CTS_sensor/ncs/modules/hal/nordic/nrfx -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/modules/hal/nordic/nrfx/drivers/include -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/modules/hal
    /nordic/nrfx/mdk -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/modules/hal_nordic/nrfx/. -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/modules/debug/segger/SEGGER -I/home/thomasokee
    ffe/Documents/school/drexel/research/CTS_sensor/ncs/modules/debug/segger/Config -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/modules/crypto/tinycrypt/lib/include -I/home/thomasokeeffe/Documents/school/drexel/res
    earch/CTS_sensor/ncs/modules/lib/zcbor/include -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrfxlib/mpsl/fem/common/include -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrfxlib/mpsl/fem/
    nrf21540_gpio/include -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrfxlib/mpsl/fem/nrf21540_gpio_spi/include -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrfxlib/mpsl/fem/simple_gpio/in
    clude -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrfxlib/mpsl/fem/include -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrfxlib/mpsl/fem/include/protocol -I/home/thomasokeeffe/Documents
    /school/drexel/research/CTS_sensor/ncs/nrfxlib/mpsl/include -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrfxlib/mpsl/include/protocol -I/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrfxli
    b/softdevice_controller/include -isystem /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/nrfxlib/crypto/nrf_cc310_platform/include -fno-strict-aliasing -Os -imacros /home/thomasokeeffe/Documents/school/drexel/researc
    h/CTS_sensor/ncs/build-dfu-oad/zephyr/include/generated/autoconf.h -fno-printf-return-value -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfp16-format=ieee --sysroot=/opt/zephyr-sdk-0.16.3/arm-
    zephyr-eabi/arm-zephyr-eabi -imacros /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-pointer-sign -Wpointe
    r-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -ftls-model=local-exec -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=/h
    ome/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/dfu-oad=CMAKE_SOURCE_DIR -fmacro-prefix-map=/home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/home/thomasokeeffe/
    Documents/school/drexel/research/CTS_sensor/ncs=WEST_TOPDIR -ffunction-sections -fdata-sections --specs=picolibc.specs -std=c99 -MD -MT CMakeFiles/app.dir/src/main.c.obj -MF CMakeFiles/app.dir/src/main.c.obj.d -o CMakeFiles/app.dir/src/
    main.c.obj -c /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/dfu-oad/src/main.c
    In file included from /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/dfu-oad/src/main.c:28:                                                                                                                            
    /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/zephyr/include/zephyr/mgmt/mcumgr/grp/img_mgmt/img_mgmt.h:14:10: fatal error: bootutil/image.h: No such file or directory
       14 | #include <bootutil/image.h>                                                                                   
          |          ^~~~~~~~~~~~~~~~~~                                                                                   
    compilation terminated.                                    
    [46/268] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf_complete.c.obj                                                                                                                                                      
    ninja: build stopped: subcommand failed.                                                                              
    FATAL ERROR: command exited with status 1: /usr/bin/cmake --build /home/thomasokeeffe/Documents/school/drexel/research/CTS_sensor/ncs/build-dfu-oad

Children
  • Are you including the files as this similar post? If so, remove them. They are not required in v2.5.0.  

  • Yes I'm familiar with that post. I get the same error if I comment out lines 28 and 29.

  • Hi, 

    Make sure clean and build if you comment out lines 28 and 29. 

    You can refer to NCS v2.5.0 https://github.com/nrfconnect/sdk-zephyr/tree/v3.4.99-ncs1/samples/subsys/mgmt/mcumgr/smp_svr 

    -Amanda H.

  • Thank you for the updated code. I can now see the board advertising in the nRF Connect app on my android phone. However, when I click the DFU button and select the dfu application zip file that I generated from the blinky example, I see the following in the app log:

    nRF Connect, 2023-12-01
    Zephyr Heartrate Sensor (CF:CD:B0:4A:9E:BF)
    V	13:51:32.784	[McuMgr] Connecting...
    D	13:51:32.786	[McuMgr] gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, LE 1M)
    D	13:51:32.810	[McuMgr] [Callback] Connection state changed with status: 0 and new state: 2 (CONNECTED)
    I	13:51:32.812	[McuMgr] Connected to CF:CD:B0:4A:9E:BF
    D	13:51:32.814	[McuMgr] wait(300)
    I	13:51:32.815	[McuMgr] MTU changed to: 498
    V	13:51:33.117	[McuMgr] Discovering services...
    D	13:51:33.124	[McuMgr] gatt.discoverServices()
    I	13:51:33.137	[McuMgr] Services discovered
    V	13:51:33.142	[McuMgr] Primary service found
    D	13:51:33.147	[McuMgr] gatt.setCharacteristicNotification(da2e7828-fbce-4e01-ae9e-261174997c48, true)
    V	13:51:33.153	[McuMgr] Enabling notifications for da2e7828-fbce-4e01-ae9e-261174997c48
    D	13:51:33.158	[McuMgr] gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x01-00)
    I	13:51:33.254	[McuMgr] Data written to descr. 00002902-0000-1000-8000-00805f9b34fb
    V	13:51:33.264	[McuMgr] Waiting for value change...
    V	13:51:33.268	[McuMgr] Writing characteristic da2e7828-fbce-4e01-ae9e-261174997c48 (WRITE COMMAND)
    D	13:51:33.270	[McuMgr] gatt.writeCharacteristic(da2e7828-fbce-4e01-ae9e-261174997c48, value=0x000000010000FF06A0, WRITE COMMAND)
    I	13:51:33.277	[McuMgr] Data written to da2e7828-fbce-4e01-ae9e-261174997c48
    I	13:51:33.348	[McuMgr] Notification received from da2e7828-fbce-4e01-ae9e-261174997c48, value: (0x) 01-00-00-06-00-00-FF-06-BF-62-72-63-08-FF
    I	13:51:33.355	[McuMgr] Wait for value changed complete
    A	13:51:33.361	[McuMgr] Received Header (Op: 1, Flags: 0, Len: 6, Group: 0, Seq: 255, Command: 6) CBOR {"rc":8}
    W	13:51:33.365	[McuMgr] Error: NOT_SUPPORTED (8)
    A	13:51:33.372	[McuMgr] Sending (10 bytes) Header (Op: 0, Flags: 0, Len: 2, Group: 1, Seq: 0, Command: 0) CBOR {}
    V	13:51:33.375	[McuMgr] Writing characteristic da2e7828-fbce-4e01-ae9e-261174997c48 (WRITE COMMAND)
    D	13:51:33.378	[McuMgr] gatt.writeCharacteristic(da2e7828-fbce-4e01-ae9e-261174997c48, value=0x0000000200010000BFFF, WRITE COMMAND)
    I	13:51:33.387	[McuMgr] Data written to da2e7828-fbce-4e01-ae9e-261174997c48
    I	13:51:33.480	[McuMgr] Notification received from da2e7828-fbce-4e01-ae9e-261174997c48, value: (0x) 01-00-00-06-00-01-00-00-BF-62-72-63-08-FF
    A	13:51:33.491	[McuMgr] Received Header (Op: 1, Flags: 0, Len: 6, Group: 1, Seq: 0, Command: 0) CBOR {"rc":8}
    W	13:51:33.496	[McuMgr] Error: NOT_SUPPORTED (8)
    V	13:51:33.509	[McuMgr] Disconnecting...
    D	13:51:33.513	[McuMgr] gatt.disconnect()
    D	13:51:33.519	[McuMgr] [Callback] Connection state changed with status: 0 and new state: 0 (DISCONNECTED)
    I	13:51:33.521	[McuMgr] Disconnected
    D	13:51:33.522	[McuMgr] gatt.close()
    

  • Hi, 

    Try this peripheral_hr_DFU.7z, and use the sample pm_static.yml to update the image. See Static partition requirement for DFU.

    “Beware that this code/configuration is not fully tested or qualified and should be considered provided “as-is”. Please test it with your application and let me know if you find any issues.”

    -Amanda H.

Related