This item is a continuation of a previous post, that thread was getting too long and difficut to follow:
Problem uploading to ESP32-CAM with ESP-Prog - Development Platforms - PlatformIO Community
I am finding that using the PlatformIO extension for VSCode on a small ESP32 project is quite unreliable. I have now spent several days trying to pin down what the triggers for the failures are. The problem is that it appears there may be more than one issue and that secondary failures occur as a result of some unidentified issue. I began to think the issue was with the ESP32-CAM boards, however, after changing to an ESP32 DevKit I see the same issues.
Uploading using JTAG and the ESP-Prog sometimes works and sometimes not. Once the uploading has failed, changing to use serial with PlatformIO to upload also fails. It is interesting to note that switching to the Arduino IDE (v1.8) always uploads, also, when trying PlatformIO upload via the serial port after Arduino, it generally works again.
This is the terminal output when JTAG fails:
WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release.
DEPRECATED! use 'adapter speed' not 'adapter_khz'
adapter speed: 500 kHz
Warn : Empty flash mapping!
Warn : Failed to get flash mappings (0)!
Error: Failed to get flash size!
Error: Failed to get flash size!
Error: Failed to probe flash, size 0 KB
Error: auto_probe failed
Error: Failed to find bank 'esp32.cpu0.flash'!
*** [upload] Error 1
Repeating the upload attempts with JTAG continues to produce the above error.
After switching to the Arduino IDE v1.8 and uploading successfully, the next upload attempt with JTAG produces a slightly different error:
WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release.
DEPRECATED! use 'adapter speed' not 'adapter_khz'
adapter speed: 500 kHz
Error: timed out while waiting for target halted
Error: xtensa_wait_algorithm: not halted 0, pc 0x4000c2e8, ps 0x60e23
Error: Failed to wait algorithm (-302)!
Error: Algorithm run failed (-302)!
Error: Too many flash mappings 10417884! Must be 2.
Warn : Failed to get flash mappings (-4)!
Error: Target is already running an algorithm
Error: Failed to start algorithm (-4)!
Error: Failed to get flash size!
Error: Target is already running an algorithm
Error: Failed to start algorithm (-4)!
Error: Failed to get flash size!
Error: Failed to probe flash, size 0 KB
Error: auto_probe failed
Error: Failed to find bank 'esp32.cpu0.flash'!
*** [upload] Error 1
I am very happy to debug this issue, however I need some guidance as to where to start.
I am hoping that once this can be resolved debugging with JTAG will also begin to work reliably.
I really want this all to work, but there is a limit to how many days I can be running in circles without progress on my project.
Sincerely,
Sid