VSCode Zephyr Integration

Hello, I am struggling to setup the seamless zephyr west integration using Jonathan’s windows workspace json. I may be using it incorrectly since I am new to VSCode as well. I have established the following build structure on my laptop:
image
On the command line, I’m able to generate an Arm ELF by running the following commands **from my app’s subfolder (ex cdc_acm) **:

  1. …..\zephyrproject.venv\scripts\activate.bat
  2. …..\zephyrproject\zephyr\zephyr-env.cmd
  3. west build -b juji -p

This nicely builds under my zephyrapps folder allowing me to keep the app source and respective build folders together (ex. cdc_acm\build). NOTE: I have my own boards subfolder (cdc_acm\boards\arm\juji lives here) in the app folder as well so have to set the BOARD_ROOT in the top-level CMakeLists.txt file.

In VSCODE I have create a “workspace” that contains both my zephyarpps folder and zephyrproject folders so that I can navigate, in vscode, any app and OS. Now, I am trying to get the build, flash and debug scripts to work under VSCode but am not sure how-to setup your .json to work? I tried to run the build, and it cannot find ‘west’ for example so it’s as if the environment setup steps outlined above are not executed.
Thank you for any help.

Hey John! The example code was really meant to be adapted and I haven’t tried it in some time - but I’ll do my best to see if I can help troubelshoot remotely!

Would it be possible to show your entire tree structure? Also, I noticed a zephyr.code-workspace and zephyr-windows.code-workspace. They may be in conflict. Can you also post the contents of each?

Not to throw “yet another tool” at you but since that talk there’s been a few community-built VS Code Extensions that may be of interest. Zephyr IDE is my current recommendation. I’d install the Extension Pack if I was setting up a new machine.

Thanks for the prompt reply, Jonathan!
Here are the contents of zephyr.code-workspace
{
“folders”: [
{
“path”: “zephyrapps”
},
{
“path”: “zephyrproject”
}
],
“settings”: {}
}
& zephyr-windows.code-workspace is your GIT file, which I probably need to tailor to my workspace?
Here is a deeper look into my zephyrapps\cdc_acm folder:
image
It’s literally a copy of the cdc_acm sample app under the zephyrproject.
The zephyrapps contains all the good stuff that the Getting Started on Zephyr guide requires. Hope this helps?

Yes, the repo is described as an example configuration and will definitely need to be modified for your setup. Everything from the paths on your machine, where the SDK is installed, etc. The talk it was made for hopefully explains most of the concepts, this was just posted as reference.

I’ll unfortunately need more information to troubleshoot your setup which may be more involved on both sides.

Did you look at the extension I shared? It hides a lot of the setup away.

I made a follow-up video. HTH!


VSCode Zephyr Integration - Community - Golioth Forums - 28 January 2025 - Watch Video

Thank you very much!

Appreciate it.
John