The very first time I setup all this stuff on Windows I struggled for a while. Since I don't want to rely on my memory either I would repeat the same errors, I'm writing the procedure to get everything working.
I will assume that the Visual Studio Code, MSYS2, Arduino IDE, and the ESP8266 or ESP32 platforms are already installed. Also, I assume that you know how to use makeEspArduino to compile an Arduino sketch.
Before starting, let me explain why we are facing all this. The objective is to create a modern development environment for Arduino with the following requirements
- benefit of the Arduino ecosystem