Including custom boards in a VS Code .code-workspace file ("nrf-connect.boardRoots")

Hi DevZone,

What I am working with:

I am working on a project using nRF Connect SDK with VS Code, and I am also using the nRF Connect extension for it.

My issue:

I am trying to make my VS Code project register my local folder for custom boards so I can use the board when creating a build configuration with the "Add Build Configuration" option in VS Code.

 

 

I can do this with an absolute path as shown below in line 29, and as you can see in the images above, I can select "Custom Boards":

However, I want the path in "nrf-connect.boardRoots" to be either relative to the Workspace Folder, or use an environment variable to make the contents of the .code-workspace 

not be dependent on absolute paths of my PC file structure. I can do this with the "nrf-connect.applications" setting as seen below in line 9 with "${workspaceFolder}".

I have added line 17 to show the difference between it and line 16:

Could you tell me if it is possible to make the "nrf-connect.boardRoots" directory either:

 - Relative to the workspace folder

 - Dependent on an environment macro

 - Or something else which allows me to avoid an absolute path for this setting?

Thank you for your help in advance,

Br. Casper

Parents
  • Hi, 

    Have a look at this case. It might help. If not, please let me know the further questions.   

    Regards,
    Amanda

  • Hi Amanda,

    Thanks for replying. In the link you provided user "hubpav" also had to use the absolute path when appending the directory path to his "nrf-connect.boardRoots".

    What we are both looking for is an option to use a relative path instead. Do you know if this is possible?

    Also, I have tried using the variable ${workspaceFolder} but it seems that it is interpreted character by character instead of evaluating the contents of the variable which points to the correct place for the workspace to find the /boards directory.

    Br. Casper

  • Hello,

    Quick question, I'm trying to find the file where "nrf-connect.boardRoots" is contained. could you provide me with a file name or file path please?

    Respectfully,

    - Yin

  • Hi Yin,

    Do you mean what path that statement resolves to?

    If so, then this is where all the boards are contained:

    <nRFConnectSDK>\v1.9.1\zephyr\boards\

    And for arm microcontrollers (which includes nRF51, nRF52 and nRF9160 then look in the "arm" directory:

    <nRFConnectSDK>\v1.9.1\zephyr\boards\arm\<your board> 

    Br. Casper

  • Hi,
    Sorry I wasn't clear. I wanted to know if the file where the settings for "nrf-connect.boardRoots" is one you made yourself or is it one that is generated when making a new board in VSCode? If that file is a generated one, what is it called?

    Respectfully,

    - Yin

  • Hi Yin,

    The settings for "nrf-connect.boardRoots" is contained in the .code-workspace file.

    Mine is located here:

    <workspace_folder>\<project_folder>\.vscode\<projectname>.code-workspace

    Example:

    D:\GIT\Workspace\Project\.vscode\myfirstproject.code-workspace

    Hope this helps.

    Br. Casper

    Edit. Spelling

  • Yes! That was super helpful. Thank you so much.

Reply Children
No Data