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

Re-installing nRF Connect SDK

How do I remove nRF Connect SDK from Windows before re-installing?

And are there something that needs to be done, if you have used cmake and Visual Studio Code for other projects?

I installed the tools via nRF Connect Desktop / Toolchain Manager in a project directory, but it looked like the paths got too long. Then I uninstalled the stuff via nRF Connect Desktop / Toolchain Manager, uninstalled the nRF Connect Desktop, removed the stuff from the project directory and rebooted. Then I re-installed everything at C:/ncs, but when I try to do something, it still defaults to the deleted project directory.

Also, when I tried (after re-install) to create the shell_bt_nus from an example and into another folder, I got the ELF-files (ARM code), but the Visual Studio Code shows errors:

[{
    "resource": "/C:/Users/ett15110/Documents/Projects/xxxy/test/shell_bt_nus/src/main.c",
    "owner": "C/C++",
    "code": "1696",
    "severity": 8,
    "message": "cannot open source file \"alloca.h\" (dependency of \"logging/log.h\")",
    "source": "C/C++",
    "startLineNumber": 17,
    "startColumn": 1,
    "endLineNumber": 17,
    "endColumn": 25
},{
    "resource": "/C:/Users/ett15110/Documents/Projects/xxx/test/shell_bt_nus/src/main.c",
    "owner": "C/C++",
    "code": "1696",
    "severity": 8,
    "message": "cannot open source file \"alloca.h\" (dependency of \"zephyr.h\")",
    "source": "C/C++",
    "startLineNumber": 11,
    "startColumn": 1,
    "endLineNumber": 11,
    "endColumn": 20
},{
    "resource": "/C:/Users/ett15110/Documents/Projects/xxx/test/shell_bt_nus/src/main.c",
    "owner": "C/C++",
    "code": "1696",
    "severity": 8,
    "message": "#include errors detected. Consider updating your compile_commands.json or includePath. Squiggles are disabled for this translation unit (C:\\Users\\ett15110\\Documents\\Projects\\xxx\\test\\shell_bt_nus\\src\\main.c).",
    "source": "C/C++",
    "startLineNumber": 11,
    "startColumn": 1,
    "endLineNumber": 11,
    "endColumn": 20
}]

The first two seems to happen, because __GNUC__ seems to not been defined.

And in the target folder it generated .vscode-file with this content:

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "windowsSdkVersion": "10.0.19041.0",
            "compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30037/bin/Hostx64/x64/cl.exe",
            "cStandard": "c17",
            "cppStandard": "c++17",
            "intelliSenseMode": "windows-msvc-x64",
            "compileCommands": "${workspaceFolder}/build/compile_commands.json",
            "configurationProvider": "nrf-connect"
        }
    ],
    "version": 4
}

I don't think it should use that compiler for anything.

It also found some errors from code for other HW!

Is there a way to "make clean"? I didn't find any.

  • Hi

    Yes, that should be possible, I have both SEGGER and Keil µVision and I'm able to get VS code up and running. There is an issue with the "Problems" tab that we're looking into, but you should be able to build and flash sample projects anyway. 

    If a new install of the nRF Connect SDK for VS code is not working for me, it usually fixes the issue to just uninstall the SDK from the Toolchain manager and reinstalling it (I personally have used the same path all along), but changing it should be okay too. Is the compiling, building and flashing of projects not working properly on your end?

    Best regards,

    Simon

  • It works (compiles and generates the elf and hex files), but not properly.

    The main issues:

    - wrong C code parser the VS Code (Intellisense?) uses (being studied, I understood - the problems tab)

    - configuration defaults from previous installs (wrong SDK version, etc.)

    - changes watcher crashing (if I restart it, it checks the changes OK, and crashes after that)

    - the Intellisense configuration (c_cpp_properties.json) seldom gets generated.

    The changes watcher wakes up all kinds of configurations. If you add a file, the IDE won't notice, and doesn't run cmake, unless you restart the changes watcher (which crashes after that).

    I don't have a board yet, so that's how far I have been able to try.

  • Hi

    Both the problem tab and the "previous install path" issue are being looked at, but they shouldn't be necessary to create a working .hex or .elf file.

    Can you explain more about the issue you have with the watcher crashing?

    I'm afraid there's not too much we can do with the Intellisense config.

    Best regards,

    Simon

  • Hi

    One of our developers of the VS code extension has looked into these issues and have come with the following comments.

    We have merged a PR into the latest main branch that addresses these multiple errors/warnings in the problems tab to only show them for the open file(s). We might add more filtering later as that likely will be useful.

    Fhe Z_FOR_LOOP_1 issue you've seen is fixed in the NCS master, and is not actually a VS code issue. It was due to an abuse of the preprocessor in the logging macros. 

    Best regards,

    Simon

  • The notification in the lower right corner. If I click "reload", it does something (probably checks for changed files) and right after that, the notification emerges again. Also after some configuration changes, nothing happens until I click that "reload".

Related