nRF Connect for VSCode unlimited number of issues

Hi, I have several issues just to start off with. One is when I generate support information, it does its thing, and then stops, and I have no idea where the support information was put. Based on instructions to another customer, that is not supposed to happen. It did not happen for them apparently, but it happened to me.

The next problem is when I start VS Code from the toolchain manager on Linux, v2.0.0, west is not found.

The next problem is when I start VS Code from the command line on Linux, cmake  --version gives an error in VS Code, although it is perfectly fine on the command line.

Basically I can do almost anything in a Linux terminal with regards to building and debugging nRF9160 projects, but on Linux I cannot build or debug, and on Windows I can build but not debug, when VS Code is involved.

I have never ever seen an IDE in many, many years that is quite so indecipherable. This is really crazy. Perhaps you can fix that or switch to another recommended IDE?

Thanks.

Burt

Parents
  • Hello Burt,

    I really have trouble with reproducing anything. It feels like there's is something else that may have gotten wrong with the installation or configuration and now we are trying to repair the symptoms without touching on the underlying issue.

    I would also appreciate getting screenshots of any issues you are facing, since it is very hard to follow on the descriptions when I cannot reproduce most of the issues you are facing. It also makes it much easier to possibly escalate it and/or ask for a second opinion.

    Best regards,

    Michal

  • Okay, here are steps. Start with everything clean, but make one change to ncs/v2.1.0/zephyr/cmake/compiler/gcc/compiler_flags.cmake: remove the -Wno-pointer-sign flag from line 37.

    Also, this all must be done on Windows: Linux and Mac do not have the problem.

    Do nRF Connect for VS Code quick setup with 2.1.0 SDK and 2.1.0 toolchain.

    Then Add an Existing Application, it should be .../nrf/applications/asset_tracker_v2.

    Now Add Build Configuration, accept all defaults, and click Build Configuration.

    After the build completes, on the left under ASSET_TRACKER_V2 open up Source files>Application>modules>cloud_module.c so cloud_module.c shows in an editor window.

    You should see yellow markers on the right-side indicating warnings. In fact, if you mouse hover over the window title, cloud_module.c 9+, you will see that there are 20 problems in the file. For example, on line 278, you will see a yellow squiggle underneath "buf" and a message indicating a -Wpointer-sign warning when you hover over the squiggle. (The warning is due to having -Wall set.)

    Now open a Git Bash terminal in VS Code and issue the command

    $ touch src/modules/cloud_module.c

    Now on the left, under ACTIONS, click Build.

    Okay, this did not cause the problem I was looking for--I thought the yellow squiggles might disappear, so we will go one step more sophisticated: modify that line 278 to use a (const char*) cast before buf so the line reads

    err = nrf_cloud_agps_process((const char*)buf, len);

    and save the file. This should make that one warning go away, because if you mouse hover over the function call nrf_cloud_agps_process on that line, you will see it is looking for the first argument to be of type "const char*".

    So once again, perform the Build action (not pristine, that would take forever). The warning does not go away. That is a very, very bad thing.

    I wanted to double check that Linux does not show this problem, but some other problem occurred there so I will just say that Linux and Mac in general seem to work more reliably than Windows. If you can replicate my results on Windows, you may want to see whether Linux behaves differently. I will try that again later, but for now I suggest we focus on Windows.

    Let me know if you need more information. Thanks for sticking with this, Michal. Oh,yeah, there are some other problems with "Run Code Analysis on Active File" but let's look at one problem at a time. Do not select that function for/during this test procedure. It uses a different mechanism of analyzing the file.

    Burt

  • Sorry, I was checking this out a bit, but weren't sure about a few things and forgot to post a reply.

    I think that intellisense has been merged with code analysis, but it feels like for me that they work in a bit different way still? A bit hard to find the exact information around that. But maybe that is because of those errors blocking warnings, as you said.

    I did also get the red carat and similar kind of errors when using the code analysis.

    I will get into dialogue with the developers again about that issue.

    Best regards,

    Michal

  • Thanks, Michal. Both Intellisense and code analysis Clang-tidy exist in the C++ extension, and I don't think they are merged other than in the sense that they both are part of the C++ extension. Visual Studio Code C++ December 2021 Update: clang-tidy - C++ Team Blog (microsoft.com)

    I am happy that you were able to reproduce my issue using code analysis and thank you for discussing it with the developers.

    Burt

  • Ah, I see, thank you for clarification.

    I will get back to you when I'll have some more information from the developers.

    Best regards,

    Michal

  • Hi again Burt,

    I got a message that you may want to look into this issue on github:

    https://github.com/microsoft/vscode-cpptools/issues/9091

    Try setting this in VS Code settings:

    "C_Cpp.codeAnalysis.clangTidy.args": ["--extra-arg=--target=arm-none-eabi-gcc"]

    Best regards,

    Michal

  • Michal, fantastic, amazing, that setting does the trick. Now, please let me know only one more thing--can the developers incorporate this into the nrf-connect extension on Windows so that things "just work" out of the box, or if not, can they create some very easy to follow steps in the main setup procedure for nrf-connect on Windows? I think only a genius, or a super VS Code C/C++ expert would figure it out without help.

    Burt

Reply
  • Michal, fantastic, amazing, that setting does the trick. Now, please let me know only one more thing--can the developers incorporate this into the nrf-connect extension on Windows so that things "just work" out of the box, or if not, can they create some very easy to follow steps in the main setup procedure for nrf-connect on Windows? I think only a genius, or a super VS Code C/C++ expert would figure it out without help.

    Burt

Children
Related