PlatformIo not working correctly with ESP32 through debbager (esp-prog, jlink etc )

Problem essence:
(all problem arise when using esp-prog, jlink etc, it works fine only with comport)

  1. If you use ESP with flash more 4MB after upload program not work (reboots all the time)
  2. No work correctly select flash mode (qio, dio , flash frequency, etc)
  3. No work Upload FileSystem image (reboots all the time after upload)
  4. No work debugging (reboots all the time after upload)
    In fact, we can say that platformIO does not work with ESP!!!

I found the cause of the problem:
The fact ESP32 to download programs through the com port, it is used esptool. But esptool does not load the bootloader directly, it changes the binary “on the fly” by substituting the necessary values into it. But for upload platformIo used OpenOCD (esp-prog, jlink etc). It changes nothing in bootloader.bin and writes it “as is”. Because of this, the wrong bootloader gets into the esp32 flash.

I see that this problem has not been solved for more than a year!

I rewrote it file, and added the bootloader modification there when uploading. Not sure if I did it well, but now ESP32 is loading and debugging with debug tools. If someone needs it I can post a modified

I have a question. When will the developers fix this bug?

Bug reports go to Issues · platformio/platform-espressif32 · GitHub