This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

VS Code custom board bug

Hi,

I am developing for custom boards on VS Code and while the new board search in the workspace path is working, I am having issues with it.

When I add another project to the workspace, the board does populate and I can configure a build option for it, and build it when configuring it. However, if I then try and do a pristine build, it complains that it can't find the board?

Also, if I then close VS Code and reopen it, the build folder does not show up for the second project.

Everything for the first project works fine including the pristine build and the build folder being displayed.

I also find that I cannot see the board for the second project after adding it to the nrf connect applications until I restart VS Code?

Kind regards,

Thomas

Parents
  • Adding to the above, when I build using the configurator for the second project, the CMake command has the following input:

    "-DBOARD_ROOT:STRING="c:/Project1Path;c:/Project2Path"

    However once the build has been generated and I click pristine build, only the first project path is included which would be why it can't find the board:

    "-DBOARD_ROOT:STRING="c:/Project1Path"

  • Hi Thomas,

    I would like to clear some doubts.

    1. You are able to build normally for the 1st project. And when you try to build the 2nd project normally (without pristine build) it works? And if this works, can you see the build folder even after restarting VS Code?

    2. But when you pristine build the 2nd project, "board not found" occurs and no build folder is generated?

    Also, if I then close VS Code and reopen it, the build folder does not show up for the second project.

    Maybe the build folder doesn't occur because your pristine build goes to an error.

    Kindly let me know the details.

    Regards,

    Priyanka

  • I'm not sure if this is related, but I also find that the boards for the second project are not visible in the configurator until after closing and reopening VS Code

  • Hi Thomas,

    Looking at the west command run in each case might help. Normally, we attempt to add any workspace folders to the define BOARD_ROOT for the cmake command provided that there is a 'boards' folder in your workspace.

    Could you go to the Output window on the bottom, select the nRF Connect from the drop-down menu on the top right of the output terminal and share the commands and messages that appear?

  • Hi Priyanka,

    I detailed the west command difference above:

    "-DBOARD_ROOT:STRING="c:/Project1Path;c:/Project2Path"

    vs

    "-DBOARD_ROOT:STRING="c:/Project1Path"

  • west build --build-dir c:\project2\build c:\project2 --pristine --board board2ns -- -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=On -DNCS_TOOLCHAIN_VERSION:STRING="NONE" -DBOARD_ROOT:STRING="c:/project1;c:/project2" -DOVERLAY_CONFIG:STRING="overlay.conf"

    vs

    west build --build-dir c:\project2\build c:\project2 --pristine --board board2ns -- -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=On -DNCS_TOOLCHAIN_VERSION:STRING="NONE" -DBOARD_ROOT:STRING="c:/project1" -DCONF_FILE:STRING="c:/project2/prj.conf" -DOVERLAY_CONFIG:STRING="c:/project2/overlay.conf"

  • Hi Thomas,

    in the Ctrl+ (or) File->Preference -> settings, you can search for nRF Connect and you can see the Nrf-connect: Board Roots.

    Here you can edit your settings.json and add the path to your project.

    Could you try adding it here in case you have not done this and also share a picture of your settings.json?

    Kind Regards,

    Priyanka

Reply
  • Hi Thomas,

    in the Ctrl+ (or) File->Preference -> settings, you can search for nRF Connect and you can see the Nrf-connect: Board Roots.

    Here you can edit your settings.json and add the path to your project.

    Could you try adding it here in case you have not done this and also share a picture of your settings.json?

    Kind Regards,

    Priyanka

Children
Related