Resources

https://github.com/espressif/vscode-esp-idf-extension/blob/master/docs/tutorial/basic_use.md

NOTE: The esp-idf build system does not support spaces in paths to projects

Create an example project in Visual Studio

Menu > View > Command Palette > Type: ESP-IDF: Show Examples Projects
Choose Use current ESP-IDF (/path/to/esp-idf).
All of the example projects will be shown. Select the project you want and press the “Creat project using example” button.
In the Select Folder ensure your path for the project DOES NOT HAVE SPACES in it.

Setup the project

Select a target device

Menu > View > Command Palette > Type (or press F1): ESP-IDF: Set Espressif device target
Once prompted, select the device
Once prompted, select the board

Configure the project

Menu > View > Command Palette > Type: ESP-IDF: SDK Configuration editor
Wait for it to load
Modify the ESP-IDF project settings as requried. After all changes are made, click save then close the window.

Setup c_cpp_properties.json

Configure the .vscode/c_cpp_properties.json as explained here: https://github.com/espressif/vscode-esp-idf-extension/blob/master/docs/C_CPP_CONFIGURATION.md

If your project doesn’t have a “.vscode” folder, add it using:
Menu > View > Command Palette > Type: ESP-IDF: Add vscode configuration folder

Open “c_cpp_properties.json”
Use the default configuration from the link above (or your own)

Building the project

Build

Press the “Build” icon in the bottom toolbar

Check the “TERMINAL” window for any issues

Viewing project memory sizes etc

Menu > View > Command Palette > Type (or press F1): ESP-IDF: Size analysis of the binaries

Programming the device

Menu > View > Command Palette > Type (or press F1): ESP-IDF: Select port to use
Select the UART or JTAG port you want to use to program the device

Menu > View > Command Palette > Type (or press F1): ESP-IDF: Flash your project
Also available:
ESP-IDF: Flash (UART) your project
ESP-IDF: Flash (with JTag)
ESP-IDF: Select Flash Method and Flash

Debugging

https://github.com/espressif/vscode-esp-idf-extension/blob/master/docs/tutorial/debugging.md

Set your device

Menu > View > Command Palette > Type (or press F1): ESP-IDF: Set Espressif device target

Menu > View > Command Palette > Type (or press F1): ESP-IDF: Select OpenOCD Board Configuration
or
Menu > View > Command Palette > Type (or press F1): ESP-IDF: Device configuration

Debug

Build the project

Press ‘F5’ to start OpenOCD. You’ll see its status appear in the “OUTPUT” window.


USEFUL?
We benefit hugely from resources on the web so we decided we should try and give back some of our knowledge and resources to the community by opening up many of our company’s internal notes and libraries through mini sites like this. We hope you find the site helpful.
Please feel free to comment if you can add help to this page or point out issues and solutions you have found, but please note that we do not provide support on this site. If you need help with a problem please use one of the many online forums.

Comments

Your email address will not be published. Required fields are marked *