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

nRF connect with VS code integration problem

HI All

Im having endless trouble with nRf Connect and Vs code. @Ovind was kind enough to assist from the first time I failed to get this working, but it was short lived and I dont understand why im having these issues. I may be missing something.

VS studio not building samples - Nordic Q&A - Nordic DevZone - Nordic DevZone (nordicsemi.com)  - Spent a week, uninstalling, re-installing, it then started working (manage to build and flash about 15 times)

Suddenly after creating a new application, the "application window" disappeared as well as the "connected devices". No matter how many times I added new examples it would not go further after  "create new application from example". The example files can be seen under the explorer but no application window would open for me to add a  build.

After a few uninstall's and re-install's   the "application" window and "connected device " returned after "create new application from example". This time however only Build worked but not the Flash. Error was Ninja: Nothing to do. It would just stop after the build.

I though this can now only be a corrupt windows installation or windows itself. I decided to do a clean windows install on my laptop from scratch not keeping any user files or programs. I redownloaded Vscode, nRF Connect as well as toolchain v1.8,.v1.9, .v1.9.1.  I installed all the extensions (through nRF_Conenct) and open Vs_studio through nRF Connect. 

When I run the Generate support information I can see the "tools" have not been installed.

What am I doing wrong. I reloaded windows twice and installed all the above from scratch at least 5 times to no avail.

Thank you 

{
  "platform": {
    "os": "win32",
    "osVersion": "Windows 10 Pro",
    "osKernel": "10.0.19044",
    "vscode": "1.65.0",
    "electron": "13.5.2",
    "node": "v14.16.0"
  },
  "system": {
    "date": "2022-03-07T08:47:46.976Z",
    "vscodeRoot": "c:\\Users\\meltb\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app",
    "nrfConnectForDesktopInstalled": true,
    "vscodeUptime": "00:21:34",
    "osUptime": "22:57:25",
    "cpu": {
      "model": "Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz",
      "speed": "1800 MHz",
      "count": 4
    },
    "memory": {
      "total": "7.89 GB",
      "free": "1.53 GB"
    }
  },
  "workspace": {
    "name": null,
    "workspaceFile": null,
    "folders": []
  },
  "extensions": {
    "internal": {
      "nordic-semiconductor.nrf-connect": {
        "version": "2022.1.192",
        "path": "c:\\Users\\meltb\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2022.1.192",
        "isActive": true
      },
      "nordic-semiconductor.nrf-terminal": {
        "version": "2022.1.30",
        "path": "c:\\Users\\meltb\\.vscode\\extensions\\nordic-semiconductor.nrf-terminal-2022.1.30",
        "isActive": true
      },
      "nordic-semiconductor.devicetree": null,
      "nordic-semiconductor.kconfig": null
    },
    "external": {
      "marus25.cortex-debug": "1.2.2",
      "ms-vscode.cpptools": "1.8.4",
      "ms-vscode-remote.remote-wsl-recommender": "0.0.14",
      "ms-vscode.js-debug": "1.65.0",
      "ms-vscode.js-debug-companion": "1.0.15",
      "ms-vscode.references-view": "0.0.85",
      "ms-vscode.vscode-js-profile-table": "0.0.18",
      "trond-snekvik.gnu-mapfiles": "1.1.0",
      "twxs.cmake": "0.0.17"
    }
  },
  "tools": {
    "C:\\Program Files\\SEGGER\\JLink\\JLink.exe": "7.62a",
    "C:\\Program Files (x86)\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\nrfjprog.exe": "10.15.4",
    "cmake": "Not found",
    "west": "Not found",
    "C:\\Users\\meltb\\AppData\\Local\\Microsoft\\WindowsApps\\python.exe": null,
    "ninja": "Not found",
    "gperf": "Not found",
    "dtc": "Not found",
    "gnuarmemb": "Not found",
    "gn": "Not found",
    "git": "Not found"
  },
  "connectedDevices": [
    {
      "id": "683015900"
    }
  ],
  "config": {
    "nordic-semiconductor.nrf-connect": {
      "topdir": "",
      "toolchain": {
        "path": ""
      },
      "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": "C:\\Users\\meltb\\ncs\\v1.9.1\\zephyr",
      "ctxFile": "",
      "defaultBoard": ""
    },
    "nordic-semiconductor.kconfig": {
      "root": "",
      "env": {},
      "cfiles": true,
      "disable": false,
      "zephyr": {
        "base": ""
      },
      "python": "",
      "liveValue": true
    },
    "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": "west",
    "westEnv": {
      "ELECTRON_RUN_AS_NODE": "1",
      "HOME": "C:\\Users\\meltb",
      "HOMEDRIVE": "C:",
      "HOMEPATH": "\\Users\\meltb"
    }
  },
  "terminal": {
    "shell": null,
    "defaultProfile": null
  }
}


Parents
  • I have made some progress.

    After installing the toolchains through nRF connect as well as the Vs code extensions. One needs to go to nRF connect welcome page and run "quick setup". Select the toolchain to install. This will take you back to nRF connect. Open Vs code again and the tools now seems to be installed.

    Build is working but but it is not flashing. Terminal below

    > Executing task: nRF Connect: Build hello_world1/build (active) <

    Building hello_world1
    west build --build-dir d:\onedrive\my_vscode_apps\helloworld\hello_world1\build d:\onedrive\my_vscode_apps\helloworld\hello_world1

    ninja: no work to do.

    Terminal will be reused by tasks, press any key to close it.

Reply
  • I have made some progress.

    After installing the toolchains through nRF connect as well as the Vs code extensions. One needs to go to nRF connect welcome page and run "quick setup". Select the toolchain to install. This will take you back to nRF connect. Open Vs code again and the tools now seems to be installed.

    Build is working but but it is not flashing. Terminal below

    > Executing task: nRF Connect: Build hello_world1/build (active) <

    Building hello_world1
    west build --build-dir d:\onedrive\my_vscode_apps\helloworld\hello_world1\build d:\onedrive\my_vscode_apps\helloworld\hello_world1

    ninja: no work to do.

    Terminal will be reused by tasks, press any key to close it.

Children
  • Hi,

    I am glad to hear that you made some progress.

    "Quick Setup" page provides information about the Toolchain which you are using currently. There you should be able to see the location of the nRF Connect SDK and nRF Connect Toolchain.

    With regard to west, you can check the west version by running "west --version" from command line.
    "ninja: no work to do" happens when there is no build.ninja file in your build folder. If you have ninja on your system you should be able to see its version by running "ninja --version" from command prompt inside your application folder.

    Regarding the build command that you want to execute, I would suggest to remove the current build configuration from VS Code as well as the whole build folder from your application folder and try again. You should then be able to build your application successfully. Alternatively, instead of using west and nrfjprog as commands, you could try building and flashing your application from the same page where "Quick Setup" is located, by clicking on "Add Build Configuration", "Build" and "Flash".

    Best regards,
    Dejan

  • Hi Dejans

    Thank you. The examples Builds fine, but does not flash. my versions below

    "tools": {
        "C:\\Program Files\\SEGGER\\JLink\\JLink.exe": "7.62a",
        "C:\\Program Files (x86)\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\nrfjprog.exe": "10.15.4",
        "c:\\Users\\meltb\\ncs\\v1.9.1\\toolchain\\opt\\bin\\cmake.exe": "3.20.5",
        "c:\\Users\\meltb\\ncs\\v1.9.1\\toolchain\\opt\\bin\\Scripts\\west.exe": "0.12.0",
        "c:\\Users\\meltb\\ncs\\v1.9.1\\toolchain\\opt\\bin\\python.exe": "3.8.2",
        "c:\\Users\\meltb\\ncs\\v1.9.1\\toolchain\\opt\\bin\\ninja.exe": "1.9.0",
        "c:\\Users\\meltb\\ncs\\v1.9.1\\toolchain\\opt\\bin\\gperf.exe": "3.1",
        "c:\\Users\\meltb\\ncs\\v1.9.1\\toolchain\\opt\\bin\\dtc.exe": "1.4.7",
        "c:\\Users\\meltb\\ncs\\v1.9.1\\toolchain\\opt\\bin\\arm-none-eabi-gcc.exe": "9-2019-q4-major",
        "c:\\Users\\meltb\\ncs\\v1.9.1\\toolchain\\opt\\bin\\gn.exe": "1977",
        "c:\\Users\\meltb\\ncs\\v1.9.1\\toolchain\\mingw64\\bin\\git.exe": "2.26.2.windows.1"
      },
    Quetion : can you do the quicksetup only once? I see once its done it disappears. 
    I did as you suggested, remove build from project and directory. No difference, it builds  buts thats it.
  • Hi,

    You should do "Quick Setup" only once to choose the folder for NCS and Toolchain. If you have previously installed NCS and Toolchain, locations in "Quick Setup" should be automatically available.

    Have you tried flashing directly from VS Code?
    Have you tried flashing using nrfjprog?
    What is the output result in both above-mentioned  cases? Are there any errors? Can you provide some logs?

    Best regards,
    Dejan

  • I have loaded 2 applications for testing. hello_world and blinky_pmw. They do not flash using the "action flash" menu in VS code. They do however flash using nrfjprog with new terminal inside vs code.

  • Hi,

    Can you share the output that you get after executing "Flash" command from the VS Code? Are you getting any errors?

    Best regards,
    Dejan

Related