nRF Connect on VSCode unable to build applicatios

Hello All,

I'm new to using Nordic development kit and VSCode but I am running into an issue when I am trying to build a sample application. When I use the template to create an application nothing appears on the application layer as shown in this youtube video: https://www.youtube.com/watch?v=3yi6kuxgdPg&ab_channel=NordicSemiconductor. I notice I get some errors when after the source files have been created. I have been trying to resolve this issue for a few weeks now but I am unable to make any progress. Any guidance is greatly appreciated.

Errors:

  • CMake Error at C:/Users/Sam/ncs/v1.8.0/zephyr/cmake/extensions.cmake:2413 (message):BOARD is not being defined on the CMake command-line in the environment or
    by the app.
  • I believe the main.c errors are due to the CMake error.

Equipment:

  • nRF52840-DK (PCA10056 2.0.2)
  • Toolchain v1.8.0
  • Windows 10, 64-bit operating system, x64-based processor

Thank you

  • Hi,

    Do you have the CMake Tools extension installed? It might cause issues with Zephyr's build system, so please try disabling it and see if you still get the same issue.

    Best regards,

    Marte

  • Hello Marte,

    I tried removing the extension but that didn't resolve the issue.

    Thank you,

    Sam Mathew

  • Hi,

    Can you upload the support information from VS Code? To get it open Command Palette and write nRF Connect: Generate Support Information. The information will be generated in the output terminal. Copy it and upload it here with Insert > Code.

    Best regards,

    Marte

  • Here is the output:

    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.64.2",
        "electron": "13.5.2",
        "node": "v14.16.0"
      },
      "system": {
        "date": "2022-02-19T01:46:18.827Z",
        "vscodeRoot": "c:\\Users\\Sam\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app",
        "nrfConnectForDesktopInstalled": true,
        "vscodeUptime": "63:05:53",
        "osUptime": "590:00:25",
        "cpu": {
          "model": "Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz",
          "speed": "1800 MHz",
          "count": 4
        },
        "memory": {
          "total": "7.92 GB",
          "free": "1.35 GB"
        }
      },
      "workspace": {
        "name": "Untitled (Workspace)",
        "workspaceFile": "1642962931813",
        "folders": [
          "c:\\Users\\Sam\\Documents\\5ense\\Fitness-BLE\\blinky",
          "c:\\Users\\Sam\\Documents\\5ense\\Fitness-BLE\\central_uart"
        ]
      },
      "extensions": {
        "internal": {
          "nordic-semiconductor.nrf-connect": {
            "version": "2022.1.192",
            "path": "c:\\Users\\Sam\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2022.1.192",
            "isActive": true
          },
          "nordic-semiconductor.nrf-terminal": {
            "version": "2022.1.30",
            "path": "c:\\Users\\Sam\\.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.9.0",
          "ms-vscode-remote.remote-wsl-recommender": "0.0.12",
          "ms-vscode.js-debug": "1.64.3",
          "ms-vscode.js-debug-companion": "1.0.15",
          "ms-vscode.references-view": "0.0.81",
          "ms-vscode.vscode-js-profile-table": "0.0.18",
          "cschlosser.doxdocgen": "1.3.2",
          "jeff-hykin.better-cpp-syntax": "1.15.13",
          "ms-vscode-remote.remote-containers": "0.217.4",
          "ms-vscode-remote.remote-ssh": "0.74.0",
          "ms-vscode-remote.remote-wsl": "0.64.2",
          "ms-vscode.cpptools-extension-pack": "1.1.0",
          "ms-vscode.cpptools-themes": "1.0.0",
          "trond-snekvik.gnu-mapfiles": "1.1.0",
          "twxs.cmake": "0.0.17"
        }
      },
      "tools": {
        "C:\\Program Files (x86)\\SEGGER\\JLink\\JLink.exe": "7.58b",
        "C:\\Program Files (x86)\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\nrfjprog.exe": "10.15.2",
        "c:\\Users\\Sam\\ncs\\v1.8.0\\toolchain\\opt\\bin\\cmake.exe": "3.20.5",
        "c:\\Users\\Sam\\ncs\\v1.8.0\\toolchain\\opt\\bin\\Scripts\\west.exe": "0.12.0",
        "c:\\Users\\Sam\\ncs\\v1.8.0\\toolchain\\opt\\bin\\python.exe": "3.8.2",
        "c:\\Users\\Sam\\ncs\\v1.8.0\\toolchain\\opt\\bin\\ninja.exe": "1.9.0",
        "c:\\Users\\Sam\\ncs\\v1.8.0\\toolchain\\opt\\bin\\gperf.exe": "3.1",
        "c:\\Users\\Sam\\ncs\\v1.8.0\\toolchain\\opt\\bin\\dtc.exe": "1.4.7",
        "c:\\Users\\Sam\\ncs\\v1.8.0\\toolchain\\opt\\bin\\arm-none-eabi-gcc.exe": "9-2019-q4-major",
        "c:\\Users\\Sam\\ncs\\v1.8.0\\toolchain\\opt\\bin\\gn.exe": "1959",
        "c:\\Users\\Sam\\ncs\\v1.8.0\\toolchain\\mingw64\\bin\\git.exe": "2.26.2.windows.1"
      },
      "connectedDevices": [
        {
          "id": "683360999"
        }
      ],
      "config": {
        "nordic-semiconductor.nrf-connect": {
          "topdir": "${nrf-connect.sdk:1.8.0}",
          "toolchain": {
            "path": "${nrf-connect.toolchain:1.8.0}"
          },
          "ozonePath": "",
          "applications": [
            "c:\\Users\\Sam\\Documents\\5ense\\Nordic_BLE\\central",
            "c:\\Users\\Sam\\Documents\\5ense\\Nordic-BLE-Fitness\\central",
            "c:\\Users\\Sam\\Documents\\5ense\\BLE_Fitness_Connect\\central",
            "c:\\Users\\Sam\\Documents\\5ense\\Fitness_BLE_Connect\\hello_world",
            "c:\\Users\\Sam\\Documents\\5ense\\Fitness-BLE\\central",
            "c:\\Users\\Sam\\Documents\\5ense\\Fitness-BLE\\central_and_peripheral_hr",
            "c:\\Users\\Sam\\Documents\\5ense\\Fitness-BLE\\nrf_desktop",
            "${workspaceFolder:thermometer}",
            "c:\\Users\\Sam\\Documents\\5ense\\Fitness-BLE\\Test-1\\central",
            "c:\\Users\\Sam\\ncs\\v1.8.0\\WS_BLE\\hello_world",
            "${workspaceFolder:blinky}",
            "c:\\Users\\Sam\\Documents\\5ense\\Fitness-BLE\\capture",
            "c:\\Users\\Sam\\Documents\\5ense\\Fitness-BLE\\blinky",
            "c:\\Users\\Sam\\Documents\\5ense\\Fitness-BLE\\central_uart"
          ],
          "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": "",
          "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": "c:\\Users\\Sam\\ncs\\v1.8.0\\toolchain\\opt\\bin\\Scripts\\west.exe",
        "westEnv": {
          "ELECTRON_RUN_AS_NODE": "1",
          "HOME": "C:\\Users\\Sam",
          "HOMEDRIVE": "C:",
          "HOMEPATH": "\\Users\\Sam",
          "Path": "c:\\Users\\Sam\\ncs\\v1.8.0\\toolchain\\mingw64\\bin;c:\\Users\\Sam\\ncs\\v1.8.0\\toolchain\\mingw64\\libexec\\git-core;c:\\Users\\Sam\\ncs\\v1.8.0\\toolchain\\opt\\bin;c:\\Users\\Sam\\ncs\\v1.8.0\\toolchain\\opt\\bin\\Scripts;C:\\Program Files\\Microsoft\\jdk-11.0.12.7-hotspot\\bin;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files\\PuTTY\\;C:\\Users\\Sam\\AppData\\Local\\Programs\\Python\\Python39;C:\\Program Files\\Microsoft SQL Server\\150\\Tools\\Binn\\;C:\\Program Files\\Git\\cmd;C:\\Program Files\\Microsoft SQL Server\\Client SDK\\ODBC\\170\\Tools\\Binn\\;C:\\Program Files\\dotnet\\;C:\\Program Files (x86)\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Program Files\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Users\\Sam\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\Sam\\AppData\\Local\\Programs\\Python\\Python39;C:\\Users\\Sam\\AppData\\Local\\Programs\\Python\\Python39\\Scripts;C:\\Users\\Sam\\.dotnet\\tools;C:\\Users\\Sam\\AppData\\Local\\Programs\\Microsoft VS Code\\bin",
          "ZEPHYR_BASE": "c:\\Users\\Sam\\ncs\\v1.8.0\\zephyr",
          "GNUARMEMB_TOOLCHAIN_PATH": "c:\\Users\\Sam\\ncs\\v1.8.0\\toolchain\\opt",
          "ZEPHYR_TOOLCHAIN_VARIANT": "gnuarmemb",
          "PYTHONPATH": "c:\\Users\\Sam\\ncs\\v1.8.0\\toolchain\\opt\\bin;c:\\Users\\Sam\\ncs\\v1.8.0\\toolchain\\opt\\bin\\Lib;c:\\Users\\Sam\\ncs\\v1.8.0\\toolchain\\opt\\bin\\Lib\\site-packages",
          "Python3_ROOT": "c:\\Users\\Sam\\ncs\\v1.8.0\\toolchain\\opt\\bin"
        },
        "toolchainPath": "c:\\Users\\Sam\\ncs\\v1.8.0\\toolchain",
        "toolchainBinPath": "c:\\Users\\Sam\\ncs\\v1.8.0\\toolchain\\opt\\bin",
        "toolchainVersion": "1.8.0"
      },
      "terminal": {
        "shell": null,
        "defaultProfile": null
      }
    }

  • Hi,

    The path to the applications are there, so they should have shown up in the 'Application' tab. I also do not see any issues with the tools or versions.

    Can you try uninstalling nRF Connect SDK and installing it directly under your C:\ directory, e.g. C:\ncs\v1.8.0? There is an issue with path length on Windows, so if the path to the SDK installation is long, such as under C:\Users\<username\..., then it can cause problems when building.

    For the applications they should show up already, but you can try to add them manually in settings. Go to settings and select 'Workspace', then go to 'Extensions' > 'nRF Connect'. Try to add the path to your applications under 'Applications'.

    Best regards,

    Marte

Related