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.

  • 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

Reply
  • 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

Children
  • 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

  • No errors it just builds and stops

    this happens with flash and erase and flash. It does not seem to go into the next step of the process after build.

    Building HID_device
    west build --build-dir d:\my_vscode_apps\HID_RGB_gambling\HID_device\build d:\my_vscode_apps\HID_RGB_gambling\HID_device

    [1/11] Building C object CMakeFiles/app.dir/src/main.c.obj
    [2/11] Linking C static library app\libapp.a
    [3/11] Linking C executable zephyr\zephyr_pre0.elf

    [4/11] Generating dev_handles.c
    [5/11] Building C object zephyr/CMakeFiles/zephyr_pre1.dir/dev_handles.c.obj
    [6/11] Linking C executable zephyr\zephyr_pre1.elf

    [7/11] Generating linker.cmd
    [8/11] Generating isr_tables.c, isrList.bin
    [9/11] Building C object zephyr/CMakeFiles/zephyr_final.dir/isr_tables.c.obj
    [10/11] Building C object zephyr/CMakeFiles/zephyr_final.dir/dev_handles.c.obj
    [11/11] Linking C executable zephyr\zephyr.elf
    Memory region Used Size Region Size %age Used
    FLASH: 178580 B 1 MB 17.03%
    SRAM: 38225 B 256 KB 14.58%
    IDT_LIST: 0 GB 2 KB 0.00%

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

  • Hi,

    Try to remove current build configuration and build folder, restart the VS Code, add build configuration for your board, and do pristine build. If everything is successful, press flash button. Ensure that the board is connected and that you are flashing the right board. 
    Instead of using west, please use buttons from VS Code for building the application.
    If there are some errors, please provide the output and specify where the errors appear.

    Best regards,
    Dejan

  • Removed the current build , folder also removed. Prestine build from action center in vscode works and then stops. no flashing.

    I only have the one 52840dk board which is linked to the board. under connected devices I can reset the board, recover it and connect it to RTT.

Related