ESP-Prog- Still can't do it. These are the errors now

Okay, so you connect the ESP-Prog to the board and connect the PC to the ESP-Prog. ESP-Prog handles the boot mode thing with IO0. My Devkit has 12, 13, 14 and 15 exposed, and I’d need to push the Boot button.

That’s as far as I get.

Does my debug output look like I have the pins wrong?
This is the debug output:

Info : tcl server disabled
Info : telnet server disabled
Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
Info : clock speed 5000 kHz
Error: JTAG scan chain interrogation failed: all zeroes
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway…
Error: esp32.cpu0: IR capture error; saw 0x00 not 0x01
Warn : Bypassing JTAG setup events due to errors
Warn : target esp32.cpu0 examination failed
Warn : target esp32.cpu1 examination failed
Info : starting gdb server for esp32.cpu0 on pipe
Info : accepting ‘gdb’ connection from pipe
Error: Target not examined yet
Error executing event gdb-attach on target esp32.cpu0:

Is the target baord powered on its own?

Have you tried adding

debug_speed = 500

to the platformio.ini?

Are you sure every wire is connected correctly per ESP-Prog — PlatformIO v6.1 documentation? (Except VDD, the ESP-PROG shouldn’t power a power-hungry ESP32, the board should be connected via a USB cable to power).

I added debug speed.

I’ve tried it a few ways. Last time was USB into the ESP-Prog, wired FTDI style into the ESP32.

So I should get a USB power cable for the ESP32?

I’ve read that it helps to have the second VCC line turned on.

o_O double-powering is usually deadly. Differences in the supplied voltage can lead to really undesired currents flowing.

Yes. Just plug in a regular USB cable into the target ESP32 dev board and disconnect VCC between the esp-prog and target dev board (but keep common GND).

Thank you. This is a DOIT Devkit, with the boot button, by the way. It is plugged power-only into the PC, and a real USB is in the ESP Prog.
I just chose ‘Start debugging’ from Run.

Now it’s back to the original result:For bug reports, read
OpenOCD: Bug Reporting
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: 5000 kHz

Info : tcl server disabled
Info : telnet server disabled
Error: unable to find a matching CMSIS-DAP device

Assertion failed!

Program: C:\Users\joema.platformio\packages\tool-openocd-esp32\bin\openocd.exe
File: …/src/jtag/core.c, Line 338

Expression: jtag_trst == 0
.pioinit:11: Error in sourced command file:
Remote communication error. Target disconnected.: Success.

The ESP-Prog is FTDI based, it makes no sense that it’s looking for a CMSIS-DAP device. Do you have

upload_protocol = esp-prog
debug_tool = esp-prog

in the platformio.ini?

I went online to confirm the pins and got the same result.
I did not have upload_protocol.

“Error: unable to find a matching CMSIS-DAP device”

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
debug_tool = esp-prog
upload_protocol = esp-prog
debug_init_break = tbreak setup
debug_speed = 500
lib_deps = 
	Wire
	SD
	SPI
	WiFi
	SPIFFS
	esp_now
	Arduino_JSON
	prenticedavid/MCUFRIEND_kbv
	arduino-libraries/NTPClient@^3.2.1
	esphome/ESPAsyncWebServer-esphome@^2.1.0
	adafruit/Adafruit GFX Library @ ^1.10.7
	https://github.com/adafruit/Adafruit_BusIO.git
	https://github.com/ImpulseAdventure/Arduino-TFT-Library-ILI9486.git

Please show the output of the project task “Advanced → Verbose Build”.

I can’t find that stuff.

Sorry completely wrong instructions, it’s PlatformIO IDE for VSCode — PlatformIO latest documentation and Advanced → Verbose Upload.

Oh Jeez. Debug Console says the same thing it’s been saying, but Terminal says a whole lot of stuff I can’t understand.

What’s this:


section                                                                                size         addr

.rtc.text
  0   1074528256

.rtc.dummy
  0   1073217536

.rtc.force_fast
  0   1073217536

.rtc.data
 16   1342177792

.rtc_noinit
  0   1342177808

.rtc.force_slow
  0   1342177808

.iram0.vectors                                                                         1027   1074266112

.iram0.text                                                                           73591   1074267140

.dram0.data                                                                           20792   1073470304

.ext_ram_noinit
  0   1065353216

.noinit
  0   1073491096

.ext_ram.bss
  0   1065353216

.dram0.bss                                                                            17944   1073491096

.flash.appdesc
256   1061158944

.flash.rodata                                                                         95764   1061159200

.flash.rodata_noload                                                                  14910   1061254964

.flash.text                                                                          500239   1074593824

.phyiram.20
 97   1075094064

.phyiram.18
270   1075094164

.phyiram.19
144   1075094436

.phyiram.17
727   1075094580

.phyiram.0
 43   1075095308

.phyiram.1
125   1075095352

.phyiram.2
542   1075095480

.phyiram.3
171   1075096024

.phyiram.4
255   1075096196

.phyiram.6
131   1075096452

.phyiram.7
511   1075096584

.phyiram.8
375   1075097096

.phyiram.9
142   1075097472

.phyiram.13
186   1075097616

.phyiram.12
235   1075097804

.phyiram.14
459   1075098040

.phyiram.16
114   1075098500

.phyiram.11
120   1075098616

.phyiram.15
186   1075098736

.phyiram.21
 74   1075098924

.phyiram.22
 49   1075099000

.phyiram.23
259   1075099052

.phyiram.24
135   1075099312

.iram0.text_end
  1   1074340731

.iram0.data
  0   1074340732

.iram0.bss
  0   1074340732

.dram0.heap_start
  0   1073509040

.xtensa.info
 56            0

.comment
282            0

.xt.prop._ZN5Print17availableForWriteEv
 36            0

.xt.prop._ZN6Stream9readBytesEPhj
 36            0

.xt.prop._ZTV7TwoWire
 12            0

.xt.lit._ZNSt8functionIFv18arduino_event_id_t20arduino_event_info_tEEC5ERKS3_
  0            0

.xt.lit._ZN15WiFiEventCbListC5ERKS_
  0            0

.xt.prop._ZNSt8functionIFv18arduino_event_id_t20arduino_event_info_tEEC5ERKS3_
  0            0

.xt.prop._ZN15WiFiEventCbListC5ERKS_
  0            0

.xt.prop._ZNSt14_Function_baseD2Ev
 36            0

.xt.prop._ZNSt8functionIFv18arduino_event_id_t20arduino_event_info_tEEC2ERKS3_
 60            0

.xt.prop._ZN15WiFiEventCbListC2ERKS_
 36            0

.xt.lit._ZNKSt8functionIFv22hardwareSerial_error_tEEclES0_
  0            0

.xt.prop._ZNKSt8functionIFv22hardwareSerial_error_tEEclES0_
 48            0

.xt.prop._ZTV14HardwareSerial
 12            0

.xt.lit._ZN9IPAddressD5Ev
  0            0

.xt.prop._ZN9IPAddressD5Ev
  0            0

.xt.prop._ZN9IPAddressD2Ev
 36            0

.xt.prop._ZN9IPAddressD0Ev
 36            0

.xt.prop._ZTV9IPAddress
 12            0

.xt.lit._ZN5Print5writeEPKc
  0            0

.xt.prop._ZN5Print5writeEPKc
 48            0

.xt.lit._ZN6String4initEv
  0            0

.xt.prop._ZN6String4initEv
 36            0

.xt.prop._ZNK6String3lenEv
 60            0

.xt.prop._ZN6String6setLenEi
 72            0

.xt.lit._ZN3nvs4Lock4initEv
  0            0

.xt.prop._ZN3nvs4Lock4initEv
 72            0

.xt.prop._ZN14intrusive_listI14NVSHandleEntryE5eraseENS1_8iteratorE
 84            0

.xt.lit._ZN14intrusive_listIN3nvs7Storage14NamespaceEntryEE17clearAndFreeNodesEv        
  0            0

.xt.lit._ZN19CompressedEnumTableIbLj1ELj256EE3setEjb
  8            0

.xt.prop._ZN14intrusive_listIN3nvs7Storage14NamespaceEntryEE17clearAndFreeNodesEv       
108            0

.xt.prop._ZN19CompressedEnumTableIbLj1ELj256EE3setEjb
 60            0

.xt.prop._ZN14intrusive_listIN3nvs7Storage14NamespaceEntryEE9push_backEPS2_
 60            0

.xt.prop._ZTVN3nvs15NVSHandleSimpleE
 12            0

.xt.lit._ZN3nvs12NVSPartitionD5Ev
  0            0

.xt.prop._ZN3nvs12NVSPartitionD5Ev
  0            0

.xt.prop._ZN3nvs12NVSPartitionD2Ev
 36            0

.xt.prop._ZN3nvs12NVSPartitionD0Ev
 36            0

.xt.prop._ZTVN3nvs12NVSPartitionE
 12            0

.xt.lit._ZN3nvs19NVSPartitionManagerD5Ev
  0            0

.xt.prop._ZN3nvs19NVSPartitionManagerD5Ev
  0            0

.xt.prop._ZN3nvs19NVSPartitionManagerD2Ev
 36            0

.xt.prop._ZN3nvs19NVSPartitionManagerD0Ev
 36            0

.xt.prop._ZN14intrusive_listIN3nvs12NVSPartitionEE5eraseENS2_8iteratorE
 84            0

.xt.prop._ZN14intrusive_listIN3nvs15NVSHandleSimpleEE5eraseENS2_8iteratorE
 84            0

.xt.prop._ZTVN3nvs19NVSPartitionManagerE
 12            0

.xt.prop._ZN14intrusive_listIN3nvs8HashList13HashListBlockEE5eraseENS3_8iteratorE       
 84            0

.xt.lit._ZN3nvs4ItemC5EhNS_8ItemTypeEhPKch
  0            0

.xt.lit._ZNK19CompressedEnumTableIN3nvs4Page10EntryStateELj2ELj126EE3getEj
  8            0

.xt.lit._ZN19CompressedEnumTableIN3nvs4Page10EntryStateELj2ELj126EE3setEjS2_
  8            0

.xt.prop._ZN3nvs4ItemC5EhNS_8ItemTypeEhPKch
  0            0

.xt.prop._ZNK19CompressedEnumTableIN3nvs4Page10EntryStateELj2ELj126EE3getEj
 60            0

.xt.prop._ZN19CompressedEnumTableIN3nvs4Page10EntryStateELj2ELj126EE3setEjS2_
 60            0

.xt.prop._ZN3nvs20isVariableLengthTypeENS_8ItemTypeE
 48            0

.xt.prop._ZN3nvs4ItemC2EhNS_8ItemTypeEhPKch
 60            0

.xt.lit._ZN14intrusive_listIN3nvs4PageEE5clearEv
  0            0

.xt.prop._ZN14intrusive_listIN3nvs4PageEE5clearEv
 60            0

.xt.prop._ZN14intrusive_listIN3nvs4PageEE9push_backEPS1_
 60            0

.xt.prop._ZN14intrusive_listIN3nvs4PageEE5eraseENS2_8iteratorE
 84            0

.xt.prop._ZTISt9exception
 12            0

.xt.prop._ZTISt9bad_alloc
 12            0

.xt.prop._ZTVN10__cxxabiv117__class_type_infoE
 12            0

.xt.prop._ZTVN10__cxxabiv120__si_class_type_infoE
 12            0

.xt.prop._ZTISt17bad_function_call
 12            0

.xt.prop._ZTVSt17bad_function_call
 12            0

.xt.prop._ZTVSt9bad_alloc
 12            0

.xt.lit._ZNK9__gnu_cxx24__concurrence_lock_error4whatEv
  8            0

.xt.lit._ZNK9__gnu_cxx26__concurrence_unlock_error4whatEv
  8            0

.xt.lit._ZN9__gnu_cxx24__concurrence_lock_errorD5Ev
  8            0

.xt.lit._ZN9__gnu_cxx26__concurrence_unlock_errorD5Ev
  8            0

.xt.lit._ZN9__gnu_cxx7__mutex4lockEv
  8            0

.xt.lit._ZN9__gnu_cxx13__scoped_lockD5Ev
  8            0

.xt.prop._ZNK9__gnu_cxx24__concurrence_lock_error4whatEv
 48            0

.xt.prop._ZNK9__gnu_cxx26__concurrence_unlock_error4whatEv
 48            0

.xt.prop._ZN9__gnu_cxx24__concurrence_lock_errorD5Ev
 12            0

.xt.prop._ZN9__gnu_cxx26__concurrence_unlock_errorD5Ev
 12            0

.xt.prop._ZN9__gnu_cxx7__mutex4lockEv
 48            0

.xt.prop._ZN9__gnu_cxx13__scoped_lockD5Ev
 12            0

.xt.prop._ZN9__gnu_cxx24__concurrence_lock_errorD2Ev
 36            0

.xt.prop._ZN9__gnu_cxx26__concurrence_unlock_errorD2Ev
 36            0

.xt.prop._ZN9__gnu_cxx24__concurrence_lock_errorD0Ev
 36            0

.xt.prop._ZN9__gnu_cxx26__concurrence_unlock_errorD0Ev
 36            0

.xt.prop._ZN9__gnu_cxx13__scoped_lockD2Ev
 72            0

.xt.prop._ZTIN9__gnu_cxx24__concurrence_lock_errorE
 12            0

.xt.prop._ZTIN9__gnu_cxx26__concurrence_unlock_errorE
 12            0

.xt.prop._ZTVN9__gnu_cxx24__concurrence_lock_errorE
 12            0

.xt.prop._ZTVN9__gnu_cxx26__concurrence_unlock_errorE
 12            0

.debug_frame                                                                         116528            0

.debug_info                                                                         4937961            0

.debug_abbrev                                                                        415471            0

.debug_loc                                                                           850897            0

.debug_aranges                                                                        45488            0

.debug_ranges                                                                        109368            0

.debug_line                                                                         2104645            0

.debug_str                                                                           416477            0

Total                                                                               9729487

That’s just listing the size and address of every section in the ELF file. What’s more important is the very last bit where it should try to upload via the ESP-Prog and openocd.

It didn’t upload. Just built:

“C:\Users\joema.platformio\penv\Scripts\python.exe” “C:\Users\joema.platformio\packages\tool-esptoolpy\esptool.py” --chip esp32 elf2image --flash_mode dio --flash_freq 40m --flash_size 4MB -o .pio\build\esp32dev\firmware.bin .pio\build\esp32dev\firmware.elf
esptool.py v3.3
Creating esp32 image…
Merged 25 ELF sections
Successfully created esp32 image.
============================= [SUCCESS] Took 13.80 seconds =

Are you sure you’re executing the Advanced → Verbose Upload project task?

No, that was verbose build. It failed to connect. COM33 is in Device Manager. Pins are triple-checked against a tutorial pinout I found.

esptool.py v3.3
Serial port COM33
Connecting…

A fatal error occurred: Failed to connect to ESP32: No serial data received.
For troubleshooting steps visit: Troubleshooting - ESP32 - — esptool.py latest documentation
*** [upload] Error 2

If it’s using a COM port it isn’t trying to use the JTAG interface of the ESP-Prog at all. I’m baffled by how you have the platformio.ini here but it still tries to use an entirely different configuration. Are you sure you’re editing the platformio.ini of the active project? Or maybe you need to use the project environment switcher to switch to the correct project?

If that still doesn’t work, please show a screenshot of your VSCode window with the opened platfomio.ini.

Okay. This time I got the platform correct and selected "PIO Debug (Phoenix_Dashboard_Receiver).
I got the same error in the image above.
I went out into the Platformio menu and selected Verbose Upload.

Terminal is freaking out.

.debug_abbrev

    476805            0
WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release. 

DEPRECATED! use 'adapter speed' not 'adapter_khz'
.debug_loc

   1056367            0
adapter speed: 500 kHz


.debug_aranges

     53488            0
Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED

Info : clock speed 500 kHz
.debug_ranges

    141520            0
Error: JTAG scan chain interrogation failed: all ones

Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
.debug_line

   2373771            0

Error: esp32.cpu0: IR capture error; saw 0x1f not 0x01
.debug_str

    596626            0
Warn : Bypassing JTAG setup events due to errors

Warn : target esp32.cpu0 examination failed
Total

  11555823
Warn : target esp32.cpu1 examination failed
Info : starting gdb server for esp32.cpu0 on 3333
Info : Listening on port 3333 for gdb connections
"C:\Users\joema\.platformio\penv\Scripts\python.exe" "C:\Users\joema\.platformio\packages\tool-esptoolpy\esptool.py" --chip esp32 elf2image --flash_mode dio --flash_freq 40m --flash_size 4MB -o .pio\build\esp32dev\firmware.bin .pio\build\esp32dev\firmware.elf     
Error: JTAG scan chain interrogation failed: all ones
esptool.py v3.3
Creating esp32 image...
Error: Check JTAG interface, timings, target power, etc.
Merged 25 ELF sections
Error: Trying to use configured scan chain anyway...
Successfully created esp32 image.
Error: esp32.cpu0: IR capture error; saw 0x1f not 0x01
<lambda>(["upload"], [".pio\build\esp32dev\firmware.bin"])
Warn : Bypassing JTAG setup events due to errors
AVAILABLE: cmsis-dap, esp-prog, espota, esptool, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa      
Info : esp32.cpu0: Debug controller was reset.
CURRENT: upload_protocol = esp-prog
Info : esp32.cpu0: Core was reset.
openocd -d2 -s C:/Users/joema/.platformio/packages/tool-openocd-esp32/share/openocd/scripts -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg -c "adapter_khz 500" -c "program_esp {{.pio\build\esp32dev\firmware.bin}} 0x1000Error: Couldn't halt target before SoC reset
0 embedded:startup.tcl:1162: Error: ** Unable to reset target **
verify" -c "proin procedure 'program_esp' 
grin procedure 'program_error' called at file "C:/Users/joema/.platformio/packages/tool-openocd-esp32/share/openocd/scripts/target/esp_common.cfg", line 93
am_at file "embedded:startup.tcl", line 1162
esp*** [upload] Error 1
 {{C:/Users/joema/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/bin/bootloader_dio_40m.bin}} 0x1000 verify" -c "program_esp {{C:/Users/joema/Documents/PlatformIO/Projects/Phoenix_Dashboard_Receiver/.pio/build/esp32dev/partitions.bin}} 0x8000 verify" -c "program_esp {{C:/Users/joema/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin}} 0xe000 verify" -c "reset run; shutdown"
============================= [FAILED]

It’s at least trying to use the ESP-PROG now, but it can’t find the ESP32 connected to it. Can you temporarily set upload_protocol = esptool so that you can upload via the serial port again and upload platform-espressif32/examples/arduino-blink/src/Blink.cpp at develop · platformio/platform-espressif32 · GitHub to it? Your current program may use the JTAG GPIO pins or do something else. Then set upload_protocol = esp-prog again and retry.

If that does not work, double check that all cables are connected properly, including power via the USB cable to the target ESP32 board.