Toolchain very slow on Windows machines

Dear Nordic Team,

we are using the adafruit_feather_nrf52840 and nrf52840dk for our prototypes and recently the toolchain around nrf and zephyr has become a problem.

Build times (especially compilation of the device tree according to logs) became very long such that one reload of our cmake project takes up to 15 minutes.

It had worked in reasonable time previously, at some point the toolchain slowed down on 2 individual machines.
This has happened on 2 different machines with 3 different versions of zephyr and the nrf toolchain (v2.6.0, v2.6.1, v2.7.0).

I tested using standalone zephyr for the build which doesn't seem to work trivially, however it does build an image in less than 10 seconds.
Also on a Linux machine I have available, the build times are much shorter.

Is anybody aware of any windows specific problems or problems with dtc.exe that may cause this?

Is there some cache we directory or temporal files we may have missed to clean?

We have been investigating for some time now as it really slows down our development iterations severely.

  • Can you also provide the support log for us?

    Here are the steps to generate support information:
    1. Open the nRF Connect for VS Code extension.
    2. Navigate to the Welcome View in the nRF Connect Sidebar Views.
    3. Find and click on the "Generate Support Information" action.
    This will generate a log in the Output Panel View.
    Next, some suggestions from our devs:
    • On Windows, try disabling AV, or whitelist source folders and the SDK/toolchain install locations from AV.
    • We've seen some bad performance from west calls due to git garbage collection, but that can be helped by doing an aggressive prune of the git.

    Best regards,

    Simon

  • Hi Simon,

    Good news, your shot in the dark hit the bullseye. It seems to be a firewall issue, when I remove the connection to our local network or connect through my phone's hotspot it builds as fast as it is supposed to.

    We assume that since we can build without being connected, the firewall shouldn't be a problem.

    Can you explain to us why is this a problem? Is there something we can do to avoid having to disconnect from our local network to build as fast as possible?

    Here you have the log you requested

    {
    
      "platform": {
    
        "os": "win32",
    
        "osVersion": "Windows 10 Enterprise",
    
        "osKernel": "10.0.19045",
    
        "vscode": "1.92.0",
    
        "electron": "30.1.2",
    
        "node": "v20.14.0"
    
      },
    
      "system": {
    
        "date": "2024-08-08T05:23:14.842Z",
    
        "vscodeRoot": "c:\\Users\\CHMendeA\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app",
    
        "nrfConnectForDesktopInstalled": true,
    
        "vscodeUptime": "00:13:21",
    
        "osUptime": "00:22:21",
    
        "cpu": "13th Gen Intel(R) Core(TM) i7-1370P"
    
      },
    
      "workspace": {
    
        "name": "blinky_3",
    
        "workspaceFile": null,
    
        "folders": [
    
          "c:\\temp\\blinky_3"
    
        ]
    
      },
    
      "sdks": [
    
        {
    
          "version": "v2.7.0",
    
          "path": "c:\\ncs\\v2.7.0"
    
        }
    
      ],
    
      "activeBuild": "c:\\temp\\blinky_3\\build",
    
      "apps": [
    
        {
    
          "workspace": "c:\\temp\\blinky_3",
    
          "uri": "c:\\temp\\blinky_3",
    
          "buildConfigurations": [
    
            {
    
              "id": "c:\\temp\\blinky_3\\build",
    
              "name": "build",
    
              "boardId": "nrf5340dk_nrf5340_cpuapp",
    
              "type": "Zephyr",
    
              "isChild": false,
    
              "isStale": false,
    
              "taskBindings": {
    
                "build": [],
    
                "pristineBuild": [],
    
                "flash": [],
    
                "eraseAndFlash": []
    
              }
    
            }
    
          ]
    
        }
    
      ],
    
      "topdir": "c:\\ncs\\v2.7.0",
    
      "workspaceState": "freestanding-ready",
    
      "toolchains": [
    
        {
    
          "version": "2.7.0",
    
          "path": "c:\\ncs\\toolchains\\ce3b5ff664"
    
        }
    
      ],
    
      "connectedDevices": [],
    
      "deviceProvider": "nrfutil",
    
      "tools": {
    
        "C:\\ncs\\toolchains\\ce3b5ff664\\opt\\zephyr-sdk\\arm-zephyr-eabi\\bin\\arm-zephyr-eabi-gcc.exe": "0.16.5-1",
    
        "C:\\Program Files\\SEGGER\\JLink_V794e\\JLink.exe": "7.94e",
    
        "C:\\Program Files\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\nrfjprog.exe": null,
    
        "nrfutil": "Not found",
    
        "C:\\ncs\\toolchains\\ce3b5ff664\\opt\\bin\\cmake.exe": "3.21.0",
    
        "C:\\ncs\\toolchains\\ce3b5ff664\\opt\\bin\\Scripts\\west.exe": "1.2.0",
    
        "C:\\ncs\\toolchains\\ce3b5ff664\\opt\\bin\\python.exe": "3.9.13",
    
        "C:\\ncs\\toolchains\\ce3b5ff664\\opt\\bin\\ninja.exe": "1.10.2",
    
        "C:\\ncs\\toolchains\\ce3b5ff664\\opt\\bin\\gperf.exe": "3.1",
    
        "C:\\ncs\\toolchains\\ce3b5ff664\\opt\\bin\\dtc.exe": "1.4.7",
    
        "C:\\ncs\\toolchains\\ce3b5ff664\\opt\\bin\\gn.exe": "2172",
    
        "C:\\ncs\\toolchains\\ce3b5ff664\\mingw64\\bin\\git.exe": "2.37.3.windows.1",
    
        "gdbPath": "c:\\ncs\\toolchains\\ce3b5ff664\\opt\\zephyr-sdk\\arm-zephyr-eabi\\bin\\arm-zephyr-eabi-gdb.exe"
    
      },
    
      "nrfutil": {
    
        "nrfutil-device": {
    
          "version": "2.0.0",
    
          "binPath": "c:\\Users\\CHMendeA\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2024.7.13-win32-x64\\platform\\nrfutil\\bin\\nrfutil-device"
    
        },
    
        "nrfutil-toolchain-manager": {
    
          "version": "0.14.4",
    
          "binPath": "c:\\Users\\CHMendeA\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2024.7.13-win32-x64\\platform\\nrfutil\\bin\\nrfutil-toolchain-manager"
    
        }
    
      },
    
      "environment": {
    
        "westEnv": {
    
          "ELECTRON_RUN_AS_NODE": "1",
    
          "HOME": "C:\\Users\\CHMendeA",
    
          "HOMEDRIVE": "C:",
    
          "HOMEPATH": "\\Users\\CHMendeA",
    
          "PATH": "C:\\ncs\\toolchains\\ce3b5ff664;C:\\ncs\\toolchains\\ce3b5ff664\\mingw64\\bin;C:\\ncs\\toolchains\\ce3b5ff664\\bin;C:\\ncs\\toolchains\\ce3b5ff664\\opt\\bin;C:\\ncs\\toolchains\\ce3b5ff664\\opt\\bin\\Scripts;C:\\ncs\\toolchains\\ce3b5ff664\\opt\\nanopb\\generator-bin;C:\\ncs\\toolchains\\ce3b5ff664\\opt\\zephyr-sdk\\aarch64-zephyr-elf\\bin;C:\\ncs\\toolchains\\ce3b5ff664\\opt\\zephyr-sdk\\x86_64-zephyr-elf\\bin;C:\\ncs\\toolchains\\ce3b5ff664\\opt\\zephyr-sdk\\arm-zephyr-eabi\\bin;C:\\ncs\\toolchains\\ce3b5ff664\\opt\\zephyr-sdk\\riscv64-zephyr-elf\\bin;c:\\Users\\CHMendeA\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2024.7.13-win32-x64\\platform\\nrfutil\\lib\\nrfutil-toolchain-manager;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program
     Files\\WindowsApps\\Microsoft.DesktopAppInstaller_1.22.10661.0_x64__8wekyb3d8bbwe\";C:\\Program Files\\dotnet\\;C:\\Program Files\\Git\\cmd;C:\\Program Files (x86)\\Windows Kits\\10\\Windows Performance Toolkit\\;C:\\Program Files\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Users\\CHMendeA\\AppData\\Local\\Programs\\Python\\Launcher\\;C:\\Users\\CHMendeA\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\CHMendeA\\AppData\\Local\\Programs\\Microsoft
     VS Code\\bin;C:\\Program Files\\SEGGER\\JLink;;C:\\Users\\CHMendeA\\AppData\\Roaming\\Programs\\Zero Install",
    
          "ZEPHYR_BASE": "c:\\ncs\\v2.7.0\\zephyr",
    
          "ZEPHYR_TOOLCHAIN_VARIANT": "zephyr",
    
          "ZEPHYR_SDK_INSTALL_DIR": "C:\\ncs\\toolchains\\ce3b5ff664\\opt\\zephyr-sdk",
    
          "PYTHONPATH": "C:\\ncs\\toolchains\\ce3b5ff664\\opt\\bin;C:\\ncs\\toolchains\\ce3b5ff664\\opt\\bin\\Lib;C:\\ncs\\toolchains\\ce3b5ff664\\opt\\bin\\Lib\\site-packages"
    
        },
    
        "inherited": {
    
          "ELECTRON_RUN_AS_NODE": "1",
    
          "HOME": "C:\\Users\\CHMendeA",
    
          "HOMEDRIVE": "C:",
    
          "HOMEPATH": "\\Users\\CHMendeA",
    
          "Path": "C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files\\WindowsApps\\Microsoft.DesktopAppInstaller_1.22.10661.0_x64__8wekyb3d8bbwe\";C:\\Program
     Files\\dotnet\\;C:\\Program Files\\Git\\cmd;C:\\Program Files (x86)\\Windows Kits\\10\\Windows Performance Toolkit\\;C:\\Program Files\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Users\\CHMendeA\\AppData\\Local\\Programs\\Python\\Launcher\\;C:\\Users\\CHMendeA\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\CHMendeA\\AppData\\Local\\Programs\\Microsoft
     VS Code\\bin;C:\\Program Files\\SEGGER\\JLink;;C:\\Users\\CHMendeA\\AppData\\Roaming\\Programs\\Zero Install",
    
          "PATH": "C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files\\WindowsApps\\Microsoft.DesktopAppInstaller_1.22.10661.0_x64__8wekyb3d8bbwe\";C:\\Program
     Files\\dotnet\\;C:\\Program Files\\Git\\cmd;C:\\Program Files (x86)\\Windows Kits\\10\\Windows Performance Toolkit\\;C:\\Program Files\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Users\\CHMendeA\\AppData\\Local\\Programs\\Python\\Launcher\\;C:\\Users\\CHMendeA\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\CHMendeA\\AppData\\Local\\Programs\\Microsoft
     VS Code\\bin;C:\\Program Files\\SEGGER\\JLink;;C:\\Users\\CHMendeA\\AppData\\Roaming\\Programs\\Zero Install"
    
        },
    
        "toolchainPath": "c:\\ncs\\toolchains\\ce3b5ff664",
    
        "toolchainBinPath": "c:\\ncs\\toolchains\\ce3b5ff664\\opt\\zephyr-sdk\\arm-zephyr-eabi\\bin",
    
        "toolchainVersion": "2.7.0"
    
      },
    
      "terminal": {
    
        "defaultProfile": null
    
      },
    
      "config": {
    
        "nordic-semiconductor.nrf-connect": {
    
          "topdir": "C:\\ncs\\v2.6.1",
    
          "toolchain": {
    
            "path": "C:\\ncs\\toolchains"
    
          },
    
          "ozonePath": "",
    
          "applications": [],
    
          "applicationOptions": {},
    
          "kconfig": {
    
            "interface": "kconfig"
    
          },
    
          "west": {
    
            "env": {
    
              "$base": "terminal"
    
            }
    
          },
    
          "boardRoots": [],
    
          "taskBindings": {},
    
          "buildTerminal": {
    
            "condensedProgress": true
    
          },
    
          "debugging": {
    
            "flash": true,
    
            "bindings": {},
    
            "justMyCode": true
    
          },
    
          "activeAppFollowActiveEditor": true,
    
          "deviceProvider": "",
    
          "flash": {
    
            "softreset": false,
    
            "erase": false,
    
            "recover": false
    
          },
    
          "enableTelemetry": true,
    
          "thirdpartyIntegration": {},
    
          "toolchainManager": {
    
            "indexURL": null,
    
            "installDirectory": null
    
          },
    
          "nrfutil": {
    
            "home": null
    
          },
    
          "defaultOpenAction": "ask"
    
        },
    
        "nordic-semiconductor.nrf-terminal": {
    
          "terminalMode": "character"
    
        }
    
      },
    
      "extensions": {
    
        "internal": {
    
          "nordic-semiconductor.nrf-connect": {
    
            "version": "2024.7.13",
    
            "path": "c:\\Users\\CHMendeA\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2024.7.13-win32-x64",
    
            "isActive": true
    
          },
    
          "nordic-semiconductor.nrf-terminal": {
    
            "version": "2024.3.15",
    
            "path": "c:\\Users\\CHMendeA\\.vscode\\extensions\\nordic-semiconductor.nrf-terminal-2024.3.15",
    
            "isActive": true
    
          },
    
          "nordic-semiconductor.nrf-devicetree": {
    
            "version": "2024.6.20",
    
            "path": "c:\\Users\\CHMendeA\\.vscode\\extensions\\nordic-semiconductor.nrf-devicetree-2024.6.20",
    
            "isActive": true
    
          },
    
          "nordic-semiconductor.nrf-kconfig": {
    
            "version": "2024.6.20",
    
            "path": "c:\\Users\\CHMendeA\\.vscode\\extensions\\nordic-semiconductor.nrf-kconfig-2024.6.20",
    
            "isActive": true
    
          }
    
        },
    
        "external": {
    
          "marus25.cortex-debug": null,
    
          "ms-vscode.cpptools": "1.21.5",
    
          "ms-vscode.js-debug": "1.92.0",
    
          "ms-vscode.js-debug-companion": "1.1.3",
    
          "ms-vscode.vscode-js-profile-table": "1.0.9",
    
          "ms-python.debugpy": "2024.10.0",
    
          "ms-python.python": "2024.12.1",
    
          "ms-python.vscode-pylance": "2024.7.1",
    
          "ms-vscode.cmake-tools": "1.18.44",
    
          "ms-vscode.cpptools-extension-pack": "1.3.0",
    
          "ms-vscode.cpptools-themes": "2.0.0",
    
          "njqdev.vscode-python-typehint": "1.5.1",
    
          "oderwat.indent-rainbow": "8.3.1",
    
          "seanwu.vscode-qt-for-python": "7.6.0",
    
          "trond-snekvik.gnu-mapfiles": "1.1.0",
    
          "twxs.cmake": "0.0.17",
    
          "VisualStudioExptTeam.intellicode-api-usage-examples": "0.2.8",
    
          "VisualStudioExptTeam.vscodeintellicode": "1.3.1"
    
        }
    
      }
    
    }
    


    Thank you very much.

    Best regards,

    Alex

  • Hi Alex

    Okay, glad to hear we found the root of the issue at least. I think in order to better the performance on the internal network the firewall will need to whitelist some of the resources VS Code is pulling from. I'll get back to you on what exactly these are. I believe you can check the Online Services in VS code to see what is enabled to fetch straight from URLs. I think JSON, Git and CMake at least are some of these.

    Also, we see that you're using the stable version of the VS code extension. In NCS v2.7.0 you need to use the pre-release version of the nRF Connect VS Code extension.

    Best regards,

    Simon

  • Hi Simon,

    I will update the nRF VS Code extension to the pre-release version.

    Still, we don't think this problem comes from VS Code. My colleague Peter who started this thread, uses CLion with CMake to build the project (Always worked fast before like my setup with VS Code) and we started to get the slow down builds at the same time so we both faced the same issue with and without VS Code so we are pretty sure the build issue doesn't come from VS Code or the extension. 

    If you can tell us what would need to be whitelisted would be great but still we think that this is probably a timeout that should be updated or an option to disable the wait since we are not sure if IT team here at Sony and probably in other companies would allow to change the firewall configuration.

    In any case, we are grateful for your help.

    Best regards,

    Alex

  • Hi Alex

    You can begin by whitelisting the source folders and SDK toolchain install locations in your antivirus software, and whitelist the ones I mentioned already, as well as west.

    Best regards,

    Simon

Related