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?

Parents
  • Hi,

    This seems to be a bug in SES setting a path incorrectly, causing CMake to fail when generating for MCUboot. Please try building with VS Code or on command line instead.

    Please be aware that the example you are linking to has not been tested in nRF Connect SDK v1.9.1, only v1.8.1 and earlier, and that this is not an official example.

    For DFU you can also use the SMP Server Sample. This does not use external flash, but you can add it yourself by following Partition Manager » External flash memory partitions and Using external flash memory partitions.

    Best regards,

    Marte

  • In addition, I see that the example uses QSPI External Flash, can I replace it with SPI External Flash?

  • Hi,

    Yes, you can also use external SPI flash.

    Best regards,

    Marte

  • Hi Marte,

    Is there a .dts example for external SPI flash?

    Just like this:

    &qspi {
    	status = "okay";
    	sck-pin = <19>;
    	io-pins = <20>, <21>, <22>, <23>;
    	csn-pins = <17>;
    	mx25r64: mx25r6435f@0 {
    		compatible = "nordic,qspi-nor";
    		reg = <0>;
    		/* MX25R64 supports only pp and pp4io */
    		writeoc = "pp4io";
    		/* MX25R64 supports all readoc options */
    		readoc = "read4io";
    		sck-frequency = <8000000>;
    		label = "MX25R64";
    		jedec-id = [c2 28 17];
    		sfdp-bfp = [
    			e5 20 f1 ff  ff ff ff 03  44 eb 08 6b  08 3b 04 bb
    			ee ff ff ff  ff ff 00 ff  ff ff 00 ff  0c 20 0f 52
    			10 d8 00 ff  23 72 f5 00  82 ed 04 cc  44 83 68 44
    			30 b0 30 b0  f7 c4 d5 5c  00 be 29 ff  f0 d0 ff ff
    		];
    		size = <67108864>;
    		has-dpd;
    		t-enter-dpd = <10000>;
    		t-exit-dpd = <35000>;
    	};
    };

  • Hi,

    There are some examples for nRF9160 DK, for example in LwM2M client sample and HTTP full modem update sample:

    &spi3 {
    	compatible = "nordic,nrf-spim";
    	status = "okay";
    	sck-pin = <13>;
    	mosi-pin = <11>;
    	miso-pin = <12>;
    	cs-gpios = <&gpio0 25 GPIO_ACTIVE_LOW>;
    	mx25r64: mx25r6435f@0 {
    		compatible = "jedec,spi-nor";
    		reg = <0>;
    		spi-max-frequency = <80000000>;
    		label = "MX25R64";
    		jedec-id = [c2 28 17];
    		size = <67108864>;
    	};
    };
    

    This is from nrf/samples/nrf9160/lwm2m_client/boards/nrf9160dk_nrf9160_ns.overlay, and you will find something similar in nrf/samples/nrf9160/http_update/full_modem_update/boards/nrf9160dk_nrf9160_ns.overlay.

    Best regards,

    Marte

Reply
  • Hi,

    There are some examples for nRF9160 DK, for example in LwM2M client sample and HTTP full modem update sample:

    &spi3 {
    	compatible = "nordic,nrf-spim";
    	status = "okay";
    	sck-pin = <13>;
    	mosi-pin = <11>;
    	miso-pin = <12>;
    	cs-gpios = <&gpio0 25 GPIO_ACTIVE_LOW>;
    	mx25r64: mx25r6435f@0 {
    		compatible = "jedec,spi-nor";
    		reg = <0>;
    		spi-max-frequency = <80000000>;
    		label = "MX25R64";
    		jedec-id = [c2 28 17];
    		size = <67108864>;
    	};
    };
    

    This is from nrf/samples/nrf9160/lwm2m_client/boards/nrf9160dk_nrf9160_ns.overlay, and you will find something similar in nrf/samples/nrf9160/http_update/full_modem_update/boards/nrf9160dk_nrf9160_ns.overlay.

    Best regards,

    Marte

Children
Related