VS Code errors/problem

Hi.

I am using SDK v2.6.0 (Toolchain v.2.6.0).
When I open VS Code (v1.91.1) I keep getting this warning -->Bad CMake executable: “”. Check to make sure it is installed or the value of the “cmake.cmakePath” setting contains the correct path.

Also, warnings regarding header files appear in the program code.

I don't understand why these warnings occur, because in the .defconfig file I enabled GPIO -->

And in the prj.conf file I enabled PWM -->

Such errors did not occur before. 

Please help me solve this problem.

Thanks.

  • Hi.

    Support information -->

    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.19042",
        "vscode": "1.91.1",
        "electron": "29.4.0",
        "node": "v20.9.0"
      },
      "system": {
        "date": "2024-07-24T17:59:13.401Z",
        "vscodeRoot": "c:\\Program Files\\Microsoft VS Code\\resources\\app",
        "nrfConnectForDesktopInstalled": true,
        "vscodeUptime": "00:10:51",
        "osUptime": "09:39:18",
        "cpu": "11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz"
      },
      "workspace": {
        "name": "v52810",
        "workspaceFile": null,
        "folders": [
          "c:\\nordic\\myapps\\v52810"
        ]
      },
      "sdks": [
        {
          "version": "v2.6.0",
          "path": "c:\\nordicsemi\\v2.6.0"
        },
        {
          "version": "v2.5.99-dev1",
          "path": "c:\\nordicsemi\\v2.5.99-dev1"
        }
      ],
      "activeBuild": "c:\\nordic\\myapps\\v52810\\build",
      "apps": [
        {
          "workspace": "c:\\nordic\\myapps\\v52810",
          "uri": "c:\\nordic\\myapps\\v52810",
          "buildConfigurations": [
            {
              "id": "c:\\nordic\\myapps\\v52810\\build",
              "name": "build",
              "boardId": "custom_board_nrf52810",
              "type": "Sysbuild",
              "isChild": false,
              "isStale": false,
              "taskBindings": {
                "build": [],
                "pristineBuild": [],
                "flash": [],
                "eraseAndFlash": []
              }
            }
          ]
        }
      ],
      "topdir": "c:\\nordicsemi\\v2.6.0",
      "workspaceState": "freestanding-ready",
      "toolchains": [
        {
          "version": "2.6.0",
          "path": "c:\\nordicsemi\\toolchains\\cf2149caf2"
        },
        {
          "version": "2.5.0",
          "path": "c:\\ncs\\toolchains\\c57af46cb7"
        }
      ],
      "connectedDevices": [],
      "deviceProvider": "nrfutil",
      "tools": {
        "C:\\nordicsemi\\toolchains\\cf2149caf2\\opt\\zephyr-sdk\\arm-zephyr-eabi\\bin\\arm-zephyr-eabi-gcc.exe": "0.16.5",
        "C:\\Program Files\\SEGGER\\JLink_V794e\\JLink.exe": "7.94e",
        "C:\\Program Files (x86)\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\nrfjprog.exe": "10.18.1",
        "nrfutil": "Not found",
        "C:\\nordicsemi\\toolchains\\cf2149caf2\\opt\\bin\\cmake.exe": "3.21.0",
        "C:\\nordicsemi\\toolchains\\cf2149caf2\\opt\\bin\\Scripts\\west.exe": "1.2.0",
        "C:\\nordicsemi\\toolchains\\cf2149caf2\\opt\\bin\\python.exe": "3.9.13",
        "C:\\nordicsemi\\toolchains\\cf2149caf2\\opt\\bin\\ninja.exe": "1.10.2",
        "C:\\nordicsemi\\toolchains\\cf2149caf2\\opt\\bin\\gperf.exe": "3.1",
        "C:\\nordicsemi\\toolchains\\cf2149caf2\\opt\\bin\\dtc.exe": "1.4.7",
        "C:\\nordicsemi\\toolchains\\cf2149caf2\\opt\\bin\\gn.exe": "2154",
        "C:\\nordicsemi\\toolchains\\cf2149caf2\\mingw64\\bin\\git.exe": "2.37.3.windows.1",
        "gdbPath": "c:\\nordicsemi\\toolchains\\cf2149caf2\\opt\\zephyr-sdk\\arm-zephyr-eabi\\bin\\arm-zephyr-eabi-gdb.exe"
      },
      "nrfutil": {
        "nrfutil-device": {
          "version": "2.0.0",
          "binPath": "c:\\Users\\Admin\\.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\\Admin\\.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\\Admin",
          "HOMEDRIVE": "C:",
          "HOMEPATH": "\\Users\\Admin",
          "PATH": "C:\\nordicsemi\\toolchains\\cf2149caf2;C:\\nordicsemi\\toolchains\\cf2149caf2\\mingw64\\bin;C:\\nordicsemi\\toolchains\\cf2149caf2\\bin;C:\\nordicsemi\\toolchains\\cf2149caf2\\opt\\bin;C:\\nordicsemi\\toolchains\\cf2149caf2\\opt\\bin\\Scripts;C:\\nordicsemi\\toolchains\\cf2149caf2\\opt\\nanopb\\generator-bin;C:\\nordicsemi\\toolchains\\cf2149caf2\\opt\\zephyr-sdk\\aarch64-zephyr-elf\\bin;C:\\nordicsemi\\toolchains\\cf2149caf2\\opt\\zephyr-sdk\\x86_64-zephyr-elf\\bin;C:\\nordicsemi\\toolchains\\cf2149caf2\\opt\\zephyr-sdk\\arm-zephyr-eabi\\bin;C:\\nordicsemi\\toolchains\\cf2149caf2\\opt\\zephyr-sdk\\riscv64-zephyr-elf\\bin;c:\\Users\\Admin\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2024.7.13-win32-x64\\platform\\nrfutil\\lib\\nrfutil-toolchain-manager;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 (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Program Files\\NVIDIA Corporation\\NVIDIA NvDLISR;C:\\Program Files (x86)\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Program Files\\Microsoft VS Code\\bin;C:\\Program Files\\PuTTY\\;C:\\python\\Scripts\\;C:\\python\\;C:\\Users\\Admin\\AppData\\Local\\Microsoft\\WindowsApps",
          "ZEPHYR_BASE": "c:\\nordicsemi\\v2.6.0\\zephyr",
          "ZEPHYR_TOOLCHAIN_VARIANT": "zephyr",
          "ZEPHYR_SDK_INSTALL_DIR": "C:\\nordicsemi\\toolchains\\cf2149caf2\\opt\\zephyr-sdk",
          "PYTHONPATH": "C:\\nordicsemi\\toolchains\\cf2149caf2\\opt\\bin;C:\\nordicsemi\\toolchains\\cf2149caf2\\opt\\bin\\Lib;C:\\nordicsemi\\toolchains\\cf2149caf2\\opt\\bin\\Lib\\site-packages"
        },
        "inherited": {
          "ELECTRON_RUN_AS_NODE": "1",
          "HOME": "C:\\Users\\Admin",
          "HOMEDRIVE": "C:",
          "HOMEPATH": "\\Users\\Admin",
          "Path": "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 (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Program Files\\NVIDIA Corporation\\NVIDIA NvDLISR;C:\\Program Files (x86)\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Program Files\\Microsoft VS Code\\bin;C:\\Program Files\\PuTTY\\;C:\\python\\Scripts\\;C:\\python\\;C:\\Users\\Admin\\AppData\\Local\\Microsoft\\WindowsApps",
          "PATH": "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 (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Program Files\\NVIDIA Corporation\\NVIDIA NvDLISR;C:\\Program Files (x86)\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Program Files\\Microsoft VS Code\\bin;C:\\Program Files\\PuTTY\\;C:\\python\\Scripts\\;C:\\python\\;C:\\Users\\Admin\\AppData\\Local\\Microsoft\\WindowsApps"
        },
        "toolchainPath": "c:\\nordicsemi\\toolchains\\cf2149caf2",
        "toolchainBinPath": "c:\\nordicsemi\\toolchains\\cf2149caf2\\opt\\zephyr-sdk\\arm-zephyr-eabi\\bin",
        "toolchainVersion": "2.6.0"
      },
      "terminal": {
        "defaultProfile": null
      },
      "config": {
        "nordic-semiconductor.nrf-connect": {
          "topdir": "${nrf-connect.sdk:2.3.0}",
          "toolchain": {
            "path": "${nrf-connect.toolchain:2.2.0}"
          },
          "ozonePath": "",
          "applications": [],
          "applicationOptions": {
            "${workspaceFolder}": {
              "flash": {
                "softreset": true,
                "skipBuild": true
              }
            }
          },
          "kconfig": {
            "interface": "kconfig"
          },
          "west": {
            "env": {
              "$base": "terminal"
            }
          },
          "boardRoots": [
            "C:\\custom_board"
          ],
          "taskBindings": {},
          "buildTerminal": {
            "condensedProgress": true
          },
          "debugging": {
            "flash": true,
            "bindings": {},
            "justMyCode": true
          },
          "activeAppFollowActiveEditor": true,
          "deviceProvider": "",
          "flash": {
            "softreset": false,
            "erase": false,
            "recover": false
          },
          "enableTelemetry": false,
          "thirdpartyIntegration": {},
          "toolchainManager": {
            "indexURL": null,
            "installDirectory": null
          },
          "nrfutil": {
            "home": null
          },
          "defaultOpenAction": "ask",
          "welcome": {
            "showOnStartup": true
          }
        },
        "nordic-semiconductor.nrf-terminal": {
          "terminalMode": "line"
        },
        "marus25.cortex-debug": {
          "variableUseNaturalFormat": true,
          "liveWatchRefreshRate": "300",
          "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,
          "dbgServerLogfile": null
        }
      },
      "extensions": {
        "internal": {
          "nordic-semiconductor.nrf-connect": {
            "version": "2024.7.13",
            "path": "c:\\Users\\Admin\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2024.7.13-win32-x64",
            "isActive": true
          },
          "nordic-semiconductor.nrf-terminal": {
            "version": "2024.3.15",
            "path": "c:\\Users\\Admin\\.vscode\\extensions\\nordic-semiconductor.nrf-terminal-2024.3.15",
            "isActive": true
          },
          "nordic-semiconductor.nrf-devicetree": {
            "version": "2024.6.20",
            "path": "c:\\Users\\Admin\\.vscode\\extensions\\nordic-semiconductor.nrf-devicetree-2024.6.20",
            "isActive": true
          },
          "nordic-semiconductor.nrf-kconfig": {
            "version": "2024.6.20",
            "path": "c:\\Users\\Admin\\.vscode\\extensions\\nordic-semiconductor.nrf-kconfig-2024.6.20",
            "isActive": true
          }
        },
        "external": {
          "marus25.cortex-debug": "1.12.1",
          "ms-vscode.cpptools": "1.21.2",
          "ms-vscode.js-debug": "1.91.0",
          "ms-vscode.js-debug-companion": "1.1.2",
          "ms-vscode.vscode-js-profile-table": "1.0.9",
          "augustocdias.tasks-shell-input": "1.9.2",
          "mcu-debug.debug-tracker-vscode": "0.0.15",
          "mcu-debug.memory-view": "0.0.25",
          "mcu-debug.peripheral-viewer": "1.4.6",
          "mcu-debug.rtos-views": "0.0.7",
          "MS-CEINTL.vscode-language-pack-ru": "1.91.2024071009",
          "ms-python.debugpy": "2024.8.0",
          "ms-python.isort": "2023.10.1",
          "ms-python.python": "2024.10.0",
          "ms-python.vscode-pylance": "2024.7.1",
          "ms-toolsai.jupyter": "2024.6.0",
          "ms-toolsai.jupyter-keymap": "1.1.2",
          "ms-toolsai.jupyter-renderers": "1.0.18",
          "ms-toolsai.vscode-jupyter-cell-tags": "0.1.9",
          "ms-toolsai.vscode-jupyter-slideshow": "0.1.6",
          "ms-vscode.cmake-tools": "1.18.43",
          "ms-vscode.cpptools-extension-pack": "1.3.0",
          "ms-vscode.cpptools-themes": "2.0.0",
          "shardulm94.trailing-spaces": "0.4.1",
          "trond-snekvik.gnu-mapfiles": "1.1.0",
          "twxs.cmake": "0.0.17"
        }
      }
    }

    When I enter the cmake command, I see a message that the command is unrecognized -->

    Also in the “OUTPUT” tab I see the following message. I don't know if this has any effect. 

  • Hello,

    Thank you for sharing the details.

    It appears that the CMake path is either not added to your system's PATH environment variable or CMake is not installed correctly. I found the CMake executable in your support information under C:\\nordicsemi\\toolchains\\cf2149caf2\\opt\\bin\\cmake.exe. Please run the command cmake --version (Run this under cmake.exe is located) to confirm that CMake is installed properly.

    Next, add this path to your system's PATH variable:

    1. Open Environment Variables.
    2. Edit the Path variable under the System variables section.
    3. Add C:\\nordicsemi\\toolchains\\cf2149caf2\\opt\\bin\\ to the list of paths.

    After making these changes, close all windows and restart Visual Studio Code. Go to ViewOutput and ensure that there are no CMake-related errors. This issue is not related to the nRF Connect VSCode extension.

    Please let me know if this resolves the issue.

    Kind regards,

    Abhijith

  • Hi Abhijith. Thank you for continuing to help me with this problem.

    When I run cmake --version, I see the same error as when I run cmake command -->

    I haven't found how to open Environment Variables properly. Could you please tell me how to do it? 

    I found the CMake Path item in the CMake Tools settings and wrote the specified path there, but that didn't solve the problem either, even after restart VS Code.

  • Hello,
    Could you include the same by editing the environmental variable on your PC? Please follow this link.

    See my screenshot:

    Kind Regards,

    Abhijith

  • Hi. I did it. Thanks for the instructions.

    Now cmake commands are recognized in the terminal -->

    But there are new errors in the OUTPUT section -->

Related