Hi,
The ESP32 flashing is unfortunately indeed unreliable. It is provided by the Espressif’s ESP32 OpenOCD port, so we would advise double-checking with Espressif whether they have a hotfix for this.
We have rebuilt the OpenOCD executable using the latest patches from them here: http://sysprogs.com/files/tmp/openocd.exe; feel free to try replacing the OpenOCD binary in the toolchain directory with it (we have not fully tested it yet).
The issue with the variables is caused by the optimization. Using any other optimization level than -O0 makes GCC optimize out some variables, however using -O0 to build ESP-IDF code results in crashes during startup. As a workaround please try setting the optimization level to -O0 for specific files you want to debug (via the regular MSBuild File Properties). This should keep the ESP-IDF framework in a usable state, while providing full debug functionality for your code.
If you encounter any further problems, feel free to contact us again and we will help you resolve them.