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

Problems with VS Code

Hi

I've been having issues with this since the first time I installed VS Code and ncs for VS Code. I've used the Nordic's official YT setup guide while installing. 

The problem is shown in the following picture:

When I "Create new application from sample" this does not happen at first. But after I close the VS Code and I reopen it, this sometimes occur.

Can anyone help me with this?

Thanks!

Parents
  • Hi Emir

    What operating system do you use?

    Regards,
    Sigurd Hellesvik

  • Hi Sigurd.

    I'm using Windows 10.

    Sorry for not mentioning that.

  • Alright, thank you for the information.

    Same thing happens when I manually copy a sample folder and use the "Open Application" function.

  • Also, I figured I'd share these settings.json, they seem relevant to this issue:

    {
        "workbench.colorTheme": "Default Dark+",
        "idf.showOnboardingOnInit": false,
        "idf.partialDarkTheme": "",
        "idf.espIdfPathWin": "C:\\Users\\Em\\esp\\esp-idf",
        "idf.pythonBinPathWin": "C:\\Users\\Em\\.espressif\\python_env\\idf4.3_py3.8_env\\Scripts\\python.exe",
        "idf.toolsPathWin": "C:\\Users\\Em\\.espressif",
        "idf.customExtraPaths": "C:\\Users\\Em\\.espressif\\tools\\xtensa-esp32-elf\\esp-2020r3-8.4.0\\xtensa-esp32-elf\\bin;C:\\Users\\Em\\.espressif\\tools\\xtensa-esp32s2-elf\\esp-2020r3-8.4.0\\xtensa-esp32s2-elf\\bin;C:\\Users\\Em\\.espressif\\tools\\xtensa-esp32s3-elf\\esp-2020r3-8.4.0\\xtensa-esp32s3-elf\\bin;C:\\Users\\Em\\.espressif\\tools\\riscv32-esp-elf\\1.24.0.123_64eb9ff-8.4.0\\riscv32-esp-elf\\bin;C:\\Users\\Em\\.espressif\\tools\\esp32ulp-elf\\2.28.51-esp-20191205\\esp32ulp-elf-binutils\\bin;C:\\Users\\Em\\.espressif\\tools\\esp32s2ulp-elf\\2.28.51-esp-20191205\\esp32s2ulp-elf-binutils\\bin;C:\\Users\\Em\\.espressif\\tools\\cmake\\3.16.4\\bin;C:\\Users\\Em\\.espressif\\tools\\openocd-esp32\\v0.10.0-esp32-20210401\\openocd-esp32\\bin;C:\\Users\\Em\\.espressif\\tools\\ninja\\1.10.2;C:\\Users\\Em\\.espressif\\tools\\idf-exe\\1.0.1;C:\\Users\\Em\\.espressif\\tools\\ccache\\3.7;C:\\Users\\Em\\.espressif\\tools\\dfu-util\\0.9\\dfu-util-0.9-win64;C:\\Users\\Em\\.espressif\\tools\\idf-python-wheels\\idf4.3_py3.9_2021-01-07",
        "idf.customExtraVars": "{\"OPENOCD_SCRIPTS\":\"C:\\\\Users\\\\Em\\\\.espressif\\\\tools\\\\openocd-esp32\\\\v0.10.0-esp32-20210401/openocd-esp32/share/openocd/scripts\",\"IDF_CCACHE_ENABLE\":\"1\"}",
        "idf.gitPath": "git",
        "idf.adapterTargetName": "esp32",
        "idf.openOcdConfigs": [
            "interface/ftdi/esp32_devkitj_v1.cfg",
            "target/esp32.cfg"
        ],
        "idf.flashType": "UART",
        "idf.portWin": "COM7",
        "nrf-connect.welcome.showOnStartup": false,
        "nrf-connect.topdir": "c:\\Users\\Em\\ncs\\v1.5.0",
        "nrf-connect.toolchain.path": "c:\\Users\\Em\\ncs\\v1.5.0\\toolchain",
        "C_Cpp.updateChannel": "Insiders",
        "C_Cpp.default.configurationProvider": "nrf-connect",
        "nrf-connect.applications": [
        
        
        ]
    }

  • Hi Emir

    Could you send the output from the command:  "nRF Connect: Generate Support Information" and  "C/C++: Log Diagnostics"?

    When reloading VS Code, loading the extension can sometimes be slow. Do you still have the issue if you build a after a short wait?

    Regards,
    Sigurd Hellesvik

  • Hi Sigurd,

    Following is the required ouput:

    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 Pro",
        "osKernel": "10.0.19042",
        "vscode": "1.61.1",
        "electron": "13.5.1",
        "node": "v14.16.0"
      },
      "system": {
        "date": "2021-10-18T07:32:48.317Z",
        "vscodeRoot": "c:\\Users\\N\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app",
        "nrfConnectForDesktopInstalled": true,
        "vscodeUptime": "00:01:58",
        "osUptime": "57:32:13",
        "cpu": {
          "model": "Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz",
          "speed": "3193 MHz",
          "count": 2
        },
        "memory": {
          "total": "7.96 GB",
          "free": "3.31 GB"
        }
      },
      "workspace": {
        "name": "ncs150 (Workspace)",
        "workspaceFile": "c:\\ncsproj\\ncs150.code-workspace",
        "folders": [
          "c:\\ncsproj\\ncs150t",
          "c:\\ncsproj\\ncs_custom_service"
        ]
      },
      "extensions": {
        "internal": {
          "nordic-semiconductor.nrf-connect": {
            "version": "2021.10.103",
            "path": "c:\\Users\\N\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2021.10.103",
            "isActive": true
          },
          "nordic-semiconductor.nrf-terminal": {
            "version": "2021.9.26",
            "path": "c:\\Users\\N\\.vscode\\extensions\\nordic-semiconductor.nrf-terminal-2021.9.26",
            "isActive": true
          },
          "nordic-semiconductor.devicetree": null,
          "nordic-semiconductor.kconfig": null
        },
        "external": {
          "marus25.cortex-debug": "0.4.7",
          "ms-vscode.cpptools": "1.7.0",
          "ms-vscode-remote.remote-wsl-recommender": "0.0.11",
          "ms-vscode.js-debug": "1.61.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",
          "espressif.esp-idf-extension": "1.2.0",
          "trond-snekvik.gnu-mapfiles": "1.1.0",
          "twxs.cmake": "0.0.17"
        }
      },
      "tools": {
        "jlink": "Not found",
        "C:\\Program Files\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\nrfjprog.exe": "10.10.0",
        "c:\\Users\\N\\ncs\\v1.5.0\\toolchain\\opt\\bin\\cmake.exe": "3.17.3",
        "c:\\Users\\N\\ncs\\v1.5.0\\toolchain\\opt\\bin\\Scripts\\west.exe": "0.9.0",
        "c:\\Users\\N\\ncs\\v1.5.0\\toolchain\\opt\\bin\\python.exe": "3.8.2",
        "c:\\Users\\N\\ncs\\v1.5.0\\toolchain\\opt\\bin\\ninja.exe": "1.9.0",
        "c:\\Users\\N\\ncs\\v1.5.0\\toolchain\\opt\\bin\\gperf.exe": "3.1",
        "c:\\Users\\N\\ncs\\v1.5.0\\toolchain\\opt\\bin\\dtc.exe": "1.4.7",
        "gnuarmemb": "Not found",
        "c:\\Users\\N\\ncs\\v1.5.0\\toolchain\\opt\\bin\\gn.exe": "1891"
      },
      "config": {
        "nordic-semiconductor.nrf-connect": {
          "topdir": "c:\\Users\\N\\ncs\\v1.5.0",
          "toolchain": {
            "path": "c:\\Users\\N\\ncs\\v1.5.0\\toolchain"
          },
          "ozonePath": "",
          "applications": [
            "c:\\ncsproj\\ncs150t",
            "c:\\ncsproj\\ncs_custom_service"
          ],
          "jlink": {
            "rtosPlugin": ""
          },
          "kconfig": {
            "interface": null
          },
          "welcome": {
            "showOnStartup": false
          },
          "west": {
            "env": {
              "$base": "terminal"
            }
          },
          "boardRoots": []
        },
        "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": {
            "board": {},
            "west": "",
            "base": "C:\\Users\\N\\ncs\\v1.5.0\\zephyr",
            "soc_roots": []
          }
        },
        "marus25.cortex-debug": {
          "armToolchainPath": null,
          "armToolchainPrefix": "arm-none-eabi",
          "gdbPath": null,
          "JLinkGDBServerPath": null,
          "openocdPath": null,
          "pyocdPath": null,
          "PEGDBServerPath": null,
          "stutilPath": null,
          "stlinkPath": null,
          "stm32cubeprogrammer": null,
          "enableTelemetry": true,
          "flattenAnonymous": false,
          "registerUseNaturalFormat": true,
          "variableUseNaturalFormat": true
        }
      },
      "environment": {
        "westExe": "c:\\Users\\N\\ncs\\v1.5.0\\toolchain\\opt\\bin\\Scripts\\west.exe",
        "westEnv": {
          "ELECTRON_RUN_AS_NODE": "1",
          "HOMEDRIVE": "C:",
          "HOMEPATH": "\\Users\\N",
          "Path": "c:\\Users\\N\\ncs\\v1.5.0\\toolchain\\mingw64\\bin;c:\\Users\\N\\ncs\\v1.5.0\\toolchain\\mingw64\\libexec\\git-core;c:\\Users\\N\\ncs\\v1.5.0\\toolchain\\opt\\bin;c:\\Users\\N\\ncs\\v1.5.0\\toolchain\\opt\\bin\\Scripts;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\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Program Files\\PowerShell\\7\\;C:\\ProgramData\\chocolatey\\bin;C:\\Program Files\\dotnet\\;C:\\Program Files\\PuTTY\\;C:\\Program Files (x86)\\ATI Technologies\\ATI.ACE\\Core-Static;C:\\Program Files\\Git\\cmd;C:\\Users\\N\\AppData\\Local\\Programs\\Python\\Python38-32\\Scripts\\;C:\\Users\\N\\AppData\\Local\\Programs\\Python\\Python38-32\\;C:\\Program Files (x86)\\GNU Tools Arm Embedded\\7 2018-q2-update\\bin;C:\\Users\\N\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\N\\AppData\\Local\\GitHubDesktop\\bin;C:\\Users\\N\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;",
          "ZEPHYR_BASE": "c:\\Users\\N\\ncs\\v1.5.0\\zephyr",
          "GNUARMEMB_TOOLCHAIN_PATH": "c:\\Users\\N\\ncs\\v1.5.0\\toolchain\\opt",
          "ZEPHYR_TOOLCHAIN_VARIANT": "gnuarmemb",
          "PYTHONPATH": "c:\\Users\\N\\ncs\\v1.5.0\\toolchain\\opt\\bin;c:\\Users\\N\\ncs\\v1.5.0\\toolchain\\opt\\bin\\Lib;c:\\Users\\N\\ncs\\v1.5.0\\toolchain\\opt\\bin\\Lib\\site-packages",
          "Python3_ROOT": "c:\\Users\\N\\ncs\\v1.5.0\\toolchain\\opt\\bin"
        },
        "toolchainPath": "c:\\Users\\N\\ncs\\v1.5.0\\toolchain",
        "toolchainBinPath": "c:\\Users\\N\\ncs\\v1.5.0\\toolchain\\opt\\bin",
        "toolchainVersion": "1.5.0"
      },
      "terminal": {
        "shell": null,
        "defaultProfile": null
      }
    }
    
    

    I think I may have found solution to this problem over the weekend:
    I've changed the following settings:

    Intelli Sense Mode: windows-gcc-arm

    and after reloading the window, the problem disappeared.

  • Hi

    Good job on finding a solution!

    An additional solution could be the following:
    (DISCLAIMER: The error is likely due to an error during the install of nRF Connect for Visual Studio Code. The fix explained here is a temporary fix, and does not fix the root cause. In later versions of nRF connect for Visual Studio Code, when this have been resolved, it would be a good idea to undo this temporary fix.)

    If the include path is not set in VS Code C/C++, you can not use "go to declaration" among other functionalities:
    To fix it, go to the VS Code settings, find C/C++ "includePath", and add the path to directories you want to add.
    For example: "C:\Users\username\ncs\v1.7.0\**"
    ("**" is to include all sub-directories.)

    Also see this StackOverflow post.

    Regards,
    Sigurd Hellesvik

Reply
  • Hi

    Good job on finding a solution!

    An additional solution could be the following:
    (DISCLAIMER: The error is likely due to an error during the install of nRF Connect for Visual Studio Code. The fix explained here is a temporary fix, and does not fix the root cause. In later versions of nRF connect for Visual Studio Code, when this have been resolved, it would be a good idea to undo this temporary fix.)

    If the include path is not set in VS Code C/C++, you can not use "go to declaration" among other functionalities:
    To fix it, go to the VS Code settings, find C/C++ "includePath", and add the path to directories you want to add.
    For example: "C:\Users\username\ncs\v1.7.0\**"
    ("**" is to include all sub-directories.)

    Also see this StackOverflow post.

    Regards,
    Sigurd Hellesvik

Children
  • I'm sorry, but I can't access this link.

    Could you help me with that? This is the message that I get:

    Also, I can confirm that I didn't have further problems with this.

    After adding a new build configuration or after opening VS Code for the first time, I sometimes get the same problem, but all I do is "Reload Window" and I guess it reloads these dependencies also.  

  • Hi

    My bad. Thank you for pointing out that the link is void.
    I have now edited the last comment do describe an alternative fix for the includePath issue, both for you, and for others who find this later.

    Regards,
    Sigurd Hellesvik

Related