nRF5 SDK is not maintained anymore
More Info: Consider nRF Connect SDK for new designs
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:

 

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

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

    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."

  • The ncs folder is now in the root of my C drive (C:/ncs)


    The CMakeError.log:

    Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
    Compiler: C:/ncs/v1.6.0/toolchain/opt/bin/arm-none-eabi-gcc.exe 
    Build flags: 
    Id flags:  
    
    The output was:
    1
    c:/ncs/v1.6.0/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: c:/ncs/v1.6.0/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/lib\libc.a(lib_a-exit.o): in function `exit':
    exit.c:(.text.exit+0x2c): undefined reference to `_exit'
    collect2.exe: error: ld returned 1 exit status
    
    
    Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
    Compiler: C:/ncs/v1.6.0/toolchain/opt/bin/arm-none-eabi-gcc.exe 
    Build flags: 
    Id flags:  
    
    The output was:
    1
    c:/ncs/v1.6.0/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: c:/ncs/v1.6.0/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/lib\libc.a(lib_a-exit.o): in function `exit':
    exit.c:(.text.exit+0x2c): undefined reference to `_exit'
    collect2.exe: error: ld returned 1 exit status
    
    
    

    Matt

  • From the toolchain manager, did you open bash or command prompt and test the west build command there?

    I've previously been able to build projects so I'm not entirely sure what is causing this issue.  

    Has there been any update on your Windows 10 lately? 

    Things I've tried:

    Is this a corporate computer? Are you installing on a corporate network? We have seen that type of issues earlier, just need to verify. Do  you have a anti-virus SW running? If so, is it possible to reinstall NCS with this SW paused? To ensure that the anti-virus is not blocking anything

Related