mcuboot on nrf52840 dongle (using external debugger)

Hi,

I am using a nrf52840 dongle with a jlink mini on the latest nRF Connect. I have modified the board dts file to reflect that I am using an external debugger: include "fstab_debugger.dts" and I have also set BOARD_HAS_NRF5_BOOTLOADER to "n". Running examples works fine. I have now tried to add CONFIG_BOOTLOADER_MCUBOOT=y and I get a flash overflow. Other posts I have searched (see here (https://devzone.nordicsemi.com/f/nordic-q-a/77252/nrf52840dongle_nrf52840-config_bootloader_mcuboot-y-partition-to-small) seem to indicate that the problem for the overflow is the NRF USB bootloader - which I don't use.

As the application code is small, I guessed the problem is with mcuboot not fitting somewhere, but I could not find out what is the problem. When comparing the flash layout with the 52840DK, the space reserved for mcuboot on the dongle is even larger than on the DK:

Dongle:

		boot_partition: partition@0 {
			label = "mcuboot";
			reg = <0x000000000 0x00012000>;
		};

		slot0_partition: partition@12000 {
			label = "image-0";
			reg = <0x00012000 0x000069000>;
		};
		slot1_partition: partition@7b000 {
			label = "image-1";
			reg = <0x0007b000 0x000069000>;
		};
		scratch_partition: partition@e4000 {
			label = "image-scratch";
			reg = <0x000e4000 0x00018000>;
		};

				
		storage_partition: partition@fc000 {
			label = "storage";
			reg = <0x000fc000 0x00004000>;
		};

DK:

		boot_partition: partition@0 {
			label = "mcuboot";
			reg = <0x000000000 0x0000C000>;
		};
		slot0_partition: partition@c000 {
			label = "image-0";
			reg = <0x0000C000 0x00067000>;
		};
		slot1_partition: partition@73000 {
			label = "image-1";
			reg = <0x00073000 0x00067000>;
		};
		scratch_partition: partition@da000 {
			label = "image-scratch";
			reg = <0x000da000 0x0001e000>;
		};

		storage_partition: partition@f8000 {
			label = "storage";
			reg = <0x000f8000 0x00008000>;
		};

I would like to understand what goes wrong here. mcuboot and a small application should fit onto the 1MB flash I'd guess. I know the dongle is not recommended for development (need a debugger, only 1 button etc), but it should be no problem to use with mcuboot? The same code compiles correctly when configured for the DK. I have tried to use the dts settings from the DK on the dongle, but the flash overflow error remains, so the problem does not seem to come from the partition layout. I also attach the build output:

-- west build: generating a build system
Including boilerplate (Zephyr base): /home/claus/dev/ncs/zephyr/cmake/app/boilerplate.cmake
CMake Deprecation Warning at /home/claus/dev/ncs/zephyr/cmake/app/boilerplate.cmake:37 (cmake_policy):
  The OLD behavior for policy CMP0079 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  /home/claus/dev/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
  /home/claus/dev/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:35 (include_boilerplate)
  /home/claus/dev/nordic/hello_dongle/build/CMakeLists.txt:5 (find_package)


-- Application: /home/claus/dev/nordic/hello_dongle
-- Zephyr version: 2.6.99 (/home/claus/dev/ncs/zephyr), build: v2.6.99-ncs1-1
-- Found Python3: /usr/bin/python3.8 (found suitable exact version "3.8.10") found components: Interpreter 
-- Found west (found suitable version "0.12.0", minimum required is "0.7.1")
-- Board: nrf52840dongle_nrf52840
-- Cache files will be written to: /home/claus/.cache/zephyr
-- Found dtc: /usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6")
-- Found toolchain: gnuarmemb (/home/claus/.local/gcc-arm-none-eabi-9-2019-q4-major)
-- Found BOARD.dts: /home/claus/dev/ncs/zephyr/boards/arm/nrf52840dongle_nrf52840/nrf52840dongle_nrf52840.dts
-- Generated zephyr.dts: /home/claus/dev/nordic/hello_dongle/build/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: /home/claus/dev/nordic/hello_dongle/build/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: /home/claus/dev/nordic/hello_dongle/build/zephyr/include/generated/device_extern.h
-- Including generated dts.cmake file: /home/claus/dev/nordic/hello_dongle/build/zephyr/dts.cmake
Parsing /home/claus/dev/ncs/zephyr/Kconfig
Loaded configuration '/home/claus/dev/ncs/zephyr/boards/arm/nrf52840dongle_nrf52840/nrf52840dongle_nrf52840_defconfig'
Merged configuration '/home/claus/dev/nordic/hello_dongle/prj.conf'
Merged configuration '/home/claus/dev/nordic/hello_dongle/build/zephyr/misc/generated/extra_kconfig_options.conf'
Configuration saved to '/home/claus/dev/nordic/hello_dongle/build/zephyr/.config'
Kconfig header saved to '/home/claus/dev/nordic/hello_dongle/build/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: /home/claus/.local/gcc-arm-none-eabi-9-2019-q4-major/bin/arm-none-eabi-gcc
CMake Warning at /home/claus/dev/ncs/zephyr/subsys/debug/CMakeLists.txt:4 (message):
  CONFIG_OPENOCD_SUPPORT is deprecated

    Please use DEBUG_THREAD_INFO instead.



=== child image mcuboot -  begin ===
Including boilerplate (Zephyr base): /home/claus/dev/ncs/zephyr/cmake/app/boilerplate.cmake
CMake Deprecation Warning at /home/claus/dev/ncs/zephyr/cmake/app/boilerplate.cmake:37 (cmake_policy):
  The OLD behavior for policy CMP0079 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  /home/claus/dev/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
  /home/claus/dev/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:35 (include_boilerplate)
  /home/claus/dev/nordic/hello_dongle/build/CMakeLists.txt:44 (find_package)


-- Application: /home/claus/dev/ncs/bootloader/mcuboot/boot/zephyr
-- Zephyr version: 2.6.99 (/home/claus/dev/ncs/zephyr), build: v2.6.99-ncs1-1
-- Found Python3: /usr/bin/python3.8 (found suitable exact version "3.8.10") found components: Interpreter 
-- Found west (found suitable version "0.12.0", minimum required is "0.7.1")
-- Board: nrf52840dongle_nrf52840
-- Cache files will be written to: /home/claus/.cache/zephyr
-- Found dtc: /usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6")
-- Found toolchain: gnuarmemb (/home/claus/.local/gcc-arm-none-eabi-9-2019-q4-major)
-- Found BOARD.dts: /home/claus/dev/ncs/zephyr/boards/arm/nrf52840dongle_nrf52840/nrf52840dongle_nrf52840.dts
-- Found devicetree overlay: /home/claus/dev/ncs/bootloader/mcuboot/boot/zephyr/dts.overlay
-- Generated zephyr.dts: /home/claus/dev/nordic/hello_dongle/build/mcuboot/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: /home/claus/dev/nordic/hello_dongle/build/mcuboot/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: /home/claus/dev/nordic/hello_dongle/build/mcuboot/zephyr/include/generated/device_extern.h
-- Including generated dts.cmake file: /home/claus/dev/nordic/hello_dongle/build/mcuboot/zephyr/dts.cmake

warning: LOG_DEFAULT_LEVEL (defined at /home/claus/dev/ncs/nrf/samples/Kconfig:34,
/home/claus/dev/nordic/hello_dongle/build/subsys/logging/Kconfig.filtering:13) was assigned the value '0' but got the value ''. Check these
unsatisfied dependencies: (LOG || LOG) (=n). See
http://docs.zephyrproject.org/latest/reference/kconfig/CONFIG_LOG_DEFAULT_LEVEL.html and/or look up
LOG_DEFAULT_LEVEL in the menuconfig/guiconfig interface. The Application Development Primer, Setting
Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful
too.


warning: CONSOLE_HANDLER (defined at /home/claus/dev/nordic/hello_dongle/build/drivers/console/Kconfig:39) was assigned the value 'y' but got
the value 'n'. Check these unsatisfied dependencies: UART_CONSOLE (=n). See
http://docs.zephyrproject.org/latest/reference/kconfig/CONFIG_CONSOLE_HANDLER.html and/or look up
CONSOLE_HANDLER in the menuconfig/guiconfig interface. The Application Development Primer, Setting
Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful
too.


warning: The choice symbol LOG_MODE_MINIMAL (defined at /home/claus/dev/nordic/hello_dongle/build/subsys/logging/Kconfig.mode:45) was selected
(set =y), but no symbol ended up as the choice selection. See
http://docs.zephyrproject.org/latest/reference/kconfig/CONFIG_LOG_MODE_MINIMAL.html and/or look up
LOG_MODE_MINIMAL in the menuconfig/guiconfig interface. The Application Development Primer, Setting
Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful
too.

Parsing /home/claus/dev/ncs/bootloader/mcuboot/boot/zephyr/Kconfig
Loaded configuration '/home/claus/dev/ncs/zephyr/boards/arm/nrf52840dongle_nrf52840/nrf52840dongle_nrf52840_defconfig'
Merged configuration '/home/claus/dev/ncs/bootloader/mcuboot/boot/zephyr/prj.conf'
Merged configuration '/home/claus/dev/ncs/bootloader/mcuboot/boot/zephyr/boards/nrf52840dongle_nrf52840.conf'
Merged configuration '/home/claus/dev/ncs/nrf/subsys/partition_manager/partition_manager_enabled.conf'
Configuration saved to '/home/claus/dev/nordic/hello_dongle/build/mcuboot/zephyr/.config'
Kconfig header saved to '/home/claus/dev/nordic/hello_dongle/build/mcuboot/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: /home/claus/.local/gcc-arm-none-eabi-9-2019-q4-major/bin/arm-none-eabi-gcc
CMake Warning at /home/claus/dev/ncs/zephyr/subsys/usb/CMakeLists.txt:22 (message):
  CONFIG_USB_DEVICE_VID has default value 0x2FE3.

  This value is only for testing and MUST be configured for USB products.


CMake Warning at /home/claus/dev/ncs/zephyr/subsys/usb/CMakeLists.txt:28 (message):
  CONFIG_USB_DEVICE_PID has default value 0x100.

  This value is only for testing and MUST be configured for USB products.


CMake Warning at /home/claus/dev/ncs/nrf/lib/flash_patch/CMakeLists.txt:9 (message):
  

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


MCUBoot bootloader key file: /home/claus/dev/ncs/bootloader/mcuboot/root-ec-p256.pem
-- Configuring done
-- Generating done
-- Build files have been written to: /home/claus/dev/nordic/hello_dongle/build/mcuboot
=== child image mcuboot -  end ===

CMake Warning at /home/claus/dev/ncs/nrf/modules/mcuboot/CMakeLists.txt:204 (message):
  

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



-- Configuring done
-- Generating done
-- Build files have been written to: /home/claus/dev/nordic/hello_dongle/build
-- west build: building application
[1/174] Preparing syscall dependency handling

[2/174] Creating directories for 'mcuboot_subimage'
[3/174] No download step for 'mcuboot_subimage'
[4/174] No update step for 'mcuboot_subimage'
[5/174] No patch step for 'mcuboot_subimage'
[6/174] No configure step for 'mcuboot_subimage'
[6/174] Performing build step for 'mcuboot_subimage'
[1/203] Preparing syscall dependency handling

[2/203] Generating misc/generated/syscalls_subdirs.trigger
[3/203] Generating misc/generated/syscalls.json, misc/generated/struct_tags.json
[4/203] Generating include/generated/driver-validation.h
[5/203] Generating include/generated/kobj-types-enum.h, include/generated/otype-to-str.h, include/generated/otype-to-size.h
[6/203] Generating include/generated/syscall_dispatch.c, include/generated/syscall_list.h
[7/203] Building C object zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj
[8/203] Generating include/generated/offsets.h
[9/203] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/base64.c.obj
[10/203] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf.c.obj
[11/203] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf_packaged.c.obj
[12/203] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc32c_sw.c.obj
[13/203] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc32_sw.c.obj
[14/203] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc16_sw.c.obj
[15/203] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc8_sw.c.obj
[16/203] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc7_sw.c.obj
[17/203] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/dec.c.obj
[18/203] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/fdtable.c.obj
[19/203] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/hex.c.obj
[20/203] Generating zephyr/autogen-pubkey.c
[21/203] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/notify.c.obj
[22/203] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/printk.c.obj
[23/203] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/rb.c.obj
[24/203] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/sem.c.obj
[25/203] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/timeutil.c.obj
[26/203] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/heap.c.obj
[27/203] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/heap-validate.c.obj
[28/203] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/onoff.c.obj
[29/203] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/thread_entry.c.obj
[30/203] Building C object CMakeFiles/app.dir/flash_map_extended.c.obj
[31/203] Building C object CMakeFiles/app.dir/os.c.obj
[32/203] Building C object CMakeFiles/app.dir/keys.c.obj
[33/203] Building C object CMakeFiles/app.dir/home/claus/dev/ncs/bootloader/mcuboot/boot/bootutil/src/image_validate.c.obj
[34/203] Building C object CMakeFiles/app.dir/home/claus/dev/ncs/bootloader/mcuboot/boot/bootutil/src/tlv.c.obj
[35/203] Building C object CMakeFiles/app.dir/home/claus/dev/ncs/bootloader/mcuboot/boot/bootutil/src/encrypted.c.obj
[36/203] Building C object CMakeFiles/app.dir/home/claus/dev/ncs/bootloader/mcuboot/boot/bootutil/src/image_rsa.c.obj
[37/203] Building C object CMakeFiles/app.dir/home/claus/dev/ncs/bootloader/mcuboot/boot/bootutil/src/image_ec256.c.obj
[38/203] Building C object CMakeFiles/app.dir/home/claus/dev/ncs/bootloader/mcuboot/boot/bootutil/src/image_ed25519.c.obj
[39/203] Building C object CMakeFiles/app.dir/home/claus/dev/ncs/bootloader/mcuboot/boot/bootutil/src/bootutil_misc.c.obj
[40/203] Building C object CMakeFiles/app.dir/home/claus/dev/ncs/bootloader/mcuboot/boot/bootutil/src/fault_injection_hardening.c.obj
[41/203] Building C object CMakeFiles/app.dir/home/claus/dev/ncs/bootloader/mcuboot/boot/bootutil/src/loader.c.obj
[42/203] Building C object CMakeFiles/app.dir/home/claus/dev/ncs/bootloader/mcuboot/boot/bootutil/src/swap_misc.c.obj
[43/203] Building C object CMakeFiles/app.dir/home/claus/dev/ncs/bootloader/mcuboot/boot/bootutil/src/swap_move.c.obj
[44/203] Building C object CMakeFiles/app.dir/home/claus/dev/ncs/bootloader/mcuboot/ext/mbedtls-asn1/src/asn1parse.c.obj
[45/203] Building C object CMakeFiles/app.dir/home/claus/dev/ncs/bootloader/mcuboot/ext/nrf/cc310_glue.c.obj
[46/203] Building C object CMakeFiles/app.dir/home/claus/dev/ncs/bootloader/mcuboot/boot/bootutil/src/swap_scratch.c.obj
[47/203] Building C object CMakeFiles/app.dir/home/claus/dev/ncs/bootloader/mcuboot/boot/bootutil/src/caps.c.obj
[48/203] Building C object CMakeFiles/app.dir/home/claus/dev/ncs/bootloader/mcuboot/ext/mbedtls-asn1/src/platform_util.c.obj
[49/203] Building C object CMakeFiles/app.dir/nrf_cleanup.c.obj
[50/203] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/ring_buffer.c.obj
[51/203] Building C object zephyr/CMakeFiles/zephyr.dir/misc/generated/configs.c.obj
[52/203] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/reboot.c.obj
[53/203] Building C object CMakeFiles/app.dir/main.c.obj
[54/203] Building C object CMakeFiles/app.dir/zephyr/autogen-pubkey.c.obj
[55/203] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/bitarray.c.obj
[56/203] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf_nano.c.obj
[57/203] Building ASM object zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/common/soc_nrf_common.S.obj
[58/203] Building C object zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/validate_base_addresses.c.obj
[59/203] Building C object zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/validate_enabled_instances.c.obj
[60/203] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/usb/usb_device.c.obj
[61/203] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/usb/usb_descriptor.c.obj
[62/203] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/usb/usb_transfer.c.obj
[63/203] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/usb/class/cdc_acm.c.obj
[64/203] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/storage/flash_map/flash_map.c.obj
[65/203] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/usb/usb_work_q.c.obj
[66/203] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/pm/power.c.obj
[67/203] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/pm/pm_ctrl.c.obj
[68/203] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/tracing/tracing_none.c.obj
[69/203] Building C object zephyr/CMakeFiles/zephyr.dir/drivers/clock_control/clock_control_nrf.c.obj
[70/203] Linking C static library app/libapp.a
[71/203] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/pm/policy/policy_residency.c.obj
[72/203] Building C object zephyr/CMakeFiles/zephyr.dir/drivers/usb/device/usb_dc_nrfx.c.obj
[73/203] Building C object zephyr/CMakeFiles/zephyr.dir/drivers/timer/sys_clock_init.c.obj
[74/203] Building C object zephyr/CMakeFiles/zephyr.dir/drivers/hwinfo/hwinfo_weak_impl.c.obj
[75/203] Building C object zephyr/CMakeFiles/zephyr.dir/drivers/hwinfo/hwinfo_nrf.c.obj
[76/203] Building C object zephyr/CMakeFiles/zephyr.dir/drivers/timer/nrf_rtc_timer.c.obj
[77/203] Building C object zephyr/CMakeFiles/zephyr.dir/home/claus/dev/ncs/nrf/subsys/partition_manager/flash_map_partition_manager.c.obj
[78/203] Building C object zephyr/CMakeFiles/zephyr.dir/home/claus/dev/ncs/nrfxlib/crypto/nrf_cc310_platform/src/nrf_cc3xx_platform_abort_zephyr.c.obj
[79/203] Building C object zephyr/CMakeFiles/zephyr.dir/home/claus/dev/ncs/nrfxlib/crypto/nrf_cc310_platform/src/nrf_cc3xx_platform_mutex_zephyr.c.obj
[80/203] Building C object zephyr/CMakeFiles/zephyr.dir/home/claus/dev/ncs/bootloader/mcuboot/boot/zephyr/serial_adapter.c.obj
[81/203] Building C object zephyr/CMakeFiles/zephyr.dir/home/claus/dev/ncs/bootloader/mcuboot/boot/boot_serial/src/boot_serial.c.obj
[82/203] Building C object zephyr/CMakeFiles/zephyr.dir/home/claus/dev/ncs/bootloader/mcuboot/boot/boot_serial/src/serial_recovery_cbor.c.obj
[83/203] Building C object zephyr/CMakeFiles/zephyr.dir/home/claus/dev/ncs/bootloader/mcuboot/boot/boot_serial/src/cbor_decode.c.obj
[84/203] Building C object zephyr/CMakeFiles/zephyr.dir/home/claus/dev/ncs/bootloader/mcuboot/boot/boot_serial/src/cbor_encode.c.obj
[85/203] Building C object zephyr/CMakeFiles/zephyr.dir/home/claus/dev/ncs/bootloader/mcuboot/boot/boot_serial/src/cbor_common.c.obj
[86/203] Building C object zephyr/arch/common/CMakeFiles/isr_tables.dir/isr_tables.c.obj
[87/203] Building C object zephyr/arch/common/CMakeFiles/arch__common.dir/sw_isr_common.c.obj
[88/203] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/swap.c.obj
[89/203] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/swap_helper.S.obj
[90/203] Generating linker_zephyr_prebuilt.cmd
[91/203] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/cpu_idle.S.obj
[92/203] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/irq_manage.c.obj
[93/203] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/fatal.c.obj
[94/203] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/nmi.c.obj
[95/203] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/nmi_on_reset.S.obj
[96/203] Building C object zephyr/CMakeFiles/zephyr_prebuilt.dir/misc/empty_file.c.obj
[97/203] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/thread.c.obj
[98/203] Linking C static library zephyr/arch/common/libisr_tables.a
[99/203] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/prep_c.c.obj
[100/203] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/isr_wrapper.S.obj
[101/203] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/vector_table.S.obj
[102/203] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/fault_s.S.obj
[103/203] Linking C static library zephyr/libzephyr.a
[104/203] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/reset.S.obj
[105/203] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/fault.c.obj
[106/203] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/exc_exit.S.obj
[107/203] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/fpu.c.obj
[108/203] Linking C static library zephyr/arch/common/libarch__common.a
[109/203] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/scb.c.obj
[110/203] Linking C static library zephyr/arch/arch/arm/core/aarch32/libarch__arm__core__aarch32.a
[111/203] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/irq_init.c.obj
[112/203] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/thread_abort.c.obj
[113/203] Building C object zephyr/arch/arch/arm/core/aarch32/mpu/CMakeFiles/arch__arm__core__aarch32__mpu.dir/arm_core_mpu.c.obj
[114/203] Building C object zephyr/arch/arch/arm/core/aarch32/mpu/CMakeFiles/arch__arm__core__aarch32__mpu.dir/arm_mpu.c.obj
[115/203] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/abort.c.obj
[116/203] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/atoi.c.obj
[117/203] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/strtol.c.obj
[118/203] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/strtoul.c.obj
[119/203] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/malloc.c.obj
[120/203] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/bsearch.c.obj
[121/203] Linking C static library zephyr/arch/arch/arm/core/aarch32/cortex_m/libarch__arm__core__aarch32__cortex_m.a
[122/203] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/string/strncasecmp.c.obj
[123/203] Linking C static library zephyr/arch/arch/arm/core/aarch32/mpu/libarch__arm__core__aarch32__mpu.a
[124/203] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/string/strstr.c.obj
[125/203] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/exit.c.obj
[126/203] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/string/string.c.obj
[127/203] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/string/strspn.c.obj
[128/203] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdout/stdout_console.c.obj
[129/203] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdout/sprintf.c.obj
[130/203] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdout/fprintf.c.obj
[131/203] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/time/gmtime.c.obj
[132/203] Building C object zephyr/lib/posix/CMakeFiles/lib__posix.dir/pthread_common.c.obj
[133/203] Building C object zephyr/lib/posix/CMakeFiles/lib__posix.dir/nanosleep.c.obj
[134/203] Building C object modules/nrf/drivers/hw_cc310/CMakeFiles/..__nrf__drivers__hw_cc310.dir/hw_cc310.c.obj
[135/203] Building C object zephyr/soc/arm/common/cortex_m/CMakeFiles/soc__arm__common__cortex_m.dir/arm_mpu_regions.c.obj
[136/203] Building C object zephyr/soc/arm/nordic_nrf/nrf52/CMakeFiles/soc__arm__nordic_nrf__nrf52.dir/power.c.obj
[137/203] Building C object zephyr/drivers/gpio/CMakeFiles/drivers__gpio.dir/gpio_nrfx.c.obj
[138/203] Building C object zephyr/soc/arm/nordic_nrf/nrf52/CMakeFiles/soc__arm__nordic_nrf__nrf52.dir/soc.c.obj
[139/203] Building C object zephyr/boards/boards/arm/nrf52840dongle_nrf52840/CMakeFiles/boards__arm__nrf52840dongle_nrf52840.dir/board.c.obj
[140/203] Building C object zephyr/drivers/flash/CMakeFiles/drivers__flash.dir/soc_flash_nrf.c.obj
[141/203] Building C object zephyr/drivers/flash/CMakeFiles/drivers__flash.dir/flash_page_layout.c.obj
[142/203] Building C object zephyr/drivers/serial/CMakeFiles/drivers__serial.dir/home/claus/dev/ncs/zephyr/misc/empty_file.c.obj
[143/203] Linking C static library zephyr/lib/libc/minimal/liblib__libc__minimal.a
[144/203] Building C object zephyr/drivers/serial/CMakeFiles/drivers__serial.dir/uart_nrfx_uarte.c.obj
[145/203] Linking C static library zephyr/lib/posix/liblib__posix.a
[146/203] Linking C static library zephyr/soc/arm/common/cortex_m/libsoc__arm__common__cortex_m.a
[147/203] Linking C static library zephyr/drivers/gpio/libdrivers__gpio.a
[148/203] Linking C static library zephyr/soc/arm/nordic_nrf/nrf52/libsoc__arm__nordic_nrf__nrf52.a
[149/203] Building C object modules/nrf/lib/fprotect/CMakeFiles/..__nrf__lib__fprotect.dir/fprotect_acl.c.obj
[150/203] Building C object modules/nrf/lib/fatal_error/CMakeFiles/..__nrf__lib__fatal_error.dir/fatal_error.c.obj
[151/203] Linking C static library zephyr/boards/boards/arm/nrf52840dongle_nrf52840/libboards__arm__nrf52840dongle_nrf52840.a
[152/203] Linking C static library zephyr/drivers/flash/libdrivers__flash.a
[153/203] Linking C static library modules/nrf/drivers/hw_cc310/lib..__nrf__drivers__hw_cc310.a
[154/203] Building C object modules/mcuboot/boot/bootutil/zephyr/CMakeFiles/mcuboot_util.dir/home/claus/dev/ncs/bootloader/mcuboot/boot/bootutil/src/bootutil_public.c.obj
[155/203] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/home/claus/dev/ncs/modules/hal/nordic/nrfx/mdk/system_nrf52840.c.obj
[156/203] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/nrfx_glue.c.obj
[157/203] Linking C static library zephyr/drivers/serial/libdrivers__serial.a
[158/203] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/home/claus/dev/ncs/modules/hal/nordic/nrfx/drivers/src/nrfx_clock.c.obj
[159/203] Linking C static library modules/nrf/lib/fprotect/lib..__nrf__lib__fprotect.a
[160/203] Linking C static library modules/nrf/lib/fatal_error/lib..__nrf__lib__fatal_error.a
[161/203] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/home/claus/dev/ncs/modules/hal/nordic/nrfx/drivers/src/nrfx_power.c.obj
[162/203] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/home/claus/dev/ncs/modules/hal/nordic/nrfx/drivers/src/nrfx_gpiote.c.obj
[163/203] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/home/claus/dev/ncs/modules/hal/nordic/nrfx/drivers/src/nrfx_nvmc.c.obj
[164/203] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/home/claus/dev/ncs/modules/hal/nordic/nrfx/drivers/src/nrfx_ppi.c.obj
[165/203] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/home/claus/dev/ncs/modules/hal/nordic/nrfx/drivers/src/nrfx_systick.c.obj
[166/203] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/home/claus/dev/ncs/modules/hal/nordic/nrfx/drivers/src/nrfx_usbd.c.obj
[167/203] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/home/claus/dev/ncs/modules/hal/nordic/nrfx/drivers/src/nrfx_wdt.c.obj
[168/203] Building C object zephyr/kernel/CMakeFiles/kernel.dir/banner.c.obj
[169/203] Linking C static library modules/mcuboot/boot/bootutil/zephyr/libmcuboot_util.a
[170/203] Building C object zephyr/kernel/CMakeFiles/kernel.dir/device.c.obj
[171/203] Building C object zephyr/kernel/CMakeFiles/kernel.dir/errno.c.obj
[172/203] Building C object zephyr/kernel/CMakeFiles/kernel.dir/fatal.c.obj
[173/203] Building C object zephyr/kernel/CMakeFiles/kernel.dir/init.c.obj
[174/203] Building C object zephyr/kernel/CMakeFiles/kernel.dir/kheap.c.obj
[175/203] Building C object zephyr/kernel/CMakeFiles/kernel.dir/mem_slab.c.obj
[176/203] Building C object zephyr/kernel/CMakeFiles/kernel.dir/thread.c.obj
[177/203] Linking C static library modules/hal_nordic/nrfx/libmodules__hal_nordic__nrfx.a
[178/203] Building C object zephyr/kernel/CMakeFiles/kernel.dir/version.c.obj
[179/203] Building C object zephyr/kernel/CMakeFiles/kernel.dir/idle.c.obj
[180/203] Building C object zephyr/kernel/CMakeFiles/kernel.dir/mailbox.c.obj
[181/203] Building C object zephyr/kernel/CMakeFiles/kernel.dir/msg_q.c.obj
[182/203] Building C object zephyr/kernel/CMakeFiles/kernel.dir/pipes.c.obj
[183/203] Building C object zephyr/kernel/CMakeFiles/kernel.dir/sem.c.obj
[184/203] Building C object zephyr/kernel/CMakeFiles/kernel.dir/mutex.c.obj
[185/203] Building C object zephyr/kernel/CMakeFiles/kernel.dir/queue.c.obj
[186/203] Building C object zephyr/kernel/CMakeFiles/kernel.dir/stack.c.obj
[187/203] Building C object zephyr/kernel/CMakeFiles/kernel.dir/system_work_q.c.obj
[188/203] Building C object zephyr/kernel/CMakeFiles/kernel.dir/work.c.obj
[189/203] Building C object zephyr/kernel/CMakeFiles/kernel.dir/sched.c.obj
[190/203] Building C object zephyr/kernel/CMakeFiles/kernel.dir/condvar.c.obj
[191/203] Building C object zephyr/kernel/CMakeFiles/kernel.dir/xip.c.obj
[192/203] Building C object zephyr/kernel/CMakeFiles/kernel.dir/timeout.c.obj
[193/203] Building C object zephyr/kernel/CMakeFiles/kernel.dir/timer.c.obj
[194/203] Building C object zephyr/kernel/CMakeFiles/kernel.dir/mempool.c.obj
[195/203] Linking C static library zephyr/kernel/libkernel.a
[196/203] Linking C executable zephyr/zephyr_prebuilt.elf
FAILED: zephyr/zephyr_prebuilt.elf zephyr/zephyr_prebuilt.map /home/claus/dev/nordic/hello_dongle/build/mcuboot/zephyr/zephyr_prebuilt.map 
: && ccache /home/claus/.local/gcc-arm-none-eabi-9-2019-q4-major/bin/arm-none-eabi-gcc   zephyr/CMakeFiles/zephyr_prebuilt.dir/misc/empty_file.c.obj -o zephyr/zephyr_prebuilt.elf  zephyr/CMakeFiles/offsets.dir/./arch/arm/core/offsets/offsets.c.obj  -fuse-ld=bfd  -Wl,-T  zephyr/linker_zephyr_prebuilt.cmd  -Wl,-Map=/home/claus/dev/nordic/hello_dongle/build/mcuboot/zephyr/zephyr_prebuilt.map  -Wl,--whole-archive  app/libapp.a  zephyr/libzephyr.a  zephyr/arch/common/libarch__common.a  zephyr/arch/arch/arm/core/aarch32/libarch__arm__core__aarch32.a  zephyr/arch/arch/arm/core/aarch32/cortex_m/libarch__arm__core__aarch32__cortex_m.a  zephyr/arch/arch/arm/core/aarch32/mpu/libarch__arm__core__aarch32__mpu.a  zephyr/lib/libc/minimal/liblib__libc__minimal.a  zephyr/lib/posix/liblib__posix.a  zephyr/soc/arm/common/cortex_m/libsoc__arm__common__cortex_m.a  zephyr/soc/arm/nordic_nrf/nrf52/libsoc__arm__nordic_nrf__nrf52.a  zephyr/boards/boards/arm/nrf52840dongle_nrf52840/libboards__arm__nrf52840dongle_nrf52840.a  zephyr/drivers/gpio/libdrivers__gpio.a  zephyr/drivers/flash/libdrivers__flash.a  zephyr/drivers/serial/libdrivers__serial.a  modules/nrf/lib/fprotect/lib..__nrf__lib__fprotect.a  modules/nrf/lib/fatal_error/lib..__nrf__lib__fatal_error.a  modules/nrf/drivers/hw_cc310/lib..__nrf__drivers__hw_cc310.a  modules/mcuboot/boot/bootutil/zephyr/libmcuboot_util.a  modules/hal_nordic/nrfx/libmodules__hal_nordic__nrfx.a  -Wl,--no-whole-archive  zephyr/kernel/libkernel.a  -L"/home/claus/.local/gcc-arm-none-eabi-9-2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/thumb/v7e-m+fp/hard"  -L/home/claus/dev/nordic/hello_dongle/build/mcuboot/zephyr  -lgcc  zephyr/arch/common/libisr_tables.a  /home/claus/dev/ncs/nrfxlib/crypto/nrf_cc310_platform/lib/cortex-m4/hard-float/no-interrupts/libnrf_cc310_platform_0.9.11.a  -mcpu=cortex-m4  -mthumb  -mabi=aapcs  -mfpu=fpv4-sp-d16  -Wl,--gc-sections  -Wl,--build-id=none  -Wl,--sort-common=descending  -Wl,--sort-section=alignment  -Wl,-u,_OffsetAbsSyms  -Wl,-u,_ConfigAbsSyms  -nostdlib  -static  -no-pie  -Wl,-X  -Wl,-N  -Wl,--orphan-handling=warn  /home/claus/dev/ncs/nrfxlib/crypto/nrf_cc310_bl/lib/cortex-m4/hard-float/no-interrupts/libnrf_cc310_bl_0.9.12.a && cd /home/claus/dev/nordic/hello_dongle/build/mcuboot/zephyr && /usr/bin/cmake -E echo
/home/claus/.local/gcc-arm-none-eabi-9-2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.bfd: zephyr/zephyr_prebuilt.elf section `text' will not fit in region `FLASH'
/home/claus/.local/gcc-arm-none-eabi-9-2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.bfd: region `FLASH' overflowed by 6060 bytes
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
[159/174] Linking C executable zephyr/zephyr_prebuilt.elf

FAILED: modules/mcuboot/mcuboot_subimage-prefix/src/mcuboot_subimage-stamp/mcuboot_subimage-build mcuboot/zephyr/zephyr.hex mcuboot/zephyr/zephyr.elf /home/claus/dev/nordic/hello_dongle/build/modules/mcuboot/mcuboot_subimage-prefix/src/mcuboot_subimage-stamp/mcuboot_subimage-build /home/claus/dev/nordic/hello_dongle/build/mcuboot/zephyr/zephyr.hex /home/claus/dev/nordic/hello_dongle/build/mcuboot/zephyr/zephyr.elf 
cd /home/claus/dev/nordic/hello_dongle/build/mcuboot && /usr/bin/cmake --build . --
[161/174] Generating linker.cmd
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /usr/bin/cmake --build /home/claus/dev/nordic/hello_dongle/build
The terminal process terminated with exit code: 1.

I must be missing something here, any hints greatly appreciated!

  • I finally found the "boards" directory in mcuboot/boot/zephyr which has a config file for the dongle that activates configs related with DFU over serial. Deactivating these settings I can now compile. But I still don't quite understand why these settings are there, the "standard" way of using the dongle is with the nrf bootloader, and in this case no mcuboot is needed, right? So why providing additonal configs for this board in mcuboot (that don't work out of the box)? 

Related