ESP-PROG , DOIT-Devkit-v1 - Not able to get them working together

I was excited when I saw that the ESP-PROG is the default debug module for VSCode and PlatformIO, for ESP32. I’m now a day into trying to get even the uploading to work…no joy.

I have connected the JTAG ports between the two boards.
I have been using PlatformIO for the project I’m working on for awhile, with no problem, so I am just adding in the ESP-PROG.
I have reinstalled the USB drivers via Zadig multiple tiimes.
I have incorporated advice from multiple articles and tutorials.
I have studied postings from several people having similar problems, and permuted my settings and hookups to try every combination available.

Here is a debug log of the latest attempt, which has the USB only connected to the ESP-PROG.

Uploading .pio\build\esp32doit-devkit-v1\firmware.bin
Open On-Chip Debugger  v0.10.0-esp32-20210721 (2021-07-21-13:35)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
debug_level: 1

adapter speed: 20000 kHz

WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release.
adapter speed: 500 kHz

Error: no device found
Error: unable to open ftdi device with vid 0403, pid 6010, description '*', serial '*' at bus location '*'
Error: no device found
Error: unable to open ftdi device with vid 0403, pid 6014, description '*', serial '*' at bus location '*'
** OpenOCD init failed **
shutdown command invoked

Assertion failed!

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

Expression: jtag_trst == 0
*** [upload] Error 3
================================================================================== [FAILED] Took 32.06 seconds ==================================================================================
The terminal process "C:\Users\Stephen\.platformio\penv\Scripts\platformio.exe 'run', '--target', 'upload', '--environment', 'esp32doit-devkit-v1'" terminated with exit code: 1.

Here is the Platformio.ini for the above output:

[platformio.ini]

default_envs = esp32doit-devkit-v1

[env:esp32doit-devkit-v1]

platform = espressif32

board = esp32doit-devkit-v1

framework = arduino

monitor_speed = 115200

lib_deps =

   ropg/ezTime@^0.8.3

   me-no-dev/ESP Async WebServer@^1.2.3

   khoih-prog/AsyncHTTPRequest_Generic @ ^1.3.1

lib_ignore =

   STM32AsyncTCP

   STM32duino LwIP

   STM32Ethernet

   WebServer_WT32_ETH01

upload_port = COM6

build_type = debug

upload_protocol = esp-prog

upload_speed = 115200

debug_tool = esp-prog

debug_init_break = tbreak setup

debug_speed = 500`Preformatted text`

Most of the configurations I have tried simply get stuck looking for an upload packet.

Has anyone gotten EDP-PROG to work, uploading to DOIT Devkit v1 board?

I’d inlude more info but I’ve tried about 15 different configurations, including ones that include/exclude plugging in both USB’s at the same time.

I have once observed this error when I did connect the TRST line from my JTAG debugger to the target processor, and resolved it by removing the cable. Apparently some noise was introduced? Do you have the TRST connected between the boards?

In general: The article https://medium.com/@manuel.bl/low-cost-esp32-in-circuit-debugging-dbbee39e508b is very good in regards to wiring & Zadig setup.

And just as a sanity check, the driver setup you have now is that you used Zadig to only replace the Dual RS232-HS (Interface 0) with WinUSB, and left the other intact, right?

Another source of erros is flimsly cable or internally broken cables. I have seen dozens of posts with “But I did everything right!!” that ended with “Oh, I exchanged the cables and it works…”.

Thank you for the reply, and the references.

Starting over based on the Medium article.
I disconnected the power jumper I had installed between the boards, and plugged USB into both the debugger and the DOIT dev board.
I had installed both the Interface 0 and 1, so I uninstalled the devices from Device Manager and reinstalled interface 0 using the Zadig. Now I have one device showing on Device Manager.

I don’t have JTAG TRST connected, at least not intentionally. It is not shown on the ESP-PROG wiring diagram anywhere.

The interface 0 appears to be on COM8, so I set the upload_port to COM8.

The results are the same as above.

For future reference, I assume that holding the ESP32 BOOT button while uploading still applies. I also tried the ESP-PROG button for good measure.

When the OCD says it finds no device (twice), what does that indicate? that it’s not finding either the ESP-PROG or the ESP32?

The error message clearly indicates that the problem is in the USB communication between your computer and the ESP-Prog. And most likely it’s related to the driver.

Does “Dual RS232-HS (Interface 0)” look like this in Zadig, in particular the field on the right hand side of the arrow?

ESP-Prog Zadig

Unplug the DOIT-DevKit-1 to troubleshoot drivers.

In the device manager, interface 0 should appear in “Universal Serial Bus devices”. It should NOT appear as a COM port. You can also remove upload_port from platformio.ini as it is not relevant if you use upload_protocol = esp-prog.

Interface 1 does not matter in your setup. It can either appear as a COM port or in “Universal Serial Bus devices”.

@manuelbl
I have reinstalled Zadig drivers per your advice.
Here is my revised platformio.ini:

[platformio.ini]
default_envs = esp32doit-devkit-v1
[env:esp32doit-devkit-v1]
platform = espressif32
board = esp32doit-devkit-v1
framework = arduino
monitor_speed = 115200
lib_deps =
   ropg/ezTime@^0.8.3
   me-no-dev/ESP Async WebServer@^1.2.3
   khoih-prog/AsyncHTTPRequest_Generic @ ^1.3.1
lib_ignore =
   STM32AsyncTCP
   STM32duino LwIP
   STM32Ethernet
   WebServer_WT32_ETH01
; upload_port = COM4
build_type = debug
upload_protocol = esp-prog
; upload_speed = 115200
debug_tool = esp-prog
debug_init_break = tbreak setup
; debug_speed = 500

Output:
Open On-Chip Debugger v0.10.0-esp32-20210721 (2021-07-21-13:35)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
debug_level: 1

adapter speed: 20000 kHz

WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release.
adapter speed: 5000 kHz

Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
** Programming Started **
Error: timed out while waiting for target halted / 4 - 2
Error: xtensa_wait_algorithm: not halted 0, pc 0x40008544, ps 0x60025
Error: Failed to wait algorithm (-302)!
Error: Algorithm run failed (-302)!
Warn : not enough working area available(requested 10433)
Error: no working area available, can't alloc space for stub code!
Warn : not enough working area available(requested 10433)
Error: no working area available, can't alloc space for stub code!
** Programming Finished **
** Verify Started **
Warn : not enough working area available(requested 10433)
Error: no working area available, can't alloc space for stub code!
Error: **** Verification failure! ****
Error: target_hash 000...000
Error: file_hash: 6c7299...4fa014
*** [upload] Error 3221225477
================================================================================== [FAILED] Took 63.70 seconds ==================================================================================
The terminal process "C:\Users\Stephen\.platformio\penv

If I am using upload_protocol = esp-prog, I assume that the upload occurs through the ESP-PROG. Is that true? Then I need to push the BOOT button on the ESP-PROG. If I remove this line, will it switch to using the direct connect usb to the DOIT board?

Is my platformio.ini workable? What would you recommend I change?

Thanks, Stephen

Here is screenshot of my Zadig after the above actions.

zadig

When I first did the replace of driver, it looked exactly like your picture. Now it looks different (changed on its own). I replaced again and it looks right.

zadig1

Tried again, but output is the same as above.

You seem to have made progress. The communication between your computer and the ESP-Prog seems to be working.

Now the problem is between the ESP-Prog and the DOIT-Devkit, even though the error message is a bit unusual. Possible causes are:

  • The wiring between the ESP-Prog and the DOIT-Devkit is not correct, either swapped connections or bad connections.
  • The DOIT-Devkit is not properly powered. It’s not sufficient to power it with the ESP-Prog.
  • Some of the debugging pins are not only connected to the ESP-Prog but to other stuff as well.

It also seems that you have misconfigured the SiLabs CP2102 USB-to-serial connection of the DOIT-Devkit. It’s now using the WinUSB driver. Thus the COM port is likely gone now. You have to restore it.