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

The toolchain is unable to build a dummy C file when building project with toolchain manager install

I've been trying to build blinky using the nRF SDK from the toolchain manager with no success on windows 10. I've previously been able to build projects so I'm not entirely sure what is causing this issue.  

I'm using the nRF connect VSCode extensions, the behavior is the same with Segger embedded studio.


Things I've tried:

- Clearing the cache (ncs\SDK_VERSION\zephyr\.cache)
- Fresh install of both nRF connect & SDK/toolchain (Uninstall connect, delete ncs, .nrf-connectapps & appdata, reinstalling VSCode extensions)
- SDK versions 1.7.0, 1.7.1 & 1.6.0
- Using an older version of CMake (3.17)
- Deleting build folder & using pristine build w/ VSCode 
- Error is the same with or without nRF connect command line tools

On trying to compile the blinky example (zephyr\samples\basic\blinky) to the board  actinius_icarus_ns (i've tried others e.g thingy:91 -- no success) the following error is thrown: 

CMake Error at c:\Users\USERNAME\Documents\ncs\v1.6.0\zephyr\samples\cmake\extensions.cmake:1746 (message):
  Assertion failed: The toolchain is unable to build a dummy C file.  See
  CMakeError.log.
Call Stack (most recent call first):
  c:\Users\USERNAME\Documents\ncs\v1.6.0\zephyr\samples\CMakeLists.txt:42 (assert)


I've attached the full build log:

 

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

Building blinky
west build --build-dir c:\Users\USERNAME\Documents\ncs\v1.6.0\zephyr\samples\basic\blinky\build c:\Users\USERNAME\Documents\ncs\v1.6.0\zephyr\samples\basic\blinky --pristine --board actinius_icarus_ns -- -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=On -DNCS_TOOLCHAIN_VERSION:STRING="NONE" -DCONF_FILE:STRING="c:/Users/USERNAME/Documents/ncs/v1.6.0/zephyr/samples/basic/blinky/prj.conf"

-- west build: generating a build system
Including boilerplate (Zephyr base): C:/Users/USERNAME/Documents/ncs/v1.6.0/zephyr/cmake/app/boilerplate.cmake
-- Application: C:/Users/USERNAME/Documents/ncs/v1.6.0/zephyr/samples/basic/blinky
-- Zephyr version: 2.6.0-rc1 (C:/Users/USERNAME/Documents/ncs/v1.6.0/zephyr), build: v2.6.0-rc1-ncs1
-- Found Python3: C:/Users/USERNAME/Documents/ncs/v1.6.0/toolchain/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter 
-- Found west (found suitable version "0.11.0", minimum required is "0.7.1")
-- Board: actinius_icarus_ns
-- Cache files will be written to: C:/Users/USERNAME/Documents/ncs/v1.6.0/zephyr/.cache
-- Found dtc: C:/Users/USERNAME/Documents/ncs/v1.6.0/toolchain/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
-- Found toolchain: gnuarmemb (c:/Users/USERNAME/Documents/ncs/v1.6.0/toolchain/opt)
-- Found BOARD.dts: C:/Users/USERNAME/Documents/ncs/v1.6.0/zephyr/boards/arm/actinius_icarus/actinius_icarus_ns.dts
-- Generated zephyr.dts: C:/Users/USERNAME/Documents/ncs/v1.6.0/zephyr/samples/basic/blinky/build/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: C:/Users/USERNAME/Documents/ncs/v1.6.0/zephyr/samples/basic/blinky/build/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: C:/Users/USERNAME/Documents/ncs/v1.6.0/zephyr/samples/basic/blinky/build/zephyr/include/generated/device_extern.h
Parsing C:/Users/USERNAME/Documents/ncs/v1.6.0/zephyr/Kconfig
Loaded configuration 'C:/Users/USERNAME/Documents/ncs/v1.6.0/zephyr/boards/arm/actinius_icarus/actinius_icarus_ns_defconfig'
Merged configuration 'c:/Users/USERNAME/Documents/ncs/v1.6.0/zephyr/samples/basic/blinky/prj.conf'
Configuration saved to 'C:/Users/USERNAME/Documents/ncs/v1.6.0/zephyr/samples/basic/blinky/build/zephyr/.config'
Kconfig header saved to 'C:/Users/USERNAME/Documents/ncs/v1.6.0/zephyr/samples/basic/blinky/build/zephyr/include/generated/autoconf.h'
-- The C compiler identification is GNU 9.2.1
-- The CXX compiler identification is GNU 9.2.1
-- The ASM compiler identification is GNU
-- Found assembler: C:/Users/USERNAME/Documents/ncs/v1.6.0/toolchain/opt/bin/arm-none-eabi-gcc.exe
CMake Error at c:\Users\USERNAME\Documents\ncs\v1.6.0\zephyr\samples\cmake\extensions.cmake:1746 (message):
  Assertion failed: The toolchain is unable to build a dummy C file.  See
  CMakeError.log.
Call Stack (most recent call first):
  c:\Users\USERNAME\Documents\ncs\v1.6.0\zephyr\samples\CMakeLists.txt:42 (assert)


-- Configuring incomplete, errors occurred!
See also "C:/Users/USERNAME/Documents/ncs/v1.6.0/zephyr/samples/basic/blinky/build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/USERNAME/Documents/ncs/v1.6.0/zephyr/samples/basic/blinky/build/CMakeFiles/CMakeError.log".
FATAL ERROR: command exited with status 1: 'c:\Users\USERNAME\Documents\ncs\v1.6.0\toolchain\opt\bin\cmake.EXE' '-DWEST_PYTHON=c:\Users\USERNAME\Documents\ncs\v1.6.0\toolchain\opt\bin\python.exe' '-Bc:\Users\USERNAME\Documents\ncs\v1.6.0\zephyr\samples\basic\blinky\build' '-Sc:\Users\USERNAME\Documents\ncs\v1.6.0\zephyr\samples\basic\blinky' -GNinja -DBOARD=actinius_icarus_ns -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=On -DNCS_TOOLCHAIN_VERSION:STRING=NONE -DCONF_FILE:STRING=c:/Users/USERNAME/Documents/ncs/v1.6.0/zephyr/samples/basic/blinky/prj.conf
The terminal process terminated with exit code: 1.

Just wondering if maybe someone has experienced a similar issue? There is old threads with the same error but it seems to be a solved issue & none of the fixes are working (at least for me)


Thanks

  • Hello, 

    Looking at the log output you have attached, the path of nRF Connect SDK (NCS) is fairly long. How long is the username? Please try moving the NCS folder to e.g. C:\NCS\v1.6.0

    Kind regards,
    Øyvind

  • Thanks for the quick response 

    I've just tried this now sadly no success. Same error.

    Matt

    Terminal will be reused by tasks, press any key to close it.
    
    > Executing task: nRF Connect: Generate config actinius_icarus_ns for c:\ncs\v1.6.0\zephyr\samples\basic\blinky <
    
    Building blinky
    west build --build-dir c:\ncs\v1.6.0\zephyr\samples\basic\blinky\build_2 c:\ncs\v1.6.0\zephyr\samples\basic\blinky --pristine --board actinius_icarus_ns -- -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=On -DNCS_TOOLCHAIN_VERSION:STRING="NONE"
    
    -- west build: generating a build system
    Including boilerplate (Zephyr base): C:/ncs/v1.6.0/zephyr/cmake/app/boilerplate.cmake
    -- Application: C:/ncs/v1.6.0/zephyr/samples/basic/blinky
    -- Zephyr version: 2.6.0-rc1 (C:/ncs/v1.6.0/zephyr), build: v2.6.0-rc1-ncs1
    -- Found Python3: C:/ncs/v1.6.0/toolchain/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter 
    -- Found west (found suitable version "0.11.0", minimum required is "0.7.1")
    -- Board: actinius_icarus_ns
    -- Cache files will be written to: C:/ncs/v1.6.0/zephyr/.cache
    -- Found dtc: C:/ncs/v1.6.0/toolchain/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found toolchain: gnuarmemb (c:/ncs/v1.6.0/toolchain/opt)
    -- Found BOARD.dts: C:/ncs/v1.6.0/zephyr/boards/arm/actinius_icarus/actinius_icarus_ns.dts
    -- Generated zephyr.dts: C:/ncs/v1.6.0/zephyr/samples/basic/blinky/build_2/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: C:/ncs/v1.6.0/zephyr/samples/basic/blinky/build_2/zephyr/include/generated/devicetree_unfixed.h
    -- Generated device_extern.h: C:/ncs/v1.6.0/zephyr/samples/basic/blinky/build_2/zephyr/include/generated/device_extern.h
    Parsing C:/ncs/v1.6.0/zephyr/Kconfig
    Loaded configuration 'C:/ncs/v1.6.0/zephyr/boards/arm/actinius_icarus/actinius_icarus_ns_defconfig'
    Merged configuration 'C:/ncs/v1.6.0/zephyr/samples/basic/blinky/prj.conf'
    Configuration saved to 'C:/ncs/v1.6.0/zephyr/samples/basic/blinky/build_2/zephyr/.config'
    Kconfig header saved to 'C:/ncs/v1.6.0/zephyr/samples/basic/blinky/build_2/zephyr/include/generated/autoconf.h'
    -- The C compiler identification is GNU 9.2.1
    -- The CXX compiler identification is GNU 9.2.1
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/ncs/v1.6.0/toolchain/opt/bin/arm-none-eabi-gcc.exe
    CMake Error at c:\ncs\v1.6.0\zephyr\samples\cmake\extensions.cmake:1746 (message):
      Assertion failed: The toolchain is unable to build a dummy C file.  See
      CMakeError.log.
    Call Stack (most recent call first):
      c:\ncs\v1.6.0\zephyr\samples\CMakeLists.txt:42 (assert)
    
    
    -- Configuring incomplete, errors occurred!
    See also "C:/ncs/v1.6.0/zephyr/samples/basic/blinky/build_2/CMakeFiles/CMakeOutput.log".
    See also "C:/ncs/v1.6.0/zephyr/samples/basic/blinky/build_2/CMakeFiles/CMakeError.log".
    FATAL ERROR: command exited with status 1: 'c:\ncs\v1.6.0\toolchain\opt\bin\cmake.EXE' '-DWEST_PYTHON=c:\ncs\v1.6.0\toolchain\opt\bin\python.exe' '-Bc:\ncs\v1.6.0\zephyr\samples\basic\blinky\build_2' '-Sc:\ncs\v1.6.0\zephyr\samples\basic\blinky' -GNinja -DBOARD=actinius_icarus_ns -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=On -DNCS_TOOLCHAIN_VERSION:STRING=NONE
    The terminal process terminated with exit code: 1.
    
    

  • I'm not able to reproduce on my side, building zephyr\samples\basic\blinky for actinius_icarus_ns. What version of Windows, VS Code extension, and Toolchain Manager are you running? Do you get the same when building with west in command line? Are you opening VS code from the Toolchain Manager?

    In VS Code please run the "nRF Connect: Generate support information" command (Ctrl + Shift + P).

    Kind regards,
    Øyvind

  • Sure thing,

    nRF Connect v3.7.1
    Toolchain manager: 0.10.0

    I'm opening vscode from the toolchain manager and I do get the same error when building from west.

    I've hidden some things from the output but this is what it produces

    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.62.0",
        "electron": "13.5.1",
        "node": "v14.16.0"
      },
      "system": {
        "date": "2021-11-09T01:40:56.805Z",
        "vscodeRoot": "c:\\Users\\USERNAME\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app",
        "nrfConnectForDesktopInstalled": false,
        "vscodeUptime": "00:02:04",
        "osUptime": "24:26:38",
        "cpu": {
          "model": "Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz",
          "speed": "1992 MHz",
          "count": 4
        },
        "memory": {
          "total": "7.81 GB",
          "free": "1.00 GB"
        }
      },
      "workspace": {
        "name": "Untitled (Workspace)",
        "workspaceFile": "1636421811573",
        "folders": [
          "c:\\Users\\USERNAME\\Documents\\dev\\nrf-tests\\test\\test"
        ]
      },
      "extensions": {
        "internal": {
          "nordic-semiconductor.nrf-connect": {
            "version": "2021.11.109",
            "path": "c:\\Users\\USERNAME\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2021.11.109",
            "isActive": true
          },
          "nordic-semiconductor.nrf-terminal": {
            "version": "2021.11.7",
            "path": "c:\\Users\\USERNAME\\.vscode\\extensions\\nordic-semiconductor.nrf-terminal-2021.11.7",
            "isActive": true
          },
          "nordic-semiconductor.devicetree": null,
          "nordic-semiconductor.kconfig": null
        },
        "external": {
          "marus25.cortex-debug": "0.4.7",
          "ms-vscode.cpptools": "1.7.1",
          "ms-vscode-remote.remote-wsl-recommender": "0.0.12",
          "ms-vscode.js-debug": "1.62.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",
          "burkeholland.simple-react-snippets": "1.2.4",
          "cschlosser.doxdocgen": "1.3.2",
          "eg2.vscode-npm-script": "0.3.23",
          "esbenp.prettier-vscode": "9.0.0",
          "GitHub.github-vscode-theme": "5.0.3",
          "GitHub.vscode-pull-request-github": "0.32.0",
          "golang.go": "0.29.0",
          "GraphQL.vscode-graphql": "0.3.18",
          "igorming.useful-react-snippets": "3.0.0",
          "ms-azuretools.vscode-docker": "1.17.0",
          "ms-python.python": "2021.11.1422169775",
          "ms-python.vscode-pylance": "2021.11.0",
          "ms-toolsai.jupyter": "2021.10.1001414422",
          "ms-toolsai.jupyter-keymap": "1.0.0",
          "ms-toolsai.jupyter-renderers": "1.0.3",
          "ms-vscode-remote.remote-containers": "0.205.1",
          "ms-vscode-remote.remote-ssh": "0.66.0",
          "ms-vscode-remote.remote-ssh-edit": "0.66.0",
          "ms-vscode-remote.remote-wsl": "0.58.5",
          "ms-vscode.cpptools-extension-pack": "1.0.0",
          "ms-vscode.cpptools-themes": "1.0.0",
          "Prisma.prisma": "3.4.1",
          "searKing.preview-vscode": "2.2.5",
          "shyykoserhiy.vscode-spotify": "3.2.1",
          "tomoki1207.pdf": "1.1.0",
          "trond-snekvik.gnu-mapfiles": "1.1.0",
          "twxs.cmake": "0.0.17"
        }
      },
      "tools": {
        "C:\\Program Files (x86)\\SEGGER\\JLink\\JLink.exe": "6.88a",
        "C:\\Program Files (x86)\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\nrfjprog.exe": "10.15.0",
        "c:\\ncs\\v1.6.0\\toolchain\\opt\\bin\\cmake.exe": "3.17.3",
        "c:\\ncs\\v1.6.0\\toolchain\\opt\\bin\\Scripts\\west.exe": "0.11.0",
        "c:\\ncs\\v1.6.0\\toolchain\\opt\\bin\\python.exe": "3.8.2",
        "c:\\ncs\\v1.6.0\\toolchain\\opt\\bin\\ninja.exe": "1.9.0",
        "c:\\ncs\\v1.6.0\\toolchain\\opt\\bin\\gperf.exe": "3.1",
        "c:\\ncs\\v1.6.0\\toolchain\\opt\\bin\\dtc.exe": "1.4.7",
        "c:\\ncs\\v1.6.0\\toolchain\\opt\\bin\\arm-none-eabi-gcc.exe": "9-2019-q4-major",
        "c:\\ncs\\v1.6.0\\toolchain\\opt\\bin\\gn.exe": "1921"
      },
      "connectedDevices": [],
      "config": {
        "nordic-semiconductor.nrf-connect": {
          "topdir": "${nrf-connect.sdk:1.6.0}",
          "toolchain": {
            "path": "${nrf-connect.toolchain:1.6.0}"
          },
          "ozonePath": "",
          "applications": [
            "${workspaceFolder}"
          ],
          "jlink": {
            "rtosPlugin": ""
          },
          "kconfig": {
            "interface": "guiconfig"
          },
          "welcome": {
            "showOnStartup": true
          },
          "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": ""
          }
        },
        "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:\\ncs\\v1.6.0\\toolchain\\opt\\bin\\Scripts\\west.exe",
        "westEnv": {
          "ELECTRON_RUN_AS_NODE": "1",
          "HOMEDRIVE": "C:",
          "HOMEPATH": "\\Users\\USERNAME",
          "Path": "c:\\ncs\\v1.6.0\\toolchain\\mingw64\\bin;c:\\ncs\\v1.6.0\\toolchain\\mingw64\\libexec\\git-core;c:\\ncs\\v1.6.0\\toolchain\\opt\\bin;c:\\ncs\\v1.6.0\\toolchain\\opt\\bin\\Scripts;C:\\Program Files\\Common Files\\Oracle\\Java\\javapath;C:\\WinAVR-20100110\\bin;C:\\WinAVR-20100110\\utils\\bin;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\iCLS\\;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\iCLS\\;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:\\ProgramData\\chocolatey\\bin;C:\\Go\\bin;C:\\Program Files (x86)\\PuTTY\\;C:\\Program Files\\Docker\\Docker\\resources\\bin;C:\\ProgramData\\DockerDesktop\\version-bin;C:\\Program Files\\Ampps\\php-7.3;C:\\ProgramData\\ComposerSetup\\bin;C:\\Program Files (x86)\\PDFtk\\bin\\;C:\\Program Files (x86)\\Yarn\\bin\\;C:\\Program Files (x86)\\GnuPG\\bin;C:\\Program Files\\nodejs\\;C:\\Program Files\\Git\\cmd;C:\\gn;C:\\Program Files\\CMake\\bin;C:\\Program Files (x86)\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Users\\USERNAME\\AppData\\Local\\Programs\\Python\\Python39;C:\\Users\\USERNAME\\AppData\\Local\\Programs\\Python\\Python39\\Scripts;C:\\Users\\USERNAME\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\USERNAME\\go\\bin;C:\\Users\\USERNAME\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\Users\\USERNAME\\AppData\\Local\\Yarn\\bin;C:\\Users\\USERNAME\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\USERNAME\\AppData\\Roaming\\npm;",
          "ZEPHYR_BASE": "c:\\ncs\\v1.6.0\\zephyr",
          "GNUARMEMB_TOOLCHAIN_PATH": "c:\\ncs\\v1.6.0\\toolchain\\opt",
          "ZEPHYR_TOOLCHAIN_VARIANT": "gnuarmemb",
          "PYTHONPATH": "c:\\ncs\\v1.6.0\\toolchain\\opt\\bin;c:\\ncs\\v1.6.0\\toolchain\\opt\\bin\\Lib;c:\\ncs\\v1.6.0\\toolchain\\opt\\bin\\Lib\\site-packages",
          "Python3_ROOT": "c:\\ncs\\v1.6.0\\toolchain\\opt\\bin"
        },
        "toolchainPath": "c:\\ncs\\v1.6.0\\toolchain",
        "toolchainBinPath": "c:\\ncs\\v1.6.0\\toolchain\\opt\\bin",
        "toolchainVersion": "1.6.0"
      },
      "terminal": {
        "shell": "C:\\Program Files\\Git\\bin\\bash.exe",
        "defaultProfile": null
      }
    }

    EDIT: Reinstalled extensions



    Thanks,
    Matt

    EDIT: 

    Weirdly, and I don't know if this is related. In the output tab in VSCode (terminal pane) under C/C++ Configuration warnings this error is present:

    [9/11/2021, 2:13:04 pm] Unable to resolve configuration with compilerPath "c:\ncs\v1.6.0\zephyr\samples\basic\blinky\${nrf-connect.toolchain:1.7.0}\opt\bin\arm-none-eabi-gcc.exe".  Using "cl.exe" instead.
    [9/11/2021, 2:13:04 pm] Unable to resolve configuration with compilerPath "c:\ncs\v1.6.0\zephyr\samples\basic\blinky\${nrf-connect.toolchain:1.7.0}\opt\bin\arm-none-eabi-gcc.exe".  Using "cl.exe" instead.

  • Hello again, and thanks for providing this information. The VS Code team do not understand why you are getting the last message/warning, as it seems to use 1.7.0. When shortening the path, as I suggested, how did you do so? 

    Could you please provide the CmakeError.log? " Assertion failed: The toolchain is unable to build a dummy C file. See CMakeError.log."

Related