How to edit the BOARDS_ROOT directory collection in nRF Connect for VS Code? / Please do not add the local boards directory to the global search path

Hi,

I'm currently using NCS v2.9.0 under sysbuild and have recently been using board definitions from different directories. My recent projects possess a "boards" sub-directory in the project directory.

This means when I create a branch, the boards are also copied into the branch and nRF Connect for VS Code suddenly finds/offers multiple instances/copies of my board definitions. It could happen that I change the board definition in my branch, and use the board definition from the trunk (or some other directory) for testing!

Question 1: How can I list all collected directories for the BOARDS_ROOT? How can I remove unwanted directories to clean the list up?

Question 2: Could you please change nRF Connect for VS Code so that the boards directory in the main project is not automatically added to the global search path? Please search this boards directory only when creating a build target for the corresponding project. I hope that other developers will find this more convenient, too.

Best regards,
Michael

Parents
  • Hello Michael,

    I understand. Yes. The BOARDS_ROOT folder in the VS Code extension is very sticky. 

    There are two places they are collected. If you want to manually add and remove some board root directories, you can do so in the nRF Connect for VS Code extension settings:

    But there you can only remove the ones that you have added through that extension setting. But as you can see from this setting's description:

    The workspace folders are automatically added to BOARD_ROOT if they contain a boards/ directory. 

    So if this list is empty, it means that all the board root boards are coming from the applications that you have added through the extension. This is a bit trickier to work around if you have several applications containing a board folder that actually has the board .dts/.dtsi files, and not only the board's .overlay files. 

    To see what paths that are in your build command, you can copy the build command by right clicking one of the build folders in the "Applications" section in the VS Code extension:

    So if you want to remove some of the paths, unfortunately, you need to remove them from the workspace. I imagine that this is a bit cumbersome, if you are jumping between projects, which is unfortunate. 

    You could start removing the board files from the application, and collect them elsewhere, and add this using the extension settings, as in the first screenshot. Ideally, you should only have one version of your board files, and use .overlay files to tweak the behavior between different applications.

    Another alternative is to build outside VS Code, just using a command line. 

    Best regards,

    Edvin

Reply
  • Hello Michael,

    I understand. Yes. The BOARDS_ROOT folder in the VS Code extension is very sticky. 

    There are two places they are collected. If you want to manually add and remove some board root directories, you can do so in the nRF Connect for VS Code extension settings:

    But there you can only remove the ones that you have added through that extension setting. But as you can see from this setting's description:

    The workspace folders are automatically added to BOARD_ROOT if they contain a boards/ directory. 

    So if this list is empty, it means that all the board root boards are coming from the applications that you have added through the extension. This is a bit trickier to work around if you have several applications containing a board folder that actually has the board .dts/.dtsi files, and not only the board's .overlay files. 

    To see what paths that are in your build command, you can copy the build command by right clicking one of the build folders in the "Applications" section in the VS Code extension:

    So if you want to remove some of the paths, unfortunately, you need to remove them from the workspace. I imagine that this is a bit cumbersome, if you are jumping between projects, which is unfortunate. 

    You could start removing the board files from the application, and collect them elsewhere, and add this using the extension settings, as in the first screenshot. Ideally, you should only have one version of your board files, and use .overlay files to tweak the behavior between different applications.

    Another alternative is to build outside VS Code, just using a command line. 

    Best regards,

    Edvin

Children
No Data
Related