Must toolchain version match SDK version?

Hi.

For a while I have had some issues with the toolchain when using the nRF connect SDK in visual studio code on windows 10. I believe it was after installing SDK version 2.8.0 that I saw the problems first, although I'm not entirely sure. When I use certain commands I get errors in toolchain versions other than 2.8.0. For instance, if I try to build and flash an application using SDK version 1.9.1 and toolchain 1.9.1 I get the attached output.

First of all, is there a workaround to get this to work? I'm currently flashing manually with nrfjprog from command line.

Secondly, should I be matching toolchain versions and SDK versions in the first place? What is the intended/recommended way to use SDK and toolchain versions? If I try build my application with SDK version 1.9.1 and toolchain version 2.8.0 the application appears to run as expected, even with some improvements: resulting merged.hex file is smaller and more warnings are caught in the build process.

[9/27] Linking CXX executable zephyr\zephyr_pre0.elf
[10/27] Generating dev_handles.c
FAILED: zephyr/dev_handles.c
cmd.exe /C "cd /D C:\...\build_191\zephyr && C:\ncs\v1.9.1\toolchain\opt\bin\python.exe C:/ncs/v1.9.1/zephyr/scripts/gen_handles.py --output-source dev_handles.c --kernel C:/.../build_191/zephyr/zephyr_pre0.elf --zephyr-base C:/ncs/v1.9.1/zephyr --start-symbol __device_start"
Traceback (most recent call last):
  File "C:/ncs/v1.9.1/zephyr/scripts/gen_handles.py", line 37, in <module>
    from elftools.elf.elffile import ELFFile
  File "C:\ncs\toolchains\2d382dcd92\opt\bin\Lib\site-packages\elftools\elf\elffile.py", line 41, in <module>
    from ..dwarf.dwarfinfo import DWARFInfo, DebugSectionDescriptor, DwarfConfig
  File "C:\ncs\toolchains\2d382dcd92\opt\bin\Lib\site-packages\elftools\dwarf\dwarfinfo.py", line 17, in <module>
    from .structs import DWARFStructs
  File "C:\ncs\toolchains\2d382dcd92\opt\bin\Lib\site-packages\elftools\dwarf\structs.py", line 10, in <module>
    from logging.config import valid_ident
  File "<frozen zipimport>", line 259, in load_module
  File "logging\config.py", line 30, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "logging\handlers.py", line 26, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "socket.py", line 49, in <module>
ImportError: Module use of python312.dll conflicts with this version of Python.
ninja: build stopped: subcommand failed.
FATAL ERROR: re-build

Parents
  • Hello,

    Yes. This is actually a bug. I don't recall the details (but I will dig it up if we can't quickly solve this). Can you please try to install v2.9.0 as well? And if the issue doesn't go away, can you uninstall v2.8.0 (and keep v2.9.0)? Does that change anything?

    Best regards,

    Edvin

  • Hi. Thank you for the suggestions, although it didn't seem to change anything.

    I tried to install 2.9.0, after which 2.8.0 and 2.9.0 worked but not 1.9.1 as before. Then, I tried to reboot my computer and ended up with the same result. Next, I uninstalled 2.8.0. As before, 2.9.0 worked but not 1.9.1. Restarted by computer again and still the same result. I installed and uninstalled the toolchain versions with the commands in VSCode.

    After that, I checked my C:/ncs folder to see that 2.8.0 was still there, and I did not find 2.9.0. So I took the extra step to delete 2.8.0 in my file explorer, uninstall 2.9.0 in VSCode, install 2.9.0 in the toolchain manager and restart my computer. Still the same error as far as I can tell.

    On a separate note, I checked my nRF Connect for VS Code extension version (2025.1.127) and found I did not have the april update (which I believe was released today, after my original question?). I see this issue is addressed in this update since it prompts me that support for 1.x.x toolchains is discontinued. It also states "If you are working with the nRF Connect SDK v1.x, select the nRF Connect SDK Toolchain v2.0.0 for your configuration". So I guess the intended strategy is to install toolchain version 2.0.0 and use that for my applications in 1.x.

    So I tried this in nRF Connect for VS Code v2025.4.106, but flashing with toolchian verison 2.0.0 does not work either. Without comparing the errors line by line, the error in 2.0.0 appears to be the same as in 1.9.1.

  • Hello,

    After the upgrade, (in your current state) can you please send the entire build log? Including the build log that is attached at the very beginning?

    And can you confirm that you are building the v1.9.1 application via VS Code?

    Have you tried using command line? There is a file in the SDK that you can call from any command terminal:

    v1.9.1\toolchain\cmd\env.cmd, which will set up the toolchain in that command terminal. Then you can use "west build -b <board_name> -d <build folder name> <path to application directory>". Does that manage to build? Mostly for debugging purposes. I am trying to understand why it fails.

    Also, do you have nrfutil installed (nb: new version)? If not, can you please install it, and then call these commands:

    nrfutil self-upgrade

    nrfutil upgrade

    nrfutil self-upgrade

    nrfutil upgrade

    nrfutil install device

    And see if that changes anything.

    Best regards,

    Edvin

  • By the way, when you say that you removed the 2.8.0 and 2.9.0. How exactly did you do this? Did you delete the v2.8.0 and v2.9.0 folders? How did you install it in the first place? I guess that a toolchain followed this installation. Did you remove the toolchain as well? (exactly how to do this depends on how you installed the SDK).

    Best regards,

    Edvin

  • Hi. Apologies for the delay, I was out of office for Easter.

    I can confirm that I'm using VS Code for building my application.I have not tried to build from the command line.

    All my SDKs and toolchains except from 2.9.0 have been installed with the toolchain manager from nRF Connect for desktop (I tried to install 2.9.0 through both VSCode and toolchain manager as described in my original post). In my first test, I tried installing 2.9.0 through VSCode. When I removed 2.8.0, I can't recall how I did it, but since most of the files remained in my file system I believe I did it from VSCode. Only after uninstalling 2.8.0 through VSCode, rebooting my computer and attempting to build through VSCode did I remove the 2.8.0 folder from my file system. 2.9.0 was uninstalled through VSCode only. Please see the attached txt, I tried to describe the installation states in each test there.

    I can try to build one of the 1.9.1 samples and send the entire build log, and then test through command line and update nrfutil as soon as I get time to look more into this. I currently have version 7.13.0 of nrfutil installed.

    i=installed
    u=uninstalled
    TM = Toolchain manager
    VSC = Visual Studio Code
    
    ------------------
    1.
    
    1.9.1 (i TM)
    ...
    2.8.0 (i TM)
    
    ------------------
    2.
    
    1.9.1 (i TM)
    ...
    2.8.0 (i TM)
    2.9.0 (i VSC)
    
    ------------------
    3.
    
    1.9.1 (i TM)
    ...
    -2.8.0 (i TM, u VSC)
    2.9.0 (i VSC)
    
    ------------------
    4.
    
    1.9.1 (i TM)
    ...
    -2.8.0 (i TM, u VSC, deleted from file system)
    2.9.0 (i VSC)
    
    ------------------
    5.
    
    1.9.1 (i TM)
    ...
    -2.8.0 (i TM, u VSC, deleted from file system)
    2.9.0 (i VSC, u VSC, i TM)

  • I believe you are still talking about installing and uninstalling the SDKs v2.8.0 and v2.9.0. Did you also remove/uninstall the toolchains? 

  • Hi.

    When uninstalling v2.8.0 and 2.9.0 of I specifically used the following command in VSCode:
    "nRF Connect: Uninstall Toolchain"

    So should be toolchain. Let me know if I should remove SDK as well.

    I also see that I didn't provide the best info in terms of what works and what does not work in my original post, sorry for that. If I try to only build the project it finishes successfully, but if I run "Flash to board" or "Erase and flash to board" it fails during re re-building step.

    So you might be able to reproduce the problem by:

    1. Copy application_update sample from 1.9.1 SDK and common folder in parent directory.
    2. Build for nrf9160dk_nrf9160ns (SDK 1.9.1, Toolchain v2.0.0, nRF Connect for VS Code v2025.4.106)
    3. Complete build successfully.
    4. Edit something some code to trigger a file change.
    5. Run: Erase and flash active image to board.

    ^^This only fails if it has to build and flash in sequence. In my projects, flashing always triggers re-build which is why it is particularly inconvenient. See full attached build log in VSCode below. I have also attached the .vscode-nrf-connect.json for the configuration used. Please let me know if you need anything else.

     *  Executing task: nRF Connect: Generate config nrf9160dk_nrf9160_ns for c:\project\samples\application_update 
    
    Building application_update
    C:\Windows\system32\cmd.exe /d /s /c "west build --build-dir c:/project/samples/application_update/build c:/project/samples/application_update --pristine --board nrf9160dk_nrf9160_ns -- -DNCS_TOOLCHAIN_VERSION=NONE"
    
    -- west build: generating a build system
    Including boilerplate (Zephyr base): C:/ncs/v1.9.1/zephyr/cmake/app/boilerplate.cmake
    -- Application: C:/project/samples/application_update
    -- Zephyr version: 2.7.99 (C:/ncs/v1.9.1/zephyr), build: v2.7.99-ncs1-1
    -- Found Python3: C:/ncs/toolchains/v2.0.0/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter 
    -- Found west (found suitable version "0.13.1", minimum required is "0.7.1")
    -- Board: nrf9160dk_nrf9160_ns, Revision: 0.7.0
    -- Cache files will be written to: C:/ncs/v1.9.1/zephyr/.cache
    -- Found host-tools: zephyr 0.14.1 (C:/ncs/toolchains/v2.0.0/opt/zephyr-sdk)
    -- Found dtc: C:/ncs/toolchains/v2.0.0/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found toolchain: zephyr 0.14.1 (C:/ncs/toolchains/v2.0.0/opt/zephyr-sdk)
    -- Found BOARD.dts: C:/ncs/v1.9.1/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_ns.dts
    -- Generated zephyr.dts: C:/project/samples/application_update/build/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: C:/project/samples/application_update/build/zephyr/include/generated/devicetree_unfixed.h
    -- Generated device_extern.h: C:/project/samples/application_update/build/zephyr/include/generated/device_extern.h
    -- Including generated dts.cmake file: C:/project/samples/application_update/build/zephyr/dts.cmake
    
    warning: Experimental symbol NET_SOCKETS_OFFLOAD is enabled.
    
    Parsing C:/project/samples/application_update/Kconfig
    Loaded configuration 'C:/ncs/v1.9.1/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_ns_defconfig'
    Merged configuration 'C:/project/samples/application_update/prj.conf'
    Configuration saved to 'C:/project/samples/application_update/build/zephyr/.config'
    Kconfig header saved to 'C:/project/samples/application_update/build/zephyr/include/generated/autoconf.h'
    -- The C compiler identification is GNU 10.3.0
    -- The CXX compiler identification is GNU 10.3.0
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/ncs/toolchains/v2.0.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    Changed board to secure nrf9160dk_nrf9160 (NOT NS)
    
    === child image spm -  begin ===
    loading initial cache file C:/project/samples/application_update/build/spm/child_image_preload.cmake
    Including boilerplate (Zephyr base): C:/ncs/v1.9.1/zephyr/cmake/app/boilerplate.cmake
    -- Application: C:/ncs/v1.9.1/nrf/samples/spm
    -- Zephyr version: 2.7.99 (C:/ncs/v1.9.1/zephyr), build: v2.7.99-ncs1-1
    -- Found Python3: C:/ncs/toolchains/v2.0.0/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter 
    -- Found west (found suitable version "0.13.1", minimum required is "0.7.1")
    -- Board: nrf9160dk_nrf9160, Revision: 0.7.0
    -- Cache files will be written to: C:/ncs/v1.9.1/zephyr/.cache
    -- Found host-tools: zephyr 0.14.1 (C:/ncs/toolchains/v2.0.0/opt/zephyr-sdk)
    -- Found dtc: C:/ncs/toolchains/v2.0.0/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found toolchain: zephyr 0.14.1 (C:/ncs/toolchains/v2.0.0/opt/zephyr-sdk)
    -- Found BOARD.dts: C:/ncs/v1.9.1/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160.dts
    -- Found devicetree overlay: C:/ncs/v1.9.1/nrf/samples/spm/nrf9160dk_nrf9160.overlay
    -- Generated zephyr.dts: C:/project/samples/application_update/build/spm/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: C:/project/samples/application_update/build/spm/zephyr/include/generated/devicetree_unfixed.h
    -- Generated device_extern.h: C:/project/samples/application_update/build/spm/zephyr/include/generated/device_extern.h
    -- Including generated dts.cmake file: C:/project/samples/application_update/build/spm/zephyr/dts.cmake
    Parsing C:/ncs/v1.9.1/zephyr/Kconfig
    Loaded configuration 'C:/ncs/v1.9.1/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_defconfig'
    Merged configuration 'C:/ncs/v1.9.1/nrf/samples/spm/prj.conf'
    Merged configuration 'C:/ncs/v1.9.1/nrf/samples/spm/boards/nrf9160dk_nrf9160.conf'
    Merged configuration 'C:/ncs/v1.9.1/nrf/subsys/partition_manager/partition_manager_enabled.conf'
    Merged configuration 'C:/project/samples/application_update/build/spm/zephyr/misc/generated/extra_kconfig_options.conf'
    Configuration saved to 'C:/project/samples/application_update/build/spm/zephyr/.config'
    Kconfig header saved to 'C:/project/samples/application_update/build/spm/zephyr/include/generated/autoconf.h'
    -- The C compiler identification is GNU 10.3.0
    -- The CXX compiler identification is GNU 10.3.0
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/ncs/toolchains/v2.0.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    CMake Warning at C:/ncs/v1.9.1/zephyr/CMakeLists.txt:1687 (message):
      __ASSERT() statements are globally ENABLED
    
    
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/project/samples/application_update/build/spm
    === child image spm -  end ===
    
    Changed board to secure nrf9160dk_nrf9160 (NOT NS)
    
    === child image mcuboot -  begin ===
    Including boilerplate (Zephyr base): C:/ncs/v1.9.1/zephyr/cmake/app/boilerplate.cmake
    loading initial cache file C:/project/samples/application_update/build/mcuboot/child_image_preload.cmake
    -- Application: C:/ncs/v1.9.1/bootloader/mcuboot/boot/zephyr
    -- Zephyr version: 2.7.99 (C:/ncs/v1.9.1/zephyr), build: v2.7.99-ncs1-1
    -- Found Python3: C:/ncs/toolchains/v2.0.0/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter 
    -- Found west (found suitable version "0.13.1", minimum required is "0.7.1")
    -- Board: nrf9160dk_nrf9160, Revision: 0.7.0
    -- Cache files will be written to: C:/ncs/v1.9.1/zephyr/.cache
    -- Found host-tools: zephyr 0.14.1 (C:/ncs/toolchains/v2.0.0/opt/zephyr-sdk)
    -- Found dtc: C:/ncs/toolchains/v2.0.0/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found toolchain: zephyr 0.14.1 (C:/ncs/toolchains/v2.0.0/opt/zephyr-sdk)
    -- Found BOARD.dts: C:/ncs/v1.9.1/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160.dts
    -- Found devicetree overlay: C:/ncs/v1.9.1/bootloader/mcuboot/boot/zephyr/dts.overlay
    -- Generated zephyr.dts: C:/project/samples/application_update/build/mcuboot/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: C:/project/samples/application_update/build/mcuboot/zephyr/include/generated/devicetree_unfixed.h
    -- Generated device_extern.h: C:/project/samples/application_update/build/mcuboot/zephyr/include/generated/device_extern.h
    -- Including generated dts.cmake file: C:/project/samples/application_update/build/mcuboot/zephyr/dts.cmake
    Parsing C:/ncs/v1.9.1/bootloader/mcuboot/boot/zephyr/Kconfig
    Loaded configuration 'C:/ncs/v1.9.1/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_defconfig'
    Merged configuration 'C:/ncs/v1.9.1/bootloader/mcuboot/boot/zephyr/prj.conf'
    Merged configuration 'C:/ncs/v1.9.1/nrf/subsys/partition_manager/partition_manager_enabled.conf'
    Merged configuration 'C:/project/samples/application_update/build/mcuboot/zephyr/misc/generated/extra_kconfig_options.conf'
    Configuration saved to 'C:/project/samples/application_update/build/mcuboot/zephyr/.config'
    Kconfig header saved to 'C:/project/samples/application_update/build/mcuboot/zephyr/include/generated/autoconf.h'
    -- The C compiler identification is GNU 10.3.0
    -- The CXX compiler identification is GNU 10.3.0
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/ncs/toolchains/v2.0.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    MCUBoot bootloader key file: C:/ncs/v1.9.1/bootloader/mcuboot/root-ec-p256.pem
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/project/samples/application_update/build/mcuboot
    === child image mcuboot -  end ===
    
    CMake Warning at C:/ncs/v1.9.1/nrf/modules/mcuboot/CMakeLists.txt:262 (message):
      
    
            ---------------------------------------------------------
            --- WARNING: Using default MCUBoot key, it should not ---
            --- be used for production.                           ---
            ---------------------------------------------------------
            
    
    
    
    CMake Warning at C:/ncs/v1.9.1/zephyr/CMakeLists.txt:764 (message):
      No SOURCES given to Zephyr library: subsys__net__pkt_filter
    
      Excluding target from build.
    
    
    CMake Warning at C:/ncs/v1.9.1/zephyr/CMakeLists.txt:1687 (message):
      __ASSERT() statements are globally ENABLED
    
    
    -- Found partition manager static configuration: C:/project/samples/application_update/pm_static.yml
    Partition 'mcuboot' 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' 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 'mcuboot_secondary' is not included in the dynamic resolving since it is statically defined.
    Partition 'nrf_modem_lib_ctrl' is not included in the dynamic resolving since it is statically defined.
    Partition 'nrf_modem_lib_rx' is not included in the dynamic resolving since it is statically defined.
    Partition 'nrf_modem_lib_sram' is not included in the dynamic resolving since it is statically defined.
    Partition 'nrf_modem_lib_tx' is not included in the dynamic resolving since it is statically defined.
    Partition 'spm' is not included in the dynamic resolving since it is statically defined.
    Partition 'spm_sram' is not included in the dynamic resolving since it is statically defined.
    Partition 'sram_nonsecure' is not included in the dynamic resolving since it is statically defined.
    Partition 'sram_secure' is not included in the dynamic resolving since it is statically defined.
    Dropping partition 'nrf_modem_lib_trace' since its size is 0.
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/project/samples/application_update/build
    -- west build: building application
    [257/267] Linking C executable zephyr\zephyr_pre0.elf
    
    [261/267] Linking C executable zephyr\zephyr_pre1.elf
    
    [267/267] Linking C executable zephyr\zephyr.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:       65024 B        64 KB     99.22%
                SRAM:       12136 B        32 KB     37.04%
            IDT_LIST:          0 GB         2 KB      0.00%
    [173/183] Linking C executable zephyr\zephyr_pre0.elf
    
    [177/183] Linking C executable zephyr\zephyr_pre1.elf
    
    [183/183] Linking C executable zephyr\zephyr.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:       33992 B        48 KB     69.16%
                SRAM:       16416 B     211736 B      7.75%
            IDT_LIST:          0 GB         2 KB      0.00%
    [212/233] Linking C executable zephyr\zephyr_pre0.elf
    
    [216/233] Linking C executable zephyr\zephyr_pre1.elf
    
    [225/233] Linking C executable zephyr\zephyr.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:       96944 B     425472 B     22.79%
                SRAM:       25528 B     211736 B     12.06%
            IDT_LIST:          0 GB         2 KB      0.00%
    [233/233] Generating zephyr/merged.hex
     *  Terminal will be reused by tasks, press any key to close it. 
    
     *  Executing task: nRF Connect: Flash: application_update/build (active) 
    
    Flashing build to motor
    C:\Windows\system32\cmd.exe /d /s /c "west flash -d c:\project\samples\application_update\build --snr 203200665 --erase"
    
    -- west flash: rebuilding
    [0/25] Performing build step for 'spm_subimage'
    ninja: no work to do.
    [1/23] Performing build step for 'mcuboot_subimage'
    ninja: no work to do.
    [2/23] Building C object CMakeFiles/app.dir/src/main.c.obj
    [4/21] Linking C static library app\libapp.a
    [5/21] Linking C executable zephyr\zephyr_pre0.elf
    
    [6/21] Generating dev_handles.c
    FAILED: zephyr/dev_handles.c 
    cmd.exe /C "cd /D C:\project\samples\application_update\build\zephyr && C:\ncs\toolchains\v2.0.0\opt\bin\python.exe C:/ncs/v1.9.1/zephyr/scripts/gen_handles.py --output-source dev_handles.c --kernel C:/project/samples/application_update/build/zephyr/zephyr_pre0.elf --zephyr-base C:/ncs/v1.9.1/zephyr --start-symbol __device_start"
    Traceback (most recent call last):
      File "C:/ncs/v1.9.1/zephyr/scripts/gen_handles.py", line 37, in <module>
        from elftools.elf.elffile import ELFFile
      File "C:\ncs\toolchains\b620d30767\opt\bin\Lib\site-packages\elftools\elf\elffile.py", line 41, in <module>
        from ..dwarf.dwarfinfo import DWARFInfo, DebugSectionDescriptor, DwarfConfig
      File "C:\ncs\toolchains\b620d30767\opt\bin\Lib\site-packages\elftools\dwarf\dwarfinfo.py", line 17, in <module>
        from .structs import DWARFStructs
      File "C:\ncs\toolchains\b620d30767\opt\bin\Lib\site-packages\elftools\dwarf\structs.py", line 10, in <module>
        from logging.config import valid_ident
      File "<frozen zipimport>", line 259, in load_module
      File "logging\config.py", line 30, in <module>
      File "<frozen zipimport>", line 259, in load_module
      File "logging\handlers.py", line 26, in <module>
      File "<frozen zipimport>", line 259, in load_module
      File "socket.py", line 49, in <module>
    ImportError: Module use of python312.dll conflicts with this version of Python.
    ninja: build stopped: subcommand failed.
    FATAL ERROR: re-build in c:\project\samples\application_update\build failed
    
     *  The terminal process terminated with exit code: 1. 
     *  Terminal will be reused by tasks, press any key to close it.
    {
      "toolchainPath": "c:\\ncs\\toolchains\\v2.0.0",
      "sdkPath": "c:\\ncs\\v1.9.1",
      "board": "nrf9160dk_nrf9160_ns",
      "boardDir": "c:/ncs/v1.9.1/zephyr/boards/arm/nrf9160dk_nrf9160",
      "boardDirs": [
        "c:/ncs/v1.9.1/zephyr/boards/arm/nrf9160dk_nrf9160"
      ],
      "optimizations": "none",
      "cmakeArgs": [],
      "confFiles": [],
      "buildDirectory": "build",
      "kconfigFragments": [],
      "snippets": [],
      "dtcOverlays": [],
      "extraDtcOverlays": []
    }

Reply
  • Hi.

    When uninstalling v2.8.0 and 2.9.0 of I specifically used the following command in VSCode:
    "nRF Connect: Uninstall Toolchain"

    So should be toolchain. Let me know if I should remove SDK as well.

    I also see that I didn't provide the best info in terms of what works and what does not work in my original post, sorry for that. If I try to only build the project it finishes successfully, but if I run "Flash to board" or "Erase and flash to board" it fails during re re-building step.

    So you might be able to reproduce the problem by:

    1. Copy application_update sample from 1.9.1 SDK and common folder in parent directory.
    2. Build for nrf9160dk_nrf9160ns (SDK 1.9.1, Toolchain v2.0.0, nRF Connect for VS Code v2025.4.106)
    3. Complete build successfully.
    4. Edit something some code to trigger a file change.
    5. Run: Erase and flash active image to board.

    ^^This only fails if it has to build and flash in sequence. In my projects, flashing always triggers re-build which is why it is particularly inconvenient. See full attached build log in VSCode below. I have also attached the .vscode-nrf-connect.json for the configuration used. Please let me know if you need anything else.

     *  Executing task: nRF Connect: Generate config nrf9160dk_nrf9160_ns for c:\project\samples\application_update 
    
    Building application_update
    C:\Windows\system32\cmd.exe /d /s /c "west build --build-dir c:/project/samples/application_update/build c:/project/samples/application_update --pristine --board nrf9160dk_nrf9160_ns -- -DNCS_TOOLCHAIN_VERSION=NONE"
    
    -- west build: generating a build system
    Including boilerplate (Zephyr base): C:/ncs/v1.9.1/zephyr/cmake/app/boilerplate.cmake
    -- Application: C:/project/samples/application_update
    -- Zephyr version: 2.7.99 (C:/ncs/v1.9.1/zephyr), build: v2.7.99-ncs1-1
    -- Found Python3: C:/ncs/toolchains/v2.0.0/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter 
    -- Found west (found suitable version "0.13.1", minimum required is "0.7.1")
    -- Board: nrf9160dk_nrf9160_ns, Revision: 0.7.0
    -- Cache files will be written to: C:/ncs/v1.9.1/zephyr/.cache
    -- Found host-tools: zephyr 0.14.1 (C:/ncs/toolchains/v2.0.0/opt/zephyr-sdk)
    -- Found dtc: C:/ncs/toolchains/v2.0.0/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found toolchain: zephyr 0.14.1 (C:/ncs/toolchains/v2.0.0/opt/zephyr-sdk)
    -- Found BOARD.dts: C:/ncs/v1.9.1/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_ns.dts
    -- Generated zephyr.dts: C:/project/samples/application_update/build/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: C:/project/samples/application_update/build/zephyr/include/generated/devicetree_unfixed.h
    -- Generated device_extern.h: C:/project/samples/application_update/build/zephyr/include/generated/device_extern.h
    -- Including generated dts.cmake file: C:/project/samples/application_update/build/zephyr/dts.cmake
    
    warning: Experimental symbol NET_SOCKETS_OFFLOAD is enabled.
    
    Parsing C:/project/samples/application_update/Kconfig
    Loaded configuration 'C:/ncs/v1.9.1/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_ns_defconfig'
    Merged configuration 'C:/project/samples/application_update/prj.conf'
    Configuration saved to 'C:/project/samples/application_update/build/zephyr/.config'
    Kconfig header saved to 'C:/project/samples/application_update/build/zephyr/include/generated/autoconf.h'
    -- The C compiler identification is GNU 10.3.0
    -- The CXX compiler identification is GNU 10.3.0
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/ncs/toolchains/v2.0.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    Changed board to secure nrf9160dk_nrf9160 (NOT NS)
    
    === child image spm -  begin ===
    loading initial cache file C:/project/samples/application_update/build/spm/child_image_preload.cmake
    Including boilerplate (Zephyr base): C:/ncs/v1.9.1/zephyr/cmake/app/boilerplate.cmake
    -- Application: C:/ncs/v1.9.1/nrf/samples/spm
    -- Zephyr version: 2.7.99 (C:/ncs/v1.9.1/zephyr), build: v2.7.99-ncs1-1
    -- Found Python3: C:/ncs/toolchains/v2.0.0/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter 
    -- Found west (found suitable version "0.13.1", minimum required is "0.7.1")
    -- Board: nrf9160dk_nrf9160, Revision: 0.7.0
    -- Cache files will be written to: C:/ncs/v1.9.1/zephyr/.cache
    -- Found host-tools: zephyr 0.14.1 (C:/ncs/toolchains/v2.0.0/opt/zephyr-sdk)
    -- Found dtc: C:/ncs/toolchains/v2.0.0/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found toolchain: zephyr 0.14.1 (C:/ncs/toolchains/v2.0.0/opt/zephyr-sdk)
    -- Found BOARD.dts: C:/ncs/v1.9.1/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160.dts
    -- Found devicetree overlay: C:/ncs/v1.9.1/nrf/samples/spm/nrf9160dk_nrf9160.overlay
    -- Generated zephyr.dts: C:/project/samples/application_update/build/spm/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: C:/project/samples/application_update/build/spm/zephyr/include/generated/devicetree_unfixed.h
    -- Generated device_extern.h: C:/project/samples/application_update/build/spm/zephyr/include/generated/device_extern.h
    -- Including generated dts.cmake file: C:/project/samples/application_update/build/spm/zephyr/dts.cmake
    Parsing C:/ncs/v1.9.1/zephyr/Kconfig
    Loaded configuration 'C:/ncs/v1.9.1/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_defconfig'
    Merged configuration 'C:/ncs/v1.9.1/nrf/samples/spm/prj.conf'
    Merged configuration 'C:/ncs/v1.9.1/nrf/samples/spm/boards/nrf9160dk_nrf9160.conf'
    Merged configuration 'C:/ncs/v1.9.1/nrf/subsys/partition_manager/partition_manager_enabled.conf'
    Merged configuration 'C:/project/samples/application_update/build/spm/zephyr/misc/generated/extra_kconfig_options.conf'
    Configuration saved to 'C:/project/samples/application_update/build/spm/zephyr/.config'
    Kconfig header saved to 'C:/project/samples/application_update/build/spm/zephyr/include/generated/autoconf.h'
    -- The C compiler identification is GNU 10.3.0
    -- The CXX compiler identification is GNU 10.3.0
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/ncs/toolchains/v2.0.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    CMake Warning at C:/ncs/v1.9.1/zephyr/CMakeLists.txt:1687 (message):
      __ASSERT() statements are globally ENABLED
    
    
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/project/samples/application_update/build/spm
    === child image spm -  end ===
    
    Changed board to secure nrf9160dk_nrf9160 (NOT NS)
    
    === child image mcuboot -  begin ===
    Including boilerplate (Zephyr base): C:/ncs/v1.9.1/zephyr/cmake/app/boilerplate.cmake
    loading initial cache file C:/project/samples/application_update/build/mcuboot/child_image_preload.cmake
    -- Application: C:/ncs/v1.9.1/bootloader/mcuboot/boot/zephyr
    -- Zephyr version: 2.7.99 (C:/ncs/v1.9.1/zephyr), build: v2.7.99-ncs1-1
    -- Found Python3: C:/ncs/toolchains/v2.0.0/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter 
    -- Found west (found suitable version "0.13.1", minimum required is "0.7.1")
    -- Board: nrf9160dk_nrf9160, Revision: 0.7.0
    -- Cache files will be written to: C:/ncs/v1.9.1/zephyr/.cache
    -- Found host-tools: zephyr 0.14.1 (C:/ncs/toolchains/v2.0.0/opt/zephyr-sdk)
    -- Found dtc: C:/ncs/toolchains/v2.0.0/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found toolchain: zephyr 0.14.1 (C:/ncs/toolchains/v2.0.0/opt/zephyr-sdk)
    -- Found BOARD.dts: C:/ncs/v1.9.1/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160.dts
    -- Found devicetree overlay: C:/ncs/v1.9.1/bootloader/mcuboot/boot/zephyr/dts.overlay
    -- Generated zephyr.dts: C:/project/samples/application_update/build/mcuboot/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: C:/project/samples/application_update/build/mcuboot/zephyr/include/generated/devicetree_unfixed.h
    -- Generated device_extern.h: C:/project/samples/application_update/build/mcuboot/zephyr/include/generated/device_extern.h
    -- Including generated dts.cmake file: C:/project/samples/application_update/build/mcuboot/zephyr/dts.cmake
    Parsing C:/ncs/v1.9.1/bootloader/mcuboot/boot/zephyr/Kconfig
    Loaded configuration 'C:/ncs/v1.9.1/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_defconfig'
    Merged configuration 'C:/ncs/v1.9.1/bootloader/mcuboot/boot/zephyr/prj.conf'
    Merged configuration 'C:/ncs/v1.9.1/nrf/subsys/partition_manager/partition_manager_enabled.conf'
    Merged configuration 'C:/project/samples/application_update/build/mcuboot/zephyr/misc/generated/extra_kconfig_options.conf'
    Configuration saved to 'C:/project/samples/application_update/build/mcuboot/zephyr/.config'
    Kconfig header saved to 'C:/project/samples/application_update/build/mcuboot/zephyr/include/generated/autoconf.h'
    -- The C compiler identification is GNU 10.3.0
    -- The CXX compiler identification is GNU 10.3.0
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/ncs/toolchains/v2.0.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    MCUBoot bootloader key file: C:/ncs/v1.9.1/bootloader/mcuboot/root-ec-p256.pem
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/project/samples/application_update/build/mcuboot
    === child image mcuboot -  end ===
    
    CMake Warning at C:/ncs/v1.9.1/nrf/modules/mcuboot/CMakeLists.txt:262 (message):
      
    
            ---------------------------------------------------------
            --- WARNING: Using default MCUBoot key, it should not ---
            --- be used for production.                           ---
            ---------------------------------------------------------
            
    
    
    
    CMake Warning at C:/ncs/v1.9.1/zephyr/CMakeLists.txt:764 (message):
      No SOURCES given to Zephyr library: subsys__net__pkt_filter
    
      Excluding target from build.
    
    
    CMake Warning at C:/ncs/v1.9.1/zephyr/CMakeLists.txt:1687 (message):
      __ASSERT() statements are globally ENABLED
    
    
    -- Found partition manager static configuration: C:/project/samples/application_update/pm_static.yml
    Partition 'mcuboot' 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' 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 'mcuboot_secondary' is not included in the dynamic resolving since it is statically defined.
    Partition 'nrf_modem_lib_ctrl' is not included in the dynamic resolving since it is statically defined.
    Partition 'nrf_modem_lib_rx' is not included in the dynamic resolving since it is statically defined.
    Partition 'nrf_modem_lib_sram' is not included in the dynamic resolving since it is statically defined.
    Partition 'nrf_modem_lib_tx' is not included in the dynamic resolving since it is statically defined.
    Partition 'spm' is not included in the dynamic resolving since it is statically defined.
    Partition 'spm_sram' is not included in the dynamic resolving since it is statically defined.
    Partition 'sram_nonsecure' is not included in the dynamic resolving since it is statically defined.
    Partition 'sram_secure' is not included in the dynamic resolving since it is statically defined.
    Dropping partition 'nrf_modem_lib_trace' since its size is 0.
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/project/samples/application_update/build
    -- west build: building application
    [257/267] Linking C executable zephyr\zephyr_pre0.elf
    
    [261/267] Linking C executable zephyr\zephyr_pre1.elf
    
    [267/267] Linking C executable zephyr\zephyr.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:       65024 B        64 KB     99.22%
                SRAM:       12136 B        32 KB     37.04%
            IDT_LIST:          0 GB         2 KB      0.00%
    [173/183] Linking C executable zephyr\zephyr_pre0.elf
    
    [177/183] Linking C executable zephyr\zephyr_pre1.elf
    
    [183/183] Linking C executable zephyr\zephyr.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:       33992 B        48 KB     69.16%
                SRAM:       16416 B     211736 B      7.75%
            IDT_LIST:          0 GB         2 KB      0.00%
    [212/233] Linking C executable zephyr\zephyr_pre0.elf
    
    [216/233] Linking C executable zephyr\zephyr_pre1.elf
    
    [225/233] Linking C executable zephyr\zephyr.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:       96944 B     425472 B     22.79%
                SRAM:       25528 B     211736 B     12.06%
            IDT_LIST:          0 GB         2 KB      0.00%
    [233/233] Generating zephyr/merged.hex
     *  Terminal will be reused by tasks, press any key to close it. 
    
     *  Executing task: nRF Connect: Flash: application_update/build (active) 
    
    Flashing build to motor
    C:\Windows\system32\cmd.exe /d /s /c "west flash -d c:\project\samples\application_update\build --snr 203200665 --erase"
    
    -- west flash: rebuilding
    [0/25] Performing build step for 'spm_subimage'
    ninja: no work to do.
    [1/23] Performing build step for 'mcuboot_subimage'
    ninja: no work to do.
    [2/23] Building C object CMakeFiles/app.dir/src/main.c.obj
    [4/21] Linking C static library app\libapp.a
    [5/21] Linking C executable zephyr\zephyr_pre0.elf
    
    [6/21] Generating dev_handles.c
    FAILED: zephyr/dev_handles.c 
    cmd.exe /C "cd /D C:\project\samples\application_update\build\zephyr && C:\ncs\toolchains\v2.0.0\opt\bin\python.exe C:/ncs/v1.9.1/zephyr/scripts/gen_handles.py --output-source dev_handles.c --kernel C:/project/samples/application_update/build/zephyr/zephyr_pre0.elf --zephyr-base C:/ncs/v1.9.1/zephyr --start-symbol __device_start"
    Traceback (most recent call last):
      File "C:/ncs/v1.9.1/zephyr/scripts/gen_handles.py", line 37, in <module>
        from elftools.elf.elffile import ELFFile
      File "C:\ncs\toolchains\b620d30767\opt\bin\Lib\site-packages\elftools\elf\elffile.py", line 41, in <module>
        from ..dwarf.dwarfinfo import DWARFInfo, DebugSectionDescriptor, DwarfConfig
      File "C:\ncs\toolchains\b620d30767\opt\bin\Lib\site-packages\elftools\dwarf\dwarfinfo.py", line 17, in <module>
        from .structs import DWARFStructs
      File "C:\ncs\toolchains\b620d30767\opt\bin\Lib\site-packages\elftools\dwarf\structs.py", line 10, in <module>
        from logging.config import valid_ident
      File "<frozen zipimport>", line 259, in load_module
      File "logging\config.py", line 30, in <module>
      File "<frozen zipimport>", line 259, in load_module
      File "logging\handlers.py", line 26, in <module>
      File "<frozen zipimport>", line 259, in load_module
      File "socket.py", line 49, in <module>
    ImportError: Module use of python312.dll conflicts with this version of Python.
    ninja: build stopped: subcommand failed.
    FATAL ERROR: re-build in c:\project\samples\application_update\build failed
    
     *  The terminal process terminated with exit code: 1. 
     *  Terminal will be reused by tasks, press any key to close it.
    {
      "toolchainPath": "c:\\ncs\\toolchains\\v2.0.0",
      "sdkPath": "c:\\ncs\\v1.9.1",
      "board": "nrf9160dk_nrf9160_ns",
      "boardDir": "c:/ncs/v1.9.1/zephyr/boards/arm/nrf9160dk_nrf9160",
      "boardDirs": [
        "c:/ncs/v1.9.1/zephyr/boards/arm/nrf9160dk_nrf9160"
      ],
      "optimizations": "none",
      "cmakeArgs": [],
      "confFiles": [],
      "buildDirectory": "build",
      "kconfigFragments": [],
      "snippets": [],
      "dtcOverlays": [],
      "extraDtcOverlays": []
    }

Children
No Data
Related