Try to use esp-prog: "GDB connection rejected"

Things to try:

  1. Lowering the adapter speed (you’re running at 20MHz now): Modify esp-wroom-32.cfg as seen in ESP32 + J-link debugger does not start - #12 by Yourigh
  2. Select the correct flash voltage as seen in Esp-prog debugging on a Mac - no device found - #29 by maxgerhardt
  3. Manually update the C:\Users\<user>\.platformio\packages\tool-openocd-esp32 files (while keeping the package.json intact) as noted in Update openocd · Issue #413 · platformio/platform-espressif32 · GitHub. The last 3 ESP32 debuging issues were solved by that.