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

  • 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

Related