This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
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

Debug session fails to run Zephyr blinky sample in VSCode with nRF Connect

Hello,

I'm trying out nRF Connect running inside VS Code and I'm running into issues debuggin my code.  I followed the Nordic setup tutorial and installed the latest nRF Connect SDK, then nRF Command Line Tools with Segger Tools, Visual Studio Code and finally added the nRF Connect extension package (Cortex-Debug,  NRF Connect, nRF Kconfig etc.).  I then created an application as directed, and then a build configuration with debug options enabled.  I then built the application and flashed my board (Thingy:52) and saw the LED blink on my development board.  Up till this point everything worked great, then I tried hitting the debug button under the action menu and received the following error below:

I also tried building, downloading code and debugging in the Segger nRF Connect IDE and everything worked great!  So I assumed my base toolchain is good.  I'm not very experienced with setting up IDEs and based on the tutorial this step should just work without me editing any .jason files etc.  Any obvious things I'm missing?  

Hardware/Software Setup:

OS:  Windows 10

VS Code Version:  1.60.2

nRF Connect SDK Version:  v1.7.0

J-Link Version:  7.54c

Debugger:  j-link segger EDU edtion

Development Board:  Thingy:52

Thanks!

Parker

Parents
  • Hi Parker,

    There is an issue where enabling debug options when generating the build configuration will cause debugging to not work in some cases. This seems to happen with simple examples, such as the Blinky example. Samples that use threads still seem to work with "Enable debug options" checked. Please try to generate the build configuration with "Enable debug options" unchecked.

    You can also try a workaround where you start debugging by Run -> Start Debugging (or pressing F5) instead of starting by clicking the "Debug Application" icon within the nRF Connect for VS Code plugin.

    See the reply from Einar in this comment for more information.

    Please let me know if you are still having this problem after unchecking "Enable debug options" and/or trying the workaround.

    Best regards,

    Marte

  • Hi Marte,

    Thanks for the response.  

    I unchecked the "Enable debug options" for both Blinky and hello_world samples and tried both methods of starting a debug session (pressing debug under nRF Connect action menu and pressing F5).  Pressing the debug button under the action menu fails in the exact same way as my original post, while pressing F5  starts to run but then fails compilation because: "zephyr.h: No such file or directory".  

    It's like the toolchain is setup differently for building before debugging/flashing vs. when compiling/flashing directly from the nRF connect action menu.  

    Thanks,

    Parker

Reply
  • Hi Marte,

    Thanks for the response.  

    I unchecked the "Enable debug options" for both Blinky and hello_world samples and tried both methods of starting a debug session (pressing debug under nRF Connect action menu and pressing F5).  Pressing the debug button under the action menu fails in the exact same way as my original post, while pressing F5  starts to run but then fails compilation because: "zephyr.h: No such file or directory".  

    It's like the toolchain is setup differently for building before debugging/flashing vs. when compiling/flashing directly from the nRF connect action menu.  

    Thanks,

    Parker

Children
  • Hi Parker,

    It looks like an environment issue.

    Could you use the "Generate Support Information" command (Ctrl + P -> nRF Connect: Generate Support Information) and provide details of your environment?

    Did you use the Toolchain Manager, or did you install it manually?

    Is JLink installed in a default or custom location?

    Best regards,

    Marte

  • Hi Marte,

    I agree it's likely an environment issue.  

    Here is my 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.19043",
        "vscode": "1.60.2",
        "electron": "13.1.8",
        "node": "v14.16.0"
      },
      "system": {
        "date": "2021-09-29T20:19:49.181Z",
        "vscodeRoot": "c:\\VSCode\\resources\\app",
        "nrfConnectForDesktopInstalled": true,
        "vscodeUptime": "00:00:16",
        "osUptime": "27:54:49",
        "cpu": {
          "model": "Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz",
          "speed": "1992 MHz",
          "count": 4
        },
        "memory": {
          "total": "15.90 GB",
          "free": "4.12 GB"
        }
      },
      "workspace": {
        "name": "Untitled (Workspace)",
        "workspaceFile": "1632521686317",
        "folders": [
          "c:\\Users\\parke\\Documents\\GitHub\\Software-Design\\CLARI\\Examples\\hello_world",
          "c:\\Users\\parke\\Documents\\GitHub\\Software-Design\\CLARI\\Examples\\Blinky"
        ]
      },
      "extensions": {
        "internal": {
          "nordic-semiconductor.nrf-connect": {
            "version": "2021.9.314",
            "path": "c:\\Users\\parke\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2021.9.314",
            "isActive": true
          },
          "nordic-semiconductor.nrf-terminal": {
            "version": "2021.9.20",
            "path": "c:\\Users\\parke\\.vscode\\extensions\\nordic-semiconductor.nrf-terminal-2021.9.20",
            "isActive": true
          },
          "nordic-semiconductor.devicetree": null,
          "nordic-semiconductor.kconfig": null
        },
        "external": {
          "marus25.cortex-debug": "0.4.6",
          "ms-vscode.cpptools": "1.6.0",
          "ms-vscode-remote.remote-wsl-recommender": "0.0.11",
          "ms-vscode.js-debug": "1.60.2",
          "ms-vscode.js-debug-companion": "1.0.15",
          "ms-vscode.references-view": "0.0.80",
          "ms-vscode.vscode-js-profile-table": "0.0.18",
          "13xforever.language-x86-64-assembly": "3.0.0",
          "akfish.vscode-devdocs": "1.0.3",
          "austin.code-gnu-global": "0.2.2",
          "cschlosser.doxdocgen": "1.3.2",
          "jeff-hykin.better-cpp-syntax": "1.15.10",
          "keroc.hex-fmt": "1.0.0",
          "ms-vscode-remote.remote-containers": "0.194.3",
          "ms-vscode-remote.remote-ssh": "0.65.8",
          "ms-vscode-remote.remote-ssh-edit": "0.65.8",
          "ms-vscode-remote.remote-wsl": "0.58.2",
          "ms-vscode.cmake-tools": "1.8.1",
          "ms-vscode.cpptools-extension-pack": "1.0.0",
          "ms-vscode.cpptools-themes": "1.0.0",
          "ms-vsliveshare.vsliveshare": "1.0.4836",
          "ms-vsliveshare.vsliveshare-audio": "0.1.91",
          "platformio.platformio-ide": "2.3.3",
          "slevesque.vscode-hexdump": "1.8.1",
          "trond-snekvik.gnu-mapfiles": "1.1.0",
          "twxs.cmake": "0.0.17"
        }
      },
      "tools": {
        "jlink": null,
        "nrfjprog": null,
        "cmake": null,
        "west": null,
        "python": null,
        "ninja": null,
        "gperf": null,
        "dtc": null,
        "gnuarmemb": null,
        "gn": null
      },
      "config": {
        "nordic-semiconductor.nrf-connect": {
          "topdir": "c:\\nordicsemi\\v1.7.0",
          "toolchain": {
            "path": "c:\\nordicsemi\\v1.7.0\\toolchain"
          },
          "ozonePath": "",
          "applications": [
            "c:\\Users\\parke\\Documents\\GitHub\\Software-Design\\CLARI\\Example\\Blinky",
            "c:\\Users\\parke\\Documents\\GitHub\\Software-Design\\CLARI\\Examples\\Hello_World!",
            "c:\\Users\\parke\\Documents\\GitHub\\Software-Design\\CLARI\\Examples\\Blinky",
            "c:\\Users\\parke\\Documents\\GitHub\\Software-Design\\CLARI\\Examples\\hello_world"
          ],
          "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": {
              "board": "thingy52_nrf52832",
              "arch": "arm",
              "dir": "c:\\nordicsemi\\v1.7.0\\zephyr\\boards\\arm\\thingy52_nrf52832"
            },
            "west": "c:\\nordicsemi\\v1.7.0\\toolchain\\opt\\bin\\Scripts\\west.exe",
            "base": "c:\\nordicsemi\\v1.7.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:\\nordicsemi\\v1.7.0\\toolchain\\opt\\bin\\Scripts\\west.exe",
        "westEnv": {
          "ELECTRON_RUN_AS_NODE": "1",
          "HOMEDRIVE": "C:",
          "HOMEPATH": "\\Users\\parke",
          "Path": "c:\\nordicsemi\\v1.7.0\\toolchain\\mingw64\\bin;c:\\nordicsemi\\v1.7.0\\toolchain\\mingw64\\libexec\\git-core;c:\\nordicsemi\\v1.7.0\\toolchain\\opt\\bin;c:\\nordicsemi\\v1.7.0\\toolchain\\opt\\bin\\Scripts;C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.1\\bin;C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.1\\libnvvp;C:\\Program Files (x86)\\Razer Chroma SDK\\bin;C:\\Program Files\\Razer Chroma SDK\\bin;C:\\Program Files (x86)\\Razer\\ChromaBroadcast\\bin;C:\\Program Files\\Razer\\ChromaBroadcast\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Users\\Administrator\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Windows\\system32\\config\\systemprofile\\AppData\\Local\\Microsoft\\WindowsApps;C:\\MinGW\\bin;C:\\Program Files\\NVIDIA Corporation\\NVIDIA NvDLISR;C:\\Program Files\\NVIDIA Corporation\\Nsight Compute 2019.4.0\\;C:\\Program Files\\PuTTY\\;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\Program Files\\MATLAB\\R2021a\\bin;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Program Files\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Wincupl\\WINCUPL\\EXE;C:\\Wincupl\\WINCUPL\\FITTERS;C:\\Program Files\\SDCC\\bin;C:\\Users\\parke\\AppData\\Local\\GitHubDesktop\\bin;C:\\Users\\parke\\AppData\\Local\\Microsoft\\WindowsApps;C:\\VSCode\\bin",
          "ZEPHYR_BASE": "c:\\nordicsemi\\v1.7.0\\zephyr",
          "GNUARMEMB_TOOLCHAIN_PATH": "c:\\nordicsemi\\v1.7.0\\toolchain\\opt",
          "ZEPHYR_TOOLCHAIN_VARIANT": "gnuarmemb",
          "PYTHONPATH": "c:\\nordicsemi\\v1.7.0\\toolchain\\opt\\bin;c:\\nordicsemi\\v1.7.0\\toolchain\\opt\\bin\\Lib;c:\\nordicsemi\\v1.7.0\\toolchain\\opt\\bin\\Lib\\site-packages",
          "Python3_ROOT": "c:\\nordicsemi\\v1.7.0\\toolchain\\opt\\bin"
        },
        "toolchainPath": "c:\\nordicsemi\\v1.7.0\\toolchain",
        "toolchainBinPath": "c:\\nordicsemi\\v1.7.0\\toolchain\\opt\\bin",
        "toolchainVersion": "1.7.0"
      },
      "terminal": {
        "shell": null,
        "defaultProfile": null
      }
    }
    
    

    I followed the online tutorial for installing nRF Code in VS Code (nRF Connect for VS Code) which included installing the toolchain manger, the latest nRF Connect SDK, then nRF command line tools, segger tools, installing VS Code and finally the nRF VS Code extensions.  

    I installed JLink to the default location of:  C:\Program Files\SEGGER\JLink

    Cheers,

    Parker

  • Hi Parker,

    Thank you for providing this information. I have reported it internally, and our developers will investigate it.

    Best regards,

    Marte

Related