This is an example configuration for setting up Visual Studio Code for Zephyr application development. It was originally created for the talk entitled, "Zephyr & Visual Studio Code: How to Develop Zephyr Apps with a Modern, Visual IDE" at EOSS 2023.
The original example has been modified to demonstrate Zephyr application development targeting the Infineon CYW920829M2EVK-02 Evaluation Kit.
There are many, many different ways to develop a Zephyr application. This example currently assumes:
- In-tree development
- Building
samples/basic/threadso we can demonstrate thread-aware debugging - Targetting CYW920829M2EVK-02
- Follow the Zephyr Getting Started Guide for your OS
- Turn on Compilation Database with
west config build.cmake-args -- -DCMAKE_EXPORT_COMPILE_COMMANDS=ON - Copy the
.vscodefolder and/or thezephyr.code-workspacefile tosamples/basic/thread - See board doc for the CYW920829M2EVK-02
- Install Infineon customized OpenOCD according to instructions
- Open
samples/basic/threadin VS Code- Accept to install recommended extensions
- Edit settings in
.vscode/settings.jsonand/orzephyr.code-workspaceto reflect the actual paths usedzephyr.zephyr_basezephyr.zephyr_sdk_install_dirinfineon.openocd_base
- Set the
Python: Interpreter Pathin VS Code settings- If Python virtual environments were used during install, this would be something like:
~/zephyrproject/.venv/bin/python3
- If Python virtual environments were used during install, this would be something like:
- Try the different build tasks and the flash task
- Try to connect over the serial terminal
- Try step debugging
- Enable thread awareness support by adding
CONFIG_DEBUG_THREAD_INFO=yin application fileprj.conf
- Enable thread awareness support by adding