"No definition found" in Button example using VSC

Hello everyone,

We have installed NRF Connect SDK / Toolchain through the Connect App. We then open up VSC and "Open an existing application", choose from "C:\ncs\v2.4.0\zephyr\samples\basic\button" and let it compile.

When right click and select "Go to definition" on sw0 on line 20 of main.c, it just returns "No definition found for 'sw0'".

We tried Ctrl+Shift+P - "nRF Connect: Add nRF Connect SDK to Workspace" - to no avail.

We tried File -> Add Folder to Workspace on our NCS folder - to no avail.

So, what's up? How to get the "Go to definition" to work in VSC using nRF Connect?

Thanks for any help

Parents
  • Hello

    Can you please compile (build) it first and then go to definition of sw0.

    Also, as you are choosing to open an existing application, please make sure that the correct sdk and the toolchain are selected.

    BR,

    Naeem

  • Hi,

    I have build it (first pristine, then normal build). Does not work. Also, I have made sure that 2.4.0 toolchain is installed and is what is used.

    What I select after opening existing application in the build configuration:

    Then I do a pristine build, after which is complains that the CMAKE extension is not the correct one (I just did a complete fresh install on a brand new computer, which is the fourth computer on which I can reproduce this exact issue!).

    So I disable that extension, now NRF connect VSC thing is happy... I then save the workspace and do a normal compile (click the Build button), and I get the following warnings:

    And the go to definition for the sw0 is still not working.

    Now, it seems to me it has to do with linking the devicetree with the C file(s)?

    Also, I get the distinct feeling that this whole development platform using nRF connect desktop app, toolchain manager, VSC, VSC extensions, is half-baked and not at all ready for real usage? It seems to be on an Alpha testing level? But what else to use then? Or what is going on that I am clearly not understanding?

Reply
  • Hi,

    I have build it (first pristine, then normal build). Does not work. Also, I have made sure that 2.4.0 toolchain is installed and is what is used.

    What I select after opening existing application in the build configuration:

    Then I do a pristine build, after which is complains that the CMAKE extension is not the correct one (I just did a complete fresh install on a brand new computer, which is the fourth computer on which I can reproduce this exact issue!).

    So I disable that extension, now NRF connect VSC thing is happy... I then save the workspace and do a normal compile (click the Build button), and I get the following warnings:

    And the go to definition for the sw0 is still not working.

    Now, it seems to me it has to do with linking the devicetree with the C file(s)?

    Also, I get the distinct feeling that this whole development platform using nRF connect desktop app, toolchain manager, VSC, VSC extensions, is half-baked and not at all ready for real usage? It seems to be on an Alpha testing level? But what else to use then? Or what is going on that I am clearly not understanding?

Children
Related