This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

VS Code: Unable to determine what CMake generator to use.

When I create a new project from samples in VS Code I get this error
[variant] Loaded new set of variants
[kit] Successfully loaded 9 kits from C:\Users\Andrea\AppData\Local\CMakeTools\cmake-tools-kits.json
[main] Unable to determine what CMake generator to use. Please install or configure a preferred generator, or update settings.json, your Kit configuration or PATH variable. Error: No usable generator found.
[main] Configuring folder: hello_world
[main] Unable to determine what CMake generator to use. Please install or configure a preferred generator, or update settings.json, your Kit configuration or PATH variable. Error: No usable generator found.
How can I fix it?
Parents
  • I would suggest that you reinstall the Toolchain Manager.

    I've reinstalled it two times!

    If you go to the VS Code extensions, find nRF Connect for VS Code, right click and choose Extension Settings. There you should see Nrf-connect>Toolchain:Path. If you are using NCS 1.8, it should be $(workspaceFolder:v1.8.0). 

    After select the SDK and Toolchain in the Quick Setup on Welcome page

    in the Extension Settings I have

    and when I try to create new application I have

    . But when I press the "Create Application" button in the output pannel I get

    [variant] Loaded new set of variants
    [kit] Successfully loaded 9 kits from C:\Users\Andrea\AppData\Local\CMakeTools\cmake-tools-kits.json
    [main] Unable to determine what CMake generator to use. Please install or configure a preferred generator, or update settings.json, your Kit configuration or PATH variable. Error: No usable generator found.
    [main] Configuring folder: hello_world 
    [main] Unable to determine what CMake generator to use. Please install or configure a preferred generator, or update settings.json, your Kit configuration or PATH variable. Error: No usable generator found.
    [main] Unable to determine what CMake generator to use. Please install or configure a preferred generator, or update settings.json, your Kit configuration or PATH variable. Error: No usable generator found.

    I tried to install the Nordic environment on another clean notebook and it works! Maybe on my notebook I've some corruption between VS Code extensions (PlatformIO, Flutter, Espressiff...)?

  • Hi Andrea,

    Configuration pages that you showed here seem to be correct.

    When did you start getting this problem? Was it possible for you to make new application from sample before you started experiencing this error?

    Best regards,
    Dejan

  • When did you start getting this problem?

    From the start.

    Was it possible for you to make new application from sample before you started experiencing this error?

    No Disappointed

    At the begin I had the error

    [variant] Loaded new set of variants
    [kit] Successfully loaded 9 kits from C:\Users\Andrea\AppData\Local\CMakeTools\cmake-tools-kits.json
    [main] Configuring folder: blinky
    [proc] Executing command: C:\Users\Andrea\.espressif\tools\cmake\3.16.4\bin\cmake.EXE --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -Hc:/Users/Andrea/Documents/NordicApps/blinky -Bc:/Users/Andrea/Documents/NordicApps/blinky/build -G "Visual Studio 16 2019" -T host=x64 -A x64
    [cmake] Not searching for unused variables given on the command line.
    [cmake] CMake Error at CMakeLists.txt:3 (cmake_minimum_required):
    [cmake]   CMake 3.20.0 or higher is required.  You are running version 3.16.4
    [cmake]
    [cmake]
    [cmake] -- Configuring incomplete, errors occurred!

    As you can read the extension tried to use the cmake of espressiff toolchain, giving a version error. Now I unistalled the (no longer necessary) espressiff extension and deleted its tollchain paths in the PATH environment variable. And now I get the error above.

  • HI Andrea,

    What is xx in cmake-3.xx (for example, cmake-3.20) directory inside your ncs\1.8.0\toolchain\opt\share folder?

    What is the last version of the rst file which is visible in your ncs\1.8.0\toolchain\opt\share\cmake-3.xx\Help\release folder?  

    Please open your Toolchain Manager, press down arrow and choose "Open Command Prompt". Type "cmake --version" command and share the output of the command.

    Best regards,
    Dejan

  • What is xx in cmake-3.xx (for example, cmake-3.20) directory inside your ncs\1.8.0\toolchain\opt\share folder?

    20

    What is the last version of the rst file which is visible in your ncs\1.8.0\toolchain\opt\share\cmake-3.xx\Help\release folder?  

    3.20.rst

    Please open your Toolchain Manager, press down arrow and choose "Open Command Prompt". Type "cmake --version" command and share the output of the command.

    C:\Users\Andrea\ncs\v1.8.0>cmake --version
    cmake version 3.20.5
    
    CMake suite maintained and supported by Kitware (kitware.com/cmake).

    It seems that in VS Code there isn't any reference to the toolchain.

  • Hi Andrea,

    Please ensure that you are not running any unnecessary extensions (such as Expressiff, PlatformIO, ...) on your laptop. If you still do, please remove them and try again.

    In addition, please send me the output of "Generate Support Information". In Windows start by pressing Ctrl-Shift-P (in Mac Cmd-Shift-P) and type "Generate Support Information". The report will be opened in the Output Pane. Please copy everything and send it back to me.

    Best regards,
    Dejan

Reply
  • Hi Andrea,

    Please ensure that you are not running any unnecessary extensions (such as Expressiff, PlatformIO, ...) on your laptop. If you still do, please remove them and try again.

    In addition, please send me the output of "Generate Support Information". In Windows start by pressing Ctrl-Shift-P (in Mac Cmd-Shift-P) and type "Generate Support Information". The report will be opened in the Output Pane. Please copy everything and send it back to me.

    Best regards,
    Dejan

Children
  • Please ensure that you are not running any unnecessary extensions

    I unistalled the unnecessary extensions (Espressiff in my case) but I have other extensions I need (PlatformIO, Flutter, Dart). I thought to unistall VS Code and do a clean installation, but before I want to try and find a painless solution. I don't understand why the nRF extension doesn't finds the toolchain path if I set it in the Quick Setup page. Is a OS environment variable issue? I don't know how the nRF extension works but seems to be a bug.

    In addition, please send me the output of "Generate Support Information".

    Here the output

    IMPORTANT: The data below could contain sensitive or confidential information about your environment.
    If you do not wish this to be seen by others, please make sure to remove it before sharing.
    
    For help and support, visit the Nordic DevZone at https://devzone.nordicsemi.com/.
    
    {
      "platform": {
        "os": "win32",
        "osVersion": "Windows 10 Home",
        "osKernel": "10.0.19043",
        "vscode": "1.63.2",
        "electron": "13.5.2",
        "node": "v14.16.0"
      },
      "system": {
        "date": "2022-01-28T19:00:32.188Z",
        "vscodeRoot": "c:\\Users\\Andrea\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app",
        "nrfConnectForDesktopInstalled": true,
        "vscodeUptime": "00:01:11",
        "osUptime": "03:38:05",
        "cpu": {
          "model": "Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz",
          "speed": "2592 MHz",
          "count": 6
        },
        "memory": {
          "total": "15.85 GB",
          "free": "9.84 GB"
        }
      },
      "workspace": {
        "name": null,
        "workspaceFile": null,
        "folders": []
      },
      "extensions": {
        "internal": {
          "nordic-semiconductor.nrf-connect": {
            "version": "2021.12.137",
            "path": "c:\\Users\\Andrea\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2021.12.137",
            "isActive": true
          },
          "nordic-semiconductor.nrf-terminal": {
            "version": "2021.11.7",
            "path": "c:\\Users\\Andrea\\.vscode\\extensions\\nordic-semiconductor.nrf-terminal-2021.11.7",
            "isActive": true
          },
          "nordic-semiconductor.devicetree": null,
          "nordic-semiconductor.kconfig": null
        },
        "external": {
          "marus25.cortex-debug": "1.2.2",
          "ms-vscode.cpptools": "1.8.1",
          "ms-vscode-remote.remote-wsl-recommender": "0.0.12",
          "ms-vscode.js-debug": "1.62.0",
          "ms-vscode.js-debug-companion": "1.0.15",
          "ms-vscode.references-view": "0.0.81",
          "ms-vscode.vscode-js-profile-table": "0.0.18",
          "Dart-Code.dart-code": "3.32.0",
          "Dart-Code.flutter": "3.32.0",
          "MS-CEINTL.vscode-language-pack-it": "1.63.3",
          "ms-python.python": "2021.12.1559732655",
          "ms-python.vscode-pylance": "2022.1.5",
          "ms-toolsai.jupyter": "2021.11.1001550889",
          "ms-toolsai.jupyter-keymap": "1.0.0",
          "ms-toolsai.jupyter-renderers": "1.0.4",
          "ms-vscode.cmake-tools": "1.9.2",
          "PKief.material-icon-theme": "4.12.1",
          "platformio.platformio-ide": "2.4.0",
          "trond-snekvik.gnu-mapfiles": "1.1.0",
          "twxs.cmake": "0.0.17"
        }
      },
      "tools": {
        "C:\\Program Files\\SEGGER\\JLink\\JLink.exe": "7.58b",
        "nrfjprog": "Not found",
        "cmake": "Not found",
        "west": "Not found",
        "python": "Not found",
        "ninja": "Not found",
        "gperf": "Not found",
        "dtc": "Not found",
        "gnuarmemb": "Not found",
        "gn": "Not found",
        "git": "Not found"
      },
      "connectedDevices": [],
      "config": {
        "nordic-semiconductor.nrf-connect": {
          "topdir": "${nrf-connect.sdk:1.8.0}",
          "toolchain": {
            "path": "${nrf-connect.toolchain:1.8.0}"
          },
          "ozonePath": "",
          "applications": [],
          "jlink": {
            "rtosPlugin": ""
          },
          "kconfig": {
            "interface": "kconfig"
          },
          "welcome": {
            "showOnStartup": false
          },
          "west": {
            "env": {
              "$base": "terminal"
            }
          },
          "boardRoots": [],
          "enableTelemetry": true
        },
        "nordic-semiconductor.nrf-terminal": {
          "terminalMode": "character"
        },
        "nordic-semiconductor.devicetree": {
          "modules": [
            "${zephyrBase}",
            "${zephyrBase}/../nrf",
            "."
          ],
          "zephyr": "",
          "ctxFile": "",
          "defaultBoard": ""
        },
        "nordic-semiconductor.kconfig": {
          "root": "",
          "env": {},
          "cfiles": true,
          "disable": false,
          "zephyr": {
            "base": ""
          },
          "python": ""
        },
        "marus25.cortex-debug": {
          "armToolchainPath": null,
          "armToolchainPrefix": "arm-none-eabi",
          "gdbPath": null,
          "objdumpPath": null,
          "JLinkGDBServerPath": null,
          "openocdPath": null,
          "pyocdPath": null,
          "PEGDBServerPath": null,
          "stutilPath": null,
          "stlinkPath": null,
          "stm32cubeprogrammer": null,
          "enableTelemetry": true,
          "flattenAnonymous": false,
          "registerUseNaturalFormat": true,
          "variableUseNaturalFormat": true,
          "dbgServerLogfile": null,
          "showDevDebugOutput": "none"
        }
      },
      "environment": {
        "westExe": "c:\\Users\\Andrea\\ncs\\v1.8.0\\toolchain\\opt\\bin\\Scripts\\west.exe",
        "westEnv": {
          "ELECTRON_RUN_AS_NODE": "1",
          "HOME": "C:\\Users\\Andrea\\AppData\\Roaming\\SPB_Data",
          "HOMEDRIVE": "C:",
          "HOMEPATH": "\\Users\\Andrea",
          "Path": "c:\\Users\\Andrea\\ncs\\v1.8.0\\toolchain\\mingw64\\bin;c:\\Users\\Andrea\\ncs\\v1.8.0\\toolchain\\mingw64\\libexec\\git-core;c:\\Users\\Andrea\\ncs\\v1.8.0\\toolchain\\opt\\bin;c:\\Users\\Andrea\\ncs\\v1.8.0\\toolchain\\opt\\bin\\Scripts;undefined",
          "PATH": "C:\\Program Files (x86)\\Common Files\\Intel\\Shared Libraries\\redist\\intel64\\compiler;C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\Program Files\\NVIDIA Corporation\\NVIDIA NvDLISR;C:\\Program Files\\Microchip\\xc16\\v1.50\\bin;C:\\Program Files (x86)\\Microchip\\xc32\\v2.30\\bin;C:\\Program Files (x86)\\National Instruments\\Shared\\LabVIEW CLI;C:\\Program Files (x86)\\IVI Foundation\\VISA\\WinNT\\Bin\\;C:\\Program Files\\IVI Foundation\\VISA\\Win64\\Bin\\;C:\\Program Files (x86)\\Microsoft SQL Server\\80\\Tools\\Binn\\;C:\\Program Files (x86)\\IVI Foundation\\VISA\\WinNT\\Bin;C:\\Program Files (x86)\\Microsoft SQL Server\\100\\Tools\\Binn\\;C:\\Program Files (x86)\\Microsoft SQL Server\\100\\DTS\\Binn\\;C:\\Program Files (x86)\\Microchip\\xc16\\v1.50\\bin;C:\\Program Files\\MiKTeX 2.9\\miktex\\bin\\x64\\;C:\\Program Files\\Microchip\\xc8\\v2.20\\bin;C:\\Program Files (x86)\\IVI Foundation\\IVI\\bin;C:\\Program Files\\IVI Foundation\\IVI\\bin;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files (x86)\\Gpg4win\\..\\GnuPG\\bin;C:\\Program Files\\Polyspace\\R2020a\\runtime\\win64;C:\\Program Files\\Polyspace\\R2020a\\bin;C:\\Qwt-6.1.5\\lib;C:\\Program Files (x86)\\Windows Kits\\10\\Windows Performance Toolkit\\;C:\\Program Files\\dotnet\\;C:\\Program Files\\PuTTY\\;C:\\Program Files\\Git\\cmd;C:\\Program Files\\Microchip\\xc32\\v3.01\\bin;C:\\Program Files\\Microchip\\xc16\\v1.70\\bin;C:\\Program Files\\Microchip\\xc8\\v2.32\\bin;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Program Files\\nodejs\\;C:\\Program Files\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Users\\Andrea\\AppData\\Local\\Programs\\Python\\Python39\\Scripts\\;C:\\Users\\Andrea\\AppData\\Local\\Programs\\Python\\Python39\\;C:\\Cadence\\SPB_16.6\\tools\\pcb\\bin;C:\\Cadence\\SPB_16.6\\tools\\fet\\bin;C:\\Cadence\\SPB_16.6\\openaccess\\bin\\win32\\opt;C:\\Cadence\\SPB_16.6\\tools\\bin;C:\\Cadence\\SPB_16.6\\tools\\capture;C:\\Cadence\\SPB_16.6\\tools\\pspice;C:\\Users\\Andrea\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Flutter-SDK\\bin;C:\\Users\\Andrea\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\Users\\Andrea\\.dotnet\\tools;C:\\Users\\Andrea\\AppData\\Roaming\\npm;",
          "ZEPHYR_BASE": "c:\\Users\\Andrea\\ncs\\v1.8.0\\zephyr",
          "GNUARMEMB_TOOLCHAIN_PATH": "c:\\Users\\Andrea\\ncs\\v1.8.0\\toolchain\\opt",
          "ZEPHYR_TOOLCHAIN_VARIANT": "gnuarmemb",
          "PYTHONPATH": "c:\\Users\\Andrea\\ncs\\v1.8.0\\toolchain\\opt\\bin;c:\\Users\\Andrea\\ncs\\v1.8.0\\toolchain\\opt\\bin\\Lib;c:\\Users\\Andrea\\ncs\\v1.8.0\\toolchain\\opt\\bin\\Lib\\site-packages",
          "Python3_ROOT": "c:\\Users\\Andrea\\ncs\\v1.8.0\\toolchain\\opt\\bin"
        },
        "toolchainPath": "c:\\Users\\Andrea\\ncs\\v1.8.0\\toolchain",
        "toolchainBinPath": "c:\\Users\\Andrea\\ncs\\v1.8.0\\toolchain\\opt\\bin",
        "toolchainVersion": "1.8.0"
      },
      "terminal": {
        "shell": null,
        "defaultProfile": null
      }
    }
    
    

Related