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

  • Oh, for crying out loud, no wonder I am having problems with "unintellinonsense." An important feature has been left out, although I would have to see how Eclipse behaves in a similar case:

    I was going down the list of files one by one in the Explorer, opening up directories in the GUI to see the files. So for example, the first file I would see is aws_iot_codec.c. Now my CMakeLists.txt shows that file is not included for the configuration I am using. So why aren't the contents of the file grayed out and why is Intellisense not disabled for that file?

    Also, I am having to add include header paths manually. Once I have done the configuration stage of a build, those should be determined automatically.

    Here is another KConfig/Intellisense problem in main.c

    int agps_wait_threshold_ms = CONFIG_APP_REQUEST_GNSS_WAIT_FOR_AGPS_THRESHOLD_SEC *
    MSEC_PER_SEC;

    And here is what I get when I hover

    Number of seconds to wait for A-GPS data

    Type: int

    Value: 300

    Number of seconds that the application module will wait for A-GPS data to be processed before requesting GNSS data. If set to -1, the application module will wait until A-GPS data has been processed.

    Kconfig environment: asset_tracker_v2/build

    identifier "CONFIG_APP_REQUEST_GNSS_WAIT_FOR_AGPS_THRESHOLD_SEC" is undefinedC/C++(20)
    View Problem
    Quick Fix... (Ctrl+.)

    It is both defined (as 300) and undefined!!! What is going on here?

    Thanks,

    Burt

  • Michal,

    I am making progress with Intellisense; however, only by manually adding include directories and an include file to the C/C++ Intellisense settings. According to https://nrfconnect.github.io/vscode-nrf-connect/connect/advanced_features.html everything should happen automatically. Why is it not working automatically? Also, I would editorially state that your project management should have known that in 2021 or 2022, some sort of Intellisense or equivalent is not an advanced feature in an IDE. Yes, the software engineer designing or implementing is probably more advanced than I am, but the feature is expected.

    I found a bug in the file cloud_module.c using Intellisense. Forgive me, once I copy and paste from VSCode I can't get out of

    #define BUILD_ASSERT(EXPR,MSG...) _Static_assert(EXPR, "" MSG)

    Expands to:

    _Static_assert(0 || 0 || 0 || 0, "" "A cloud transport service must be enabled")
    static assertion failed with "A cloud transport service must be enabled"C/C++(1574)
    View Problem
    Quick Fix... (Ctrl+.)
    BUILD_ASSERT(IS_ENABLED(CONFIG_NRF_CLOUD_MQTT) ||
    IS_ENABLED(CONFIG_AWS_IOT) ||
    IS_ENABLED(CONFIG_AZURE_IOT_HUB) ||
    IS_ENABLED(CONFIG_LWM2M_INTEGRATION),
    "A cloud transport service must be enabled");


  • Sorry, it looks like my text got wiped out above. I don't have a copy. Sh....

  • Hello Burt,
    Sorry for the delay. I am unfortunately unable to elaborate on most of the VS Code issues, as it all should work automatically. I can only imagine that something may have gone wrong during the installation and configuration of some parts and for that I can only recommend a complete manual reinstall. You could maybe try that in a virtual machine, just to do it in a clean environment.

    I did found out though that the earlier debugging issue is most likely due to gcc optimizing some things for you.

    Best regards,

    Michal

  • Hi Michal,

    I think I am now very close to having things work with Intellisense. AFAICT, the trick is to have configurationProvider set to "nrf-connect" in c_cpp_properties.json, and to be careful not to add anything using C/C++ Configurations (Intellisense Configurations) command that will override it. However, there seems to be one exception. The build is done with -Wall -Wno-pointer-sign plus some additional warning flags (standard). But in asset_tracker_v2 (v2.0.0 is my level), in file cloud_module.c, I get a number of warnings for the situation below. Please see if you can recreate this one issue. Everything else seems to be okay at least for now. I may not be able to write anything once I paste from VS Code (my limitation probably) so I'll sign out now and wait for your response.

    static void agps_data_handle(const uint8_t *buf, size_t len)
    {
    int err;

    #if defined(CONFIG_NRF_CLOUD_AGPS)
    err = nrf_cloud_agps_process(buf, len);
    const uint8_t *buf
    passing 'const uint8_t *' (aka 'const unsigned char *') to parameter of type 'const char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is notC/C++(clang-diagnostic-pointer-sign)
    nrf_cloud_agps.h(56, 40): passing argument to parameter 'buf' here
    
    Looks like I can type, after all, here. Oh, drats, there should be a yellow

    squiggle under buf in the function call to nrf_cloud_agps_process but spellcheck got in the way. Thanks.

Related