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

  • Hi Priyanka,

    1. Yes I can build normally in the first project, I can build normally in the 2nd project (without pristine build), and I can see the build folder even after restarting the VS Code.

    2. That is correct, when doing a pristine build, I get "board not found", and I can see that the board root string isn't being passed into the cmake command (whereas it is when the project is configured.

    So it does seem that all the problems stem from the pristine build not passing along the correct list of board roots.

    Kind regards,

    Thomas

  • 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"

Reply
  • 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"

Children
Related