VS Code+nrf-connect & west flash mostly rebuilds, and “Erase & Flash” rebuilds again – wasting a ton of time on unchanged builds

Environment

  • Board: Thingy91x / nrf9151/ns

  • nRF Connect SDK: v3.1.0

  • Zephyr SDK/Toolchain: 0.17.0

  • west: 1.4.0

  • Host: Windows 11

  • VS Code nRF Connect Extension: 2025.9.732 (win32-x64)

Problem

When I select an application config that was successfully built yesterday (no changes), and then click Action/Flash in VS Code, the extension runs a full rebuild (west flash: rebuilding) before even attempting to flash.

If the flash fails (e.g. because a full erase is required – perfectly understandable), and I immediately retry with Action/Erase & Flash, the toolchain performs yet another full rebuild from scratch — just two minutes after the last one finished, without any source/config change.

That means two complete sysbuilds (MCUboot, b0, TFM, app, signing, merging) back-to-back for exactly the same artifacts. This feels like a massive waste of time, happens a dozen times each day and slows down development cycles dramatically.

Time wasted

Measured via the elapsed: logs:

  • First attempt (Flash): 01:21

  • Second attempt (Erase & Flash, right after): 01:48

Total wasted: 03:09 for something that should need no build at all and only take 10 seconds. Only in rare cases cmake/ninja show "nothing to do" lines instead of full rebuilds.

What can be done to prevent all this from happening?

Log:

* Executing task: nRF Connect: Flash: lwm2m-client/51X-DL-RTT-310 (active)

Flashing 51X-DL-RTT-310 to nRF9151-DK
west flash -d c:\DL\lwm2m-client\bld\51X-DL-RTT-310 --dev-id 1051211295

[10.09.2025 09:08:33.77] START CWD="c:\DL\lwm2m-client" CMD="west flash -d c:\DL\lwm2m-client\bld\51X-DL-RTT-310 --dev-id 1051211295"
-- west flash: rebuilding
[0/31] Performing build step for 'mcuboot'
ninja: no work to do.
[1/31] Performing build step for 'lwm2m-client'
[0/1] Re-running CMake...
Loading Zephyr default modules (Zephyr base (cached)).
-- Application: C:/DL/lwm2m-client
-- CMake version: 3.21.0
-- Cache files will be written to: C:/ncs/v3.1.0/zephyr/.cache
-- Zephyr version: 4.1.99 (C:/ncs/v3.1.0/zephyr)
-- Found west (found suitable version "1.4.0", minimum required is "0.14.0")
-- Board: thingy91x, qualifiers: nrf9151/ns
-- Found host-tools: zephyr 0.17.0 (C:/ncs/toolchains/b8b84efebd/opt/zephyr-sdk)
-- Found toolchain: zephyr 0.17.0 (C:/ncs/toolchains/b8b84efebd/opt/zephyr-sdk)
-- Found BOARD.dts: C:/ncs/v3.1.0/nrf/boards/nordic/thingy91x/thingy91x_nrf9151_ns.dts
-- Found devicetree overlay: C:/DL/lwm2m-client/boards/thingy91x_nrf9151_ns.overlay
-- Generated zephyr.dts: C:/DL/lwm2m-client/bld/51X-DL-RTT-310/lwm2m-client/zephyr/zephyr.dts
-- Generated pickled edt: C:/DL/lwm2m-client/bld/51X-DL-RTT-310/lwm2m-client/zephyr/edt.pickle
-- Generated devicetree_generated.h: C:/DL/lwm2m-client/bld/51X-DL-RTT-310/lwm2m-client/zephyr/include/generated/zephyr/devicetree_generated.h

warning: Deprecated symbol MBEDTLS_LEGACY_CRYPTO_C is enabled.


warning: Experimental symbol GNSS is enabled.

Parsing C:/DL/lwm2m-client/Kconfig
Loaded configuration 'C:/DL/lwm2m-client/bld/51X-DL-RTT-310/lwm2m-client/zephyr/.config'
Merged configuration 'C:/DL/lwm2m-client/bld/51X-DL-RTT-310/lwm2m-client/zephyr/.config.sysbuild'
No change to configuration in 'C:/DL/lwm2m-client/bld/51X-DL-RTT-310/lwm2m-client/zephyr/.config'
No change to Kconfig header in 'C:/DL/lwm2m-client/bld/51X-DL-RTT-310/lwm2m-client/zephyr/include/generated/zephyr/autoconf.h'
=========== Generating psa_crypto_config ===============
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_C: False
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
Backup: CONFIG_MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT: False
Backup: CONFIG_MBEDTLS_THREADING_C: True
Backup: CONFIG_MBEDTLS_THREADING_ALT: False
=========== Checkpoint: backup ===============
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_C: False
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
Restore: CONFIG_MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT: False
Restore: CONFIG_MBEDTLS_THREADING_C: True
Restore: CONFIG_MBEDTLS_THREADING_ALT: False
=========== End psa_crypto_config ===============
=========== Generating psa_crypto_library_config ===============
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_C: False
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
Backup: CONFIG_MBEDTLS_USE_PSA_CRYPTO: False
Backup: CONFIG_MBEDTLS_PLATFORM_PRINTF_ALT: False
Backup: CONFIG_MBEDTLS_THREADING_C: True
Backup: CONFIG_MBEDTLS_THREADING_ALT: False
=========== Checkpoint: backup ===============
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_C: False
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
Restore: CONFIG_MBEDTLS_USE_PSA_CRYPTO: False
Restore: CONFIG_MBEDTLS_PLATFORM_PRINTF_ALT: False
Restore: CONFIG_MBEDTLS_THREADING_C: True
Restore: CONFIG_MBEDTLS_THREADING_ALT: False
=========== End psa_crypto_library_config ===============
-- Found gen_kobject_list: C:/ncs/v3.1.0/zephyr/scripts/build/gen_kobject_list.py
-- Including signing script: C:/ncs/v3.1.0/nrf/cmake/sysbuild/image_signing.cmake
CMake Warning at C:/ncs/v3.1.0/zephyr/CMakeLists.txt:2232 (message):
__ASSERT() statements are globally ENABLED


-- Configuring done
-- Generating done
-- Build files have been written to: C:/DL/lwm2m-client/bld/51X-DL-RTT-310/lwm2m-client
[0/544] Performing build step for 'tfm'
[51/55] Linking C executable bin\tfm_s.axf
Memory region Used Size Region Size %age Used
FLASH: 31580 B 32256 B 97.90%
RAM: 11108 B 40 KB 27.12%
[55/55] Generating ../bin/tfm_s.hex
[538/538] Linking C executable zephyr\zephyr.elf
Memory region Used Size Region Size %age Used
FLASH: 386004 B 800 KB 47.12%
RAM: 202656 B 203416 B 99.63%
IDT_LIST: 0 GB 32 KB 0.00%
Generating files from C:/DL/lwm2m-client/bld/51X-DL-RTT-310/lwm2m-client/zephyr/zephyr.elf for board: thingy91x
image.py: sign the payload
image.py: sign the payload
[5/25] Performing build step for 'b0'
ninja: no work to do.
[9/25] Performing build step for 's1_image'
ninja: no work to do.
[18/18] Generating ../merged.hex
-- west flash: using runner nrfutil
-- runners.nrfutil: reset after flashing requested
-- runners.nrfutil: Flashing file: C:\DL\lwm2m-client\bld\51X-DL-RTT-310\merged.hex
-- runners.nrfutil: Erasing address ranges touched by firmware
Error: One or more batch tasks failed:
* 1051211295: The firmware to program contains UICR data, but your device already has data there. These memory regions are not erasable with the erase option you selected. You need to run an ERASE_AL
L to erase the UICR (Generic)

FATAL ERROR: command exited with status 1: nrfutil --json device x-execute-batch --batch-path 'C:\DL\lwm2m-client\bld\51X-DL-RTT-310\generated_nrfutil_batch.json' --serial-number 1051211295
[10.09.2025 09:09:54.08] elapsed: 01:21

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

* Executing task: nRF Connect: Flash: lwm2m-client/51X-DL-RTT-310 (active)

Flashing 51X-DL-RTT-310 to nRF9151-DK
west flash -d c:\DL\lwm2m-client\bld\51X-DL-RTT-310 --dev-id 1051211295 --erase

[10.09.2025 09:10:02.86] START CWD="c:\DL\lwm2m-client" CMD="west flash -d c:\DL\lwm2m-client\bld\51X-DL-RTT-310 --dev-id 1051211295 --erase"
-- west flash: rebuilding
[0/1] Re-running CMake...
Loading Zephyr module(s) (Zephyr base (cached)): sysbuild_default
-- Cache files will be written to: C:/ncs/v3.1.0/zephyr/.cache
-- Found west (found suitable version "1.4.0", minimum required is "0.14.0")
-- Board: thingy91x, qualifiers: nrf9151/ns
Parsing C:/ncs/v3.1.0/zephyr/share/sysbuild/Kconfig
Loaded configuration 'C:/DL/lwm2m-client/bld/51X-DL-RTT-310/zephyr/.config'
No change to configuration in 'C:/DL/lwm2m-client/bld/51X-DL-RTT-310/zephyr/.config'
No change to Kconfig header in 'C:/DL/lwm2m-client/bld/51X-DL-RTT-310/_sysbuild/autoconf.h'
--
*****************************
* Running CMake for mcuboot *
*****************************

Loading Zephyr default modules (Zephyr base (cached)).
-- Application: C:/ncs/v3.1.0/bootloader/mcuboot/boot/zephyr
-- CMake version: 3.21.0
-- Cache files will be written to: C:/ncs/v3.1.0/zephyr/.cache
-- Zephyr version: 4.1.99 (C:/ncs/v3.1.0/zephyr)
-- Found west (found suitable version "1.4.0", minimum required is "0.14.0")
-- Board: thingy91x, qualifiers: nrf9151
-- Found host-tools: zephyr 0.17.0 (C:/ncs/toolchains/b8b84efebd/opt/zephyr-sdk)
-- Found toolchain: zephyr 0.17.0 (C:/ncs/toolchains/b8b84efebd/opt/zephyr-sdk)
-- Found BOARD.dts: C:/ncs/v3.1.0/nrf/boards/nordic/thingy91x/thingy91x_nrf9151.dts
-- Found devicetree overlay: C:/ncs/v3.1.0/bootloader/mcuboot/boot/zephyr/boards/thingy91x_nrf9151.overlay
-- Generated zephyr.dts: C:/DL/lwm2m-client/bld/51X-DL-RTT-310/mcuboot/zephyr/zephyr.dts
-- Generated pickled edt: C:/DL/lwm2m-client/bld/51X-DL-RTT-310/mcuboot/zephyr/edt.pickle
-- Generated devicetree_generated.h: C:/DL/lwm2m-client/bld/51X-DL-RTT-310/mcuboot/zephyr/include/generated/zephyr/devicetree_generated.h

C:/DL/lwm2m-client/bld/51X-DL-RTT-310/mcuboot/zephyr/.config.sysbuild:11: warning: BOOT_SWAP_USING_MOVE (defined at C:/ncs/v3.1.0/bootloader/mcuboot/boot/zephyr/Kconfig:575) set more than once. Old va
lue "y", new value "n".

C:/DL/lwm2m-client/bld/51X-DL-RTT-310/mcuboot/zephyr/.config.sysbuild:35: warning: BOOT_SWAP_USING_MOVE (defined at C:/ncs/v3.1.0/bootloader/mcuboot/boot/zephyr/Kconfig:575) set more than once. Old va
lue "n", new value "y".
Parsing C:/ncs/v3.1.0/bootloader/mcuboot/boot/zephyr/Kconfig
Loaded configuration 'C:/DL/lwm2m-client/bld/51X-DL-RTT-310/mcuboot/zephyr/.config'
Merged configuration 'C:/DL/lwm2m-client/bld/51X-DL-RTT-310/mcuboot/zephyr/.config.sysbuild'
No change to configuration in 'C:/DL/lwm2m-client/bld/51X-DL-RTT-310/mcuboot/zephyr/.config'
No change to Kconfig header in 'C:/DL/lwm2m-client/bld/51X-DL-RTT-310/mcuboot/zephyr/include/generated/zephyr/autoconf.h'
-- Found gen_kobject_list: C:/ncs/v3.1.0/zephyr/scripts/build/gen_kobject_list.py
MCUBoot bootloader key file: C:/ncs/v3.1.0/bootloader/mcuboot/root-ec-p256.pem
CMake Warning at CMakeLists.txt:412 (message):
WARNING: Using default MCUboot signing key file, this file is for debug use
only and is not secure!


-- Configuring done
-- Generating done
-- Build files have been written to: C:/DL/lwm2m-client/bld/51X-DL-RTT-310/mcuboot
--
************************
* Running CMake for b0 *
************************

Loading Zephyr default modules (Zephyr base (cached)).
-- Application: C:/ncs/v3.1.0/nrf/samples/bootloader
-- CMake version: 3.21.0
-- Cache files will be written to: C:/ncs/v3.1.0/zephyr/.cache
-- Zephyr version: 4.1.99 (C:/ncs/v3.1.0/zephyr)
-- Found west (found suitable version "1.4.0", minimum required is "0.14.0")
-- Board: thingy91x, qualifiers: nrf9151
-- Found host-tools: zephyr 0.17.0 (C:/ncs/toolchains/b8b84efebd/opt/zephyr-sdk)
-- Found toolchain: zephyr 0.17.0 (C:/ncs/toolchains/b8b84efebd/opt/zephyr-sdk)
-- Found BOARD.dts: C:/ncs/v3.1.0/nrf/boards/nordic/thingy91x/thingy91x_nrf9151.dts
-- Generated zephyr.dts: C:/DL/lwm2m-client/bld/51X-DL-RTT-310/b0/zephyr/zephyr.dts
-- Generated pickled edt: C:/DL/lwm2m-client/bld/51X-DL-RTT-310/b0/zephyr/edt.pickle
-- Generated devicetree_generated.h: C:/DL/lwm2m-client/bld/51X-DL-RTT-310/b0/zephyr/include/generated/zephyr/devicetree_generated.h
Parsing C:/ncs/v3.1.0/zephyr/Kconfig
Loaded configuration 'C:/DL/lwm2m-client/bld/51X-DL-RTT-310/b0/zephyr/.config'
Merged configuration 'C:/DL/lwm2m-client/bld/51X-DL-RTT-310/b0/zephyr/.config.sysbuild'
No change to configuration in 'C:/DL/lwm2m-client/bld/51X-DL-RTT-310/b0/zephyr/.config'
No change to Kconfig header in 'C:/DL/lwm2m-client/bld/51X-DL-RTT-310/b0/zephyr/include/generated/zephyr/autoconf.h'
-- Found gen_kobject_list: C:/ncs/v3.1.0/zephyr/scripts/build/gen_kobject_list.py
-- Configuring done
-- Generating done
-- Build files have been written to: C:/DL/lwm2m-client/bld/51X-DL-RTT-310/b0
--
**********************************
* Running CMake for lwm2m-client *
**********************************

Loading Zephyr default modules (Zephyr base (cached)).
-- Application: C:/DL/lwm2m-client
-- CMake version: 3.21.0
-- Cache files will be written to: C:/ncs/v3.1.0/zephyr/.cache
-- Zephyr version: 4.1.99 (C:/ncs/v3.1.0/zephyr)
-- Found west (found suitable version "1.4.0", minimum required is "0.14.0")
-- Board: thingy91x, qualifiers: nrf9151/ns
-- Found host-tools: zephyr 0.17.0 (C:/ncs/toolchains/b8b84efebd/opt/zephyr-sdk)
-- Found toolchain: zephyr 0.17.0 (C:/ncs/toolchains/b8b84efebd/opt/zephyr-sdk)
-- Found BOARD.dts: C:/ncs/v3.1.0/nrf/boards/nordic/thingy91x/thingy91x_nrf9151_ns.dts
-- Found devicetree overlay: C:/DL/lwm2m-client/boards/thingy91x_nrf9151_ns.overlay
-- Generated zephyr.dts: C:/DL/lwm2m-client/bld/51X-DL-RTT-310/lwm2m-client/zephyr/zephyr.dts
-- Generated pickled edt: C:/DL/lwm2m-client/bld/51X-DL-RTT-310/lwm2m-client/zephyr/edt.pickle
-- Generated devicetree_generated.h: C:/DL/lwm2m-client/bld/51X-DL-RTT-310/lwm2m-client/zephyr/include/generated/zephyr/devicetree_generated.h

warning: Deprecated symbol MBEDTLS_LEGACY_CRYPTO_C is enabled.


warning: Experimental symbol GNSS is enabled.

Parsing C:/DL/lwm2m-client/Kconfig
Loaded configuration 'C:/DL/lwm2m-client/bld/51X-DL-RTT-310/lwm2m-client/zephyr/.config'
Merged configuration 'C:/DL/lwm2m-client/bld/51X-DL-RTT-310/lwm2m-client/zephyr/.config.sysbuild'
No change to configuration in 'C:/DL/lwm2m-client/bld/51X-DL-RTT-310/lwm2m-client/zephyr/.config'
No change to Kconfig header in 'C:/DL/lwm2m-client/bld/51X-DL-RTT-310/lwm2m-client/zephyr/include/generated/zephyr/autoconf.h'
=========== Generating psa_crypto_config ===============
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_C: False
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
Backup: CONFIG_MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT: False
Backup: CONFIG_MBEDTLS_THREADING_C: True
Backup: CONFIG_MBEDTLS_THREADING_ALT: False
=========== Checkpoint: backup ===============
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_C: False
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
Restore: CONFIG_MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT: False
Restore: CONFIG_MBEDTLS_THREADING_C: True
Restore: CONFIG_MBEDTLS_THREADING_ALT: False
=========== End psa_crypto_config ===============
=========== Generating psa_crypto_library_config ===============
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_C: False
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
Backup: CONFIG_MBEDTLS_USE_PSA_CRYPTO: False
Backup: CONFIG_MBEDTLS_PLATFORM_PRINTF_ALT: False
Backup: CONFIG_MBEDTLS_THREADING_C: True
Backup: CONFIG_MBEDTLS_THREADING_ALT: False
=========== Checkpoint: backup ===============
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_C: False
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
Restore: CONFIG_MBEDTLS_USE_PSA_CRYPTO: False
Restore: CONFIG_MBEDTLS_PLATFORM_PRINTF_ALT: False
Restore: CONFIG_MBEDTLS_THREADING_C: True
Restore: CONFIG_MBEDTLS_THREADING_ALT: False
=========== End psa_crypto_library_config ===============
-- Found gen_kobject_list: C:/ncs/v3.1.0/zephyr/scripts/build/gen_kobject_list.py
-- Including signing script: C:/ncs/v3.1.0/nrf/cmake/sysbuild/image_signing.cmake
CMake Warning at C:/ncs/v3.1.0/zephyr/CMakeLists.txt:2232 (message):
__ASSERT() statements are globally ENABLED


-- Configuring done
-- Generating done
-- Build files have been written to: C:/DL/lwm2m-client/bld/51X-DL-RTT-310/lwm2m-client
--
******************************
* Running CMake for s1_image *
******************************

Loading Zephyr default modules (Zephyr base (cached)).
-- Application: C:/ncs/v3.1.0/bootloader/mcuboot/boot/zephyr
-- CMake version: 3.21.0
-- Cache files will be written to: C:/ncs/v3.1.0/zephyr/.cache
-- Zephyr version: 4.1.99 (C:/ncs/v3.1.0/zephyr)
-- Found west (found suitable version "1.4.0", minimum required is "0.14.0")
-- Board: thingy91x, qualifiers: nrf9151
-- Found host-tools: zephyr 0.17.0 (C:/ncs/toolchains/b8b84efebd/opt/zephyr-sdk)
-- Found toolchain: zephyr 0.17.0 (C:/ncs/toolchains/b8b84efebd/opt/zephyr-sdk)
-- Found BOARD.dts: C:/ncs/v3.1.0/nrf/boards/nordic/thingy91x/thingy91x_nrf9151.dts
-- Found devicetree overlay: C:/ncs/v3.1.0/bootloader/mcuboot/boot/zephyr/boards/thingy91x_nrf9151.overlay
-- Generated zephyr.dts: C:/DL/lwm2m-client/bld/51X-DL-RTT-310/s1_image/zephyr/zephyr.dts
-- Generated pickled edt: C:/DL/lwm2m-client/bld/51X-DL-RTT-310/s1_image/zephyr/edt.pickle
-- Generated devicetree_generated.h: C:/DL/lwm2m-client/bld/51X-DL-RTT-310/s1_image/zephyr/include/generated/zephyr/devicetree_generated.h
-- Found gen_kobject_list: C:/ncs/v3.1.0/zephyr/scripts/build/gen_kobject_list.py
MCUBoot bootloader key file: C:/ncs/v3.1.0/bootloader/mcuboot/root-ec-p256.pem
CMake Warning at CMakeLists.txt:412 (message):
WARNING: Using default MCUboot signing key file, this file is for debug use
only and is not secure!


-- Configuring done
-- Generating done
-- Build files have been written to: C:/DL/lwm2m-client/bld/51X-DL-RTT-310/s1_image
-- Found partition manager static configuration : C:/ncs/v3.1.0/nrf/boards/nordic/thingy91x/thingy91x_nrf9151_pm_static.yml
Partition 'b0' is not included in the dynamic resolving since it is statically defined.
Partition 'b0_container' is not included in the dynamic resolving since it is statically defined.
Partition 's0' is not included in the dynamic resolving since it is statically defined.
Partition 's0_pad' is not included in the dynamic resolving since it is statically defined.
Partition 's0_image' is not included in the dynamic resolving since it is statically defined.
Partition 'mcuboot' is not included in the dynamic resolving since it is statically defined.
Partition 's1' is not included in the dynamic resolving since it is statically defined.
Partition 's1_pad' is not included in the dynamic resolving since it is statically defined.
Partition 's1_image' is not included in the dynamic resolving since it is statically defined.
Partition 'mcuboot_primary' is not included in the dynamic resolving since it is statically defined.
Partition 'tfm_secure' is not included in the dynamic resolving since it is statically defined.
Partition 'mcuboot_pad' is not included in the dynamic resolving since it is statically defined.
Partition 'mcuboot_primary_app' is not included in the dynamic resolving since it is statically defined.
Partition 'app_image' is not included in the dynamic resolving since it is statically defined.
Partition 'tfm' is not included in the dynamic resolving since it is statically defined.
Partition 'tfm_nonsecure' is not included in the dynamic resolving since it is statically defined.
Partition 'mcuboot_secondary' is not included in the dynamic resolving since it is statically defined.
Partition 'fmfu_storage' is not included in the dynamic resolving since it is statically defined.
Partition 'settings_storage' is not included in the dynamic resolving since it is statically defined.
Dropping partition 'nrf_modem_lib_trace' since its size is 0.
Dropping partition 'nonsecure_storage' since it is empty.
-- Configuring done
-- Generating done
-- Build files have been written to: C:/DL/lwm2m-client/bld/51X-DL-RTT-310
[0/31] Performing build step for 'mcuboot'
[34/34] Linking C executable zephyr\zephyr.elf
Memory region Used Size Region Size %age Used
FLASH: 42596 B 81408 B 52.32%
RAM: 34808 B 40 KB 84.98%
IDT_LIST: 0 GB 32 KB 0.00%
Generating files from C:/DL/lwm2m-client/bld/51X-DL-RTT-310/mcuboot/zephyr/zephyr.elf for board: thingy91x
[1/31] Performing build step for 'lwm2m-client'
[0/458] Performing build step for 'tfm'
[74/78] Linking C executable bin\tfm_s.axf
Memory region Used Size Region Size %age Used
FLASH: 31580 B 32256 B 97.90%
RAM: 11108 B 40 KB 27.12%
[78/78] Linking C static library secure_fw\libtfm_s_veneers.a
[47/47] Linking C executable zephyr\zephyr.elf
Memory region Used Size Region Size %age Used
FLASH: 386004 B 800 KB 47.12%
RAM: 202656 B 203416 B 99.63%
IDT_LIST: 0 GB 32 KB 0.00%
Generating files from C:/DL/lwm2m-client/bld/51X-DL-RTT-310/lwm2m-client/zephyr/zephyr.elf for board: thingy91x
image.py: sign the payload
image.py: sign the payload
[5/31] Creating signature of application
[9/31] Performing build step for 's1_image'
[201/201] Linking C executable zephyr\zephyr.elf
Memory region Used Size Region Size %age Used
FLASH: 42596 B 81408 B 52.32%
RAM: 34808 B 203416 B 17.11%
IDT_LIST: 0 GB 32 KB 0.00%
Generating files from C:/DL/lwm2m-client/bld/51X-DL-RTT-310/s1_image/zephyr/zephyr.elf for board: thingy91x
[11/31] Creating validation for zephyr.hex, storing to signed_by_b0_mcuboot.hex
[15/31] Creating signature of application
[16/31] Generating ../signed_by_mcuboot_and_b0_mcuboot.bin
image.py: sign the payload
[17/31] Performing build step for 'b0'
[26/26] Linking C executable zephyr\zephyr.elf
Memory region Used Size Region Size %age Used
FLASH: 27448 B 32 KB 83.76%
RAM: 37288 B 203416 B 18.33%
IDT_LIST: 0 GB 32 KB 0.00%
Generating files from C:/DL/lwm2m-client/bld/51X-DL-RTT-310/b0/zephyr/zephyr.elf for board: thingy91x
[18/31] Generating ../signed_by_mcuboot_and_b0_mcuboot.hex
image.py: sign the payload
[21/31] Creating validation for zephyr.hex, storing to signed_by_b0_s1_image.hex
[27/31] Generating ../signed_by_mcuboot_and_b0_s1_image.bin
image.py: sign the payload
[28/31] Generating ../signed_by_mcuboot_and_b0_s1_image.hex
image.py: sign the payload
[31/31] Generating ../merged.hex
-- west flash: using runner nrfutil
-- runners.nrfutil: mass erase requested
-- runners.nrfutil: reset after flashing requested
-- runners.nrfutil: Flashing file: C:\DL\lwm2m-client\bld\51X-DL-RTT-310\merged.hex
-- runners.nrfutil: Erasing non-volatile memory (ERASEALL)
-- runners.nrfutil: Programming image
-- runners.nrfutil: Verifying image
-- runners.nrfutil: Reset
-- runners.nrfutil: Board(s) with serial number(s) 1051211295 flashed successfully.
[10.09.2025 09:11:50.83] elapsed: 01:48
* Terminal will be reused by tasks, press any key to close it.

Parents
  • Follow-up observation

    It seems this behavior is also triggered whenever I change the selected application config in the nRF Connect for VS Code “Applications” panel.

    Even worse: pretty the extension appears to randomly lose focus or re-select another config without me explicitly switching configs. When I click back to my original config and then hit Flash, the extension treats it as if it’s a new build context — which forces the full sysbuild pipeline to run again.

    So in practice, I don’t even need to manually switch configs: just the extension losing focus is enough to cause another complete rebuild before flash. That makes the redundant rebuilds even more frequent and disruptive.

  • Thank you for the report. This behavior is unfortunate especially with the long build times for this target. I’ve tried to reproduce it here with varying success and have shared it with the developers for their feedback. I’ll will update this ticket once I know more.

  • I have not manage to find a way to consistently reproduce the behavior you describe. I tried to replicate your setup by using the same build target and the lwm sample project. Have you tried to see if you also experience this delay if you call "west flash or west flash --erase" directly from the terminal instead?

  • in the meantime I try to switch to a WSl2 based nrf Connect - which seemed a good idea as long as I only had build configs - blazingly fast compared to windows native. And this morning I've observed the same effect in WSL nrf: a full build and again a full build when I tried to flash righ after.

    That said - build times are the pro of WSL2 based setup. Con: I could not yet find a reliably working debug setup. (not via USB Bridge, not using Linux for building and windows for debugging, not gdb server on Windows etc.pp.) - so windows only is still my main setup.
    Sorry mentioning this here again - just to let the world know again - I never had to deal with such a sh* setup from a professional vendor in my whole 30 years of development... Literally I just want to hammer a nail into the wall but all hammers and nails constantly break...

  • So I switched my setup to VSCode on Windows + source tree in WSL2.

    • Editor/Extensions: VSCode runs natively on Windows, sources and all extensions are inside Linux (WSL2).

    • Builds: 2 seconds on changed files, full rebuilds are now 10–20 seconds instead of ~120 seconds on Windows native.

    • Flashing/Debugging: Using J-Link through the WSL2 USB bridge was unstable. When I started a debug session, it flashed once, then the J-Link re-enumerated with a different VID/PID and the debugger lost the device.

    Solution:
    I now use my own build_and_flash.sh script:

    • Builds run completely inside Linux (fast).

    • switching between multiple VSCode configs takes a second
    • Flashing and debugging automagically use the Segger Windows-native tools (JLink GDB Server, RTT Viewer, etc.).

    This hybrid setup sounds a bit complicated, but in practice it’s 10× faster than the Windows-only setup and 10× more reliable than the full WSL2 + USB bridge approach.

    Let me know if you’d like me to share my detailed setup.

  • Hi, I’m running into a very similar issue — with a medium-large NCS project on Windows, my incremental build times are already over 2 minutes. It would really help if you could share your dev setup in detail.

  • Thank you for this update. It looks like there is some interest in your solution. Other things that may be worth checking are the antivirus configuration and setting up a dev drive (https://learn.microsoft.com/en-us/windows/dev-drive/ ).

    We also need to investigate on our end why cmake is being re-run in some cases when calling west flash after having just built the project.

Reply Children
  • Thanks for pointing me to Dev Drive — that’s completely new to me! I’ll definitely give it a try.

    That said, WSL2 still seems to be way faster, especially with Unix-like build chains that push lots of small files through tons of forked processes.

    This benchmark even found WSL2 to be about 2× faster than Windows 11 on Dev Drive:


    superuser.com/.../1825686



    My go-to AI says:

    Comparison: File Systems / Build Environments

    Workload / Environment Windows NTFS (Standard) Windows Dev Drive (ReFS + Performance Mode) Linux / WSL2 (ext4)
    git clone large repo (100k+ files) Slow (many small file creates, AV hooking, NTFS overhead) ~20–40% faster due to reduced AV/Indexing + more efficient ReFS Often 2–5× faster than Windows NTFS; cheap I/O and fork
    npm install / pip install (10k+ small files) Notoriously slow on Windows (NTFS fragmentation, AV, expensive process creation) ~30% faster, but still slower than Linux 2–10× faster, ext4 + copy-on-write fork
    CMake/Ninja rebuild (C++ project, 1M LOC) Works, but many process spawns + I/O → often 5–20× slower than Linux 10–30% faster, I/O bottlenecks reduced, but process creation remains expensive Baseline: fast, fork/exec + pipes are cheap
    Large Embedded/SDK project (Zephyr, Yocto, west) Very slow: tens of thousands of shell tools, process creation extremely costly Slightly better (faster I/O, less AV overhead), but process creation still the bottleneck 2–20× faster (matches observed real-world results)
    Antivirus/Indexing impact Often massive, every file access scanned Dev Drive can run AV in “Performance Mode” → minimal overhead None (unless you explicitly install AV)
    Stability / Tool support NTFS = universally supported ReFS: newer, some older tools/backups may not support it ext4 = standard, rock-solid

    TL;DR

    • Dev Drive is a real improvement on Windows: typically 10–40% faster for I/O-heavy developer workloads.

    • But it does not solve the architectural issue (expensive process creation, no cheap fork).

    • For POSIX-heavy builds (Zephyr, Yocto, SDKs), Linux/WSL2 remains unbeatable, often 2–20× faster.

Related