This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Failed to load dfu demo project: 'ble extFlash'.(with log)

Hi,

The product we are developing needs to support extern Flash-based FOTA, so I downloaded the ble_extFlash sample from the following link for reference:

https://github.com/aiminhua/ncs_samples/tree/master/smp_dfu/ble_extFlash

However, when I opened SES through SEGGER Embedded Studio.cmd and loaded ble_extFlash sample, I encountered an error. The error log is as follows:

Creating solution ble_extFlash.emProject
E:/code/Nordic/v1.9.1/toolchain/opt/bin/cmake.exe -GNinja -DBOARD=nrf52840dk_nrf52840 -DBOARD_DIR=E:\code\Nordic\v1.9.1\zephyr\boards\arm\nrf52840dk_nrf52840 -BE:\code\Nordic\myapps\ble_extFlash\build_nrf52840dk_nrf52840 -SE:\code\Nordic\myapps\ble_extFlash -DNCS_TOOLCHAIN_VERSION=1.9.1 -DEXTRA_KCONFIG_TARGETS=menuconfig_ses -DEXTRA_KCONFIG_TARGET_COMMAND_FOR_menuconfig_ses=E:\code\Nordic\v1.9.1\toolchain\segger_embedded_studio/html/configure_nordic_project_menuconfig.py
-- Application: E:/code/Nordic/myapps/ble_extFlash
-- Zephyr version: 2.7.99 (E:/code/Nordic/v1.9.1/zephyr), build: v2.7.99-ncs1-1
-- Found Python3: E:/code/Nordic/v1.9.1/toolchain/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter 
-- Found west (found suitable version "0.12.0", minimum required is "0.7.1")
-- Board: nrf52840dk_nrf52840
-- Cache files will be written to: E:/code/Nordic/v1.9.1/zephyr/.cache
-- Found dtc: E:/code/Nordic/v1.9.1/toolchain/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
-- Found toolchain: gnuarmemb (E:/code/Nordic/v1.9.1/toolchain/opt)
-- Found BOARD.dts: E:/code/Nordic/v1.9.1/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts
-- Found devicetree overlay: E:/code/Nordic/myapps/ble_extFlash/app.overlay
-- Generated zephyr.dts: E:/code/Nordic/myapps/ble_extFlash/build_nrf52840dk_nrf52840/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: E:/code/Nordic/myapps/ble_extFlash/build_nrf52840dk_nrf52840/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: E:/code/Nordic/myapps/ble_extFlash/build_nrf52840dk_nrf52840/zephyr/include/generated/device_extern.h
-- Including generated dts.cmake file: E:/code/Nordic/myapps/ble_extFlash/build_nrf52840dk_nrf52840/zephyr/dts.cmake
Parsing E:/code/Nordic/myapps/ble_extFlash/Kconfig
Loaded configuration 'E:/code/Nordic/v1.9.1/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840_defconfig'
Merged configuration 'E:/code/Nordic/myapps/ble_extFlash/prj.conf'
Configuration saved to 'E:/code/Nordic/myapps/ble_extFlash/build_nrf52840dk_nrf52840/zephyr/.config'
Kconfig header saved to 'E:/code/Nordic/myapps/ble_extFlash/build_nrf52840dk_nrf52840/zephyr/include/generated/autoconf.h'
-- 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: E:/code/Nordic/v1.9.1/toolchain/opt/bin/arm-none-eabi-gcc.exe
loading initial cache file E:/code/Nordic/myapps/ble_extFlash/build_nrf52840dk_nrf52840/mcuboot/child_image_preload.cmake
-- Application: E:/code/Nordic/v1.9.1/bootloader/mcuboot/boot/zephyr
-- Zephyr version: 2.7.99 (E:/code/Nordic/v1.9.1/zephyr), build: v2.7.99-ncs1-1
-- Found Python3: E:/code/Nordic/v1.9.1/toolchain/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter 
-- Found west (found suitable version "0.12.0", minimum required is "0.7.1")
-- Board: nrf52840dk_nrf52840
-- Cache files will be written to: E:/code/Nordic/v1.9.1/zephyr/.cache
-- Found dtc: E:/code/Nordic/v1.9.1/toolchain/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
-- Found toolchain: gnuarmemb (E:/code/Nordic/v1.9.1/toolchain/opt)
-- Found BOARD.dts: E:/code/Nordic/v1.9.1/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts
-- Found devicetree overlay: E:/code/Nordic/v1.9.1/nrf/modules/mcuboot/usb.overlay
-- Found devicetree overlay: E:/code/Nordic/v1.9.1/bootloader/mcuboot/boot/zephyr/dts.overlay
-- Generated zephyr.dts: E:/code/Nordic/myapps/ble_extFlash/build_nrf52840dk_nrf52840/mcuboot/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: E:/code/Nordic/myapps/ble_extFlash/build_nrf52840dk_nrf52840/mcuboot/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: E:/code/Nordic/myapps/ble_extFlash/build_nrf52840dk_nrf52840/mcuboot/zephyr/include/generated/device_extern.h
-- Including generated dts.cmake file: E:/code/Nordic/myapps/ble_extFlash/build_nrf52840dk_nrf52840/mcuboot/zephyr/dts.cmake
Parsing E:/code/Nordic/v1.9.1/bootloader/mcuboot/boot/zephyr/Kconfig
Loaded configuration 'E:/code/Nordic/v1.9.1/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840_defconfig'
Merged configuration 'E:/code/Nordic/v1.9.1/bootloader/mcuboot/boot/zephyr/prj.conf'
Merged configuration 'E:/code/Nordic/v1.9.1/nrf/subsys/partition_manager/ext_flash_mcuboot_secondary.conf'
Merged configuration 'E:/code/Nordic/v1.9.1/nrf/subsys/partition_manager/partition_manager_enabled.conf'
Merged configuration 'E:/code/Nordic/myapps/ble_extFlash/child_image/mcuboot.conf'
Merged configuration 'E:/code/Nordic/myapps/ble_extFlash/build_nrf52840dk_nrf52840/mcuboot/zephyr/misc/generated/extra_kconfig_options.conf'
-- Configuring incomplete, errors occurred!
-- Configuring incomplete, errors occurred!
See also "E:/code/Nordic/myapps/ble_extFlash/build_nrf52840dk_nrf52840/CMakeFiles/CMakeOutput.log".
See also "E:/code/Nordic/myapps/ble_extFlash/build_nrf52840dk_nrf52840/CMakeFiles/CMakeError.log".
Including boilerplate (Zephyr base): E:/code/Nordic/v1.9.1/zephyr/cmake/app/boilerplate.cmake
-- Using NCS Toolchain 1.9.1 for building. (E:/code/Nordic/v1.9.1/toolchain/cmake)
E:\code\Nordic\v1.9.1\toolchain\opt\bin\arm-none-eabi-gdb.exe: warning: Couldn't determine a path for the index cache directory.

=== child image mcuboot -  begin ===
CMake Warning (dev) at E:/code/Nordic/myapps/ble_extFlash/build_nrf52840dk_nrf52840/mcuboot/child_image_preload.cmake:9 (set):
  Syntax error in cmake code at

    E:/code/Nordic/myapps/ble_extFlash/build_nrf52840dk_nrf52840/mcuboot/child_image_preload.cmake:9

  when parsing string

    E:\code\Nordic\v1.9.1\toolchain\segger_embedded_studio/html/configure_nordic_project_menuconfig.py

  Invalid escape sequence \c

  Policy CMP0010 is not set: Bad variable reference syntax is an error.  Run
  "cmake --help-policy CMP0010" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.
This warning is for project developers.  Use -Wno-dev to suppress it.

Including boilerplate (Zephyr base): E:/code/Nordic/v1.9.1/zephyr/cmake/app/boilerplate.cmake
-- Using NCS Toolchain 1.9.1 for building. (E:/code/Nordic/v1.9.1/toolchain/cmake)

E:/code/Nordic/myapps/ble_extFlash/child_image/mcuboot.conf:16: warning: attempt to assign the value 'y' to the undefined symbol SYSTEM_CLOCK_DISABLE

error: Aborting due to Kconfig warnings

CMake Error at E:/code/Nordic/v1.9.1/zephyr/cmake/kconfig.cmake:272 (message):
  command failed with return code: 1
Call Stack (most recent call first):
  E:/code/Nordic/v1.9.1/zephyr/cmake/app/boilerplate.cmake:544 (include)
  E:/code/Nordic/v1.9.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
  E:/code/Nordic/v1.9.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:35 (include_boilerplate)
  CMakeLists.txt:44 (find_package)


CMake Error at E:/code/Nordic/v1.9.1/nrf/cmake/multi_image.cmake:409 (message):
  CMake generation for mcuboot failed, aborting.  Command: 1
Call Stack (most recent call first):
  E:/code/Nordic/v1.9.1/nrf/cmake/multi_image.cmake:150 (add_child_image_from_source)
  E:/code/Nordic/v1.9.1/nrf/modules/mcuboot/CMakeLists.txt:216 (add_child_image)



error: cmake failed
create_nordic_project.py failed (1)
And the prj.conf is as follows:

#
# Copyright (c) 2018 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

CONFIG_GPIO=y

CONFIG_HEAP_MEM_POOL_SIZE=8192

CONFIG_BT=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DEVICE_NAME="SMP_DFU"
CONFIG_BT_DEVICE_APPEARANCE=833
CONFIG_BT_MAX_CONN=1
CONFIG_BT_MAX_PAIRED=1
CONFIG_BT_ID_MAX=1


CONFIG_BT_AUTO_DATA_LEN_UPDATE=y
# CONFIG_BT_USER_DATA_LEN_UPDATE=y
# CONFIG_BT_AUTO_PHY_UPDATE=y
CONFIG_BT_USER_PHY_UPDATE=y
# CONFIG_BT_GAP_AUTO_UPDATE_CONN_PARAMS=y
# CONFIG_BT_PERIPHERAL_PREF_MIN_INT=8
# CONFIG_BT_PERIPHERAL_PREF_MAX_INT=15
# CONFIG_BT_PERIPHERAL_PREF_TIMEOUT=200


CONFIG_BT_GATT_CLIENT=y
CONFIG_BT_ATT_PREPARE_COUNT=2
CONFIG_BT_CONN_TX_MAX=3
CONFIG_BT_L2CAP_TX_BUF_COUNT=3
CONFIG_BT_L2CAP_TX_MTU=247
CONFIG_BT_CTLR_PHY_2M=y
CONFIG_BT_CTLR_RX_BUFFERS=5
CONFIG_BT_CTLR_DATA_LENGTH_MAX=251

# Open the following config for NCS v1.5.x or earlier
# CONFIG_BT_RX_BUF_LEN=255
# CONFIG_BT_ATT_TX_MAX=3
# CONFIG_BT_L2CAP_RX_MTU=247
# CONFIG_BT_CTLR_TX_BUFFERS=3
# CONFIG_BT_CTLR_TX_BUFFER_SIZE=251

# Open the following config for NCS v1.6.x or newer
CONFIG_BT_BUF_ACL_RX_SIZE=251
CONFIG_BT_BUF_ACL_TX_COUNT=10
CONFIG_BT_BUF_ACL_TX_SIZE=251

# Enable the NUS service
CONFIG_BT_NUS=y

# Enable bonding
# CONFIG_BT_SETTINGS=y
# CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y
# CONFIG_BT_SETTINGS_CCC_STORE_ON_WRITE=y
# CONFIG_BT_NUS_SECURITY_ENABLED=y
# CONFIG_BT_SMP_ALLOW_UNAUTH_OVERWRITE=y
# # CONFIG_BT_USE_DEBUG_KEYS=y
# # CONFIG_BT_STORE_DEBUG_KEYS=y

CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=y

# Enable DK LED and Buttons library
CONFIG_DK_LIBRARY=y

# This example requires more workqueue stack
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

# Config logger
CONFIG_LOG=y
# CONFIG_USE_SEGGER_RTT=y
# CONFIG_LOG_BACKEND_RTT=y
CONFIG_LOG_BACKEND_UART=y
CONFIG_CONSOLE=y
# CONFIG_RTT_CONSOLE=y
CONFIG_ASSERT=y
CONFIG_ASSERT_LEVEL=2

CONFIG_SERIAL=y
CONFIG_UART_ASYNC_API=y
CONFIG_UART_0_ASYNC=y
CONFIG_NRFX_UARTE0=y
CONFIG_UART_0_NRF_HW_ASYNC=y
CONFIG_UART_0_NRF_HW_ASYNC_TIMER=1

CONFIG_BT_RX_STACK_SIZE=4096

# Open the following config for NCS v1.7.x or earlier
# CONFIG_PM_EXTERNAL_FLASH=y
# CONFIG_PM_EXTERNAL_FLASH_DEV_NAME="MX25R64"
# CONFIG_PM_EXTERNAL_FLASH_BASE=0x0
# CONFIG_PM_EXTERNAL_FLASH_SIZE=0x800000

# Open the following config for NCS v1.7.x
# CONFIG_PM_EXTERNAL_FLASH_SUPPORT_LEGACY=y

## secondary slot on external Flash ##
CONFIG_PM_PARTITION_SIZE_SETTINGS_STORAGE=0x4000
CONFIG_NORDIC_QSPI_NOR=y
CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16
CONFIG_STREAM_FLASH=y
CONFIG_STREAM_FLASH_ERASE=y

CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_MCUMGR=y
CONFIG_MCUMGR_SMP_BT=y
CONFIG_MCUMGR_SMP_BT_AUTHEN=n
CONFIG_MCUMGR_CMD_IMG_MGMT=y
CONFIG_MCUMGR_CMD_OS_MGMT=y
CONFIG_OS_MGMT_TASKSTAT=n
CONFIG_OS_MGMT_ECHO=y
CONFIG_IMG_BLOCK_BUF_SIZE=2048
CONFIG_MCUMGR_BUF_SIZE=256
CONFIG_MCUMGR_BUF_COUNT=4
CONFIG_MGMT_CBORATTR_MAX_SIZE=512

CONFIG_MAIN_STACK_SIZE=2048

Platform: Windows 10

NCS version: 1.9.1

Boards: nrf52840dk_nrf52840

IDE: SEGGER Embedded StudioSES

PS: I tried to delete CONFIG_BOOTLOADER_MCUBOOT=y and no error was reported, but I still don't know why. CONFIG_BOOTLOADER_MCUBOOT must be enabled for FOTA, right?

Related