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 Code
Menu > View > Command Palette (CTRL+SHIFT+P) > 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 “Create 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 (CTRL+SHIFT+P > Type: 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 CTRL+E then B (or enter command “ESP-IDF: Build your project”)
Check the “TERMINAL” window for any issues
Viewing project memory sizes etc
Menu > View > Command Palette > Type: ESP-IDF: Size analysis of the binaries
Programming the device
Menu > View > Command Palette > Type: 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.