Developing ESP32 with VSCode

I stepped on the pitfalls so you do not have to — consider this a ladder to help you climb out.


1. Avoid pitfalls when installing the VSCode extension

I will skip the installation steps and go straight to the official getting-started guides: VS Code IDE Quick Start, Quick Installation Guide.

But watch out for the following points:

  • If you have enough space on your C drive, do not bother configuring things manually — let the extension install everything to the C drive automatically; save yourself the hassle. As long as either the code or the developer can run, it is fine.
  • When installing, do not pick Github for Select download server; it is slow in China.
  • The extension uses pip during installation, but pip’s official index is unusable in China, so you need to switch to a mirror manually. The command:
1
2
pip install pip -U
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
  • An error interrupts the extension installation and you need to reinstall, but the previously installed files remain, causing a “file exists” error. Go to the user directory, i.e. %HOMEPATH%\esp, and delete the esp-idf folder. Reinstall and it succeeds in one go.
  • If you use it on multiple devices and have VSCode sync enabled, be sure to enable ignore sync for the 6 configuration parameters in the extension’s settings. For the parameters and reasons, see the Issue I filed: Extension config modified incorrectly due to VSCode sync.

2. Usage notes

Just read the official docs: ESP-IDF VS Code extension tutorial.