Error ESP32 PROG

Hello

I have error code with my ESP32 Prog can you help me ? Thanks

 Open On-Chip Debugger  v0.10.0-esp32-20201202 (2020-12-02-17:38)
 Licensed under GNU GPL v2
 For bug reports, read
 http://openocd.org/doc/doxygen/bugs.html
adapter speed: 20000 kHz

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

Info : tcl server disabled
Info : telnet server disabled
Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi_tdo_sample_edge falling"
Info : clock speed 20000 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
Info : accepting 'gdb' connection from pipe
Warn : No symbols for FreeRTOS!
Error: Target not examined yet
Error executing event gdb-attach on target esp32.cpu0:

Error: Target not halted
Error: auto_probe failed
Error: Connect failed. Consider setting up a gdb-attach event for the target to prepare target for GDB connect, or use 'gdb_memory_map disable'.
Error: attempted 'gdb' connection rejected
Error: error during select: Unknown error
.pioinit:11: Error in sourced command file:
Remote communication error.  Target disconnected.: No error.

That here. Have you checked that?

A general countermeasure would be to write debug_speed = 500 in the platformio.ini to lower the debugging speed to 500kHz.

Otherwise there could also be a wrong connection to the board. Since you didn’t show the wireup, I can’t say that.

I double-check the connections all looks good .

Reading symbols from c:\Users\mcece\Desktop\arduino\temperatrure\.pio\build\esp32doit-devkit-v1\firmware.elf...
done.
PlatformIO Unified Debugger -> http://bit.ly/pio-debug
PlatformIO: debug_tool = esp-prog
PlatformIO: Initializing remote target...
Open On-Chip Debugger  v0.10.0-esp32-20201202 (2020-12-02-17:38)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
adapter speed: 20000 kHz

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

Info : tcl server disabled
Info : telnet server disabled
Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi_tdo_sample_edge falling"
Info : clock speed 20000 kHz
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: esp32.cpu0: IR capture error; saw 0x1f not 0x01
Warn : Bypassing JTAG setup events due to errors
Info : accepting 'gdb' connection from pipe
Warn : No symbols for FreeRTOS!
Error: Target not examined yet
Error executing event gdb-attach on target esp32.cpu0:

Error: Target not halted
Error: auto_probe failed
Error: Connect failed. Consider setting up a gdb-attach event for the target to prepare target for GDB connect, or use 'gdb_memory_map disable'.
Error: attempted 'gdb' connection rejected
Error: error during select: Unknown error
.pioinit:11: Error in sourced command file:
Remote communication error.  Target disconnected.: No error.

And the same happens with a lower debug_speed as previously noted? (docs).

this is my ini file

[env:esp32doit-devkit-v1]

platform = espressif32

board = esp32doit-devkit-v1

framework = arduino

debug_tool = esp-prog

upload_protocol = esp-prog

monitor_speed = 9600

lib_deps = 

    adafruit/Adafruit SHT31 Library @ 2.0.0

    adafruit/Adafruit MCP9600 Library @ 1.1.1

debug_init_break = tbreak setup

debug_speed = 20000

upload_port = COM6

That’s not necessary since the esp-prog upload happens via the USB device, not a COM port.

Ok but, did you try the lower speed? What is the wireup? Also, which exact dev board are you using?

PlatformIO: Initializing remote target…

Open On-Chip Debugger v0.10.0-esp32-20201202 (2020-12-02-17:38)

Licensed under GNU GPL v2

For bug reports, read

http://openocd.org/doc/doxygen/bugs.html

adapter speed: 20000 kHz

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

2

Info : FreeRTOS creation

adapter speed: 1000 kHz

Info : tcl server disabled

Info : telnet server disabled

Info : clock speed 1000 kHz

Error: JTAG scan chain interrogation failed: all ones

Error: Check JTAG interface, timings, target power, etc.

Error: Trying to use configured scan chain anyway…

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

Warn : Bypassing JTAG setup events due to errors

Info : accepting ‘gdb’ connection from pipe

Warn : No symbols for FreeRTOS!

Error: Target not examined yet

Error executing event gdb-attach on target esp32.cpu0:

Error: Target not halted

Error: auto_probe failed

Error: Connect failed. Consider setting up a gdb-attach event for the target to prepare target for GDB connect, or use ‘gdb_memory_map disable’.

Error: attempted ‘gdb’ connection rejected

Error: error during select: Unknown error

.pioinit:11: Error in sourced command file:

Remote communication error. Target disconnected.: No error.

i use this DEV board : https://www.digikey.ca/en/products/detail/schtoeta-engineering-limited/ESP32-DEVKITC-32UE/12091813?utm_adgroup=RF%20Evaluation%20and%20Development%20Kits%2C%20Boards&utm_source=google&utm_medium=cpc&utm_campaign=Shopping_Product_RF%2FIF%20and%20RFID_NEW&utm_term=&productid=12091813&gclid=CjwKCAiAmrOBBhA0EiwArn3mfP8BNNMBVAKznM5PL8qur5PknFmqObGyxLhTS1z0jKsnn_Zxyg1KlBoCGPMQAvD_BwE

So how exactly did you connect the esp-prog to your target board?

i connected same as the schematic on this page ESP32 WROOM-32 and JTAG timeout

and connector of my esp-prog : https://docs.platformio.org/en/latest/_images/esp-prog_jtag_connector.png

Okay, should be the same as in Low-cost ESP32 In-circuit Debugging | by Manuel Bl. | Medium then.

If all cables are ok, the power supply is okay and the pinout is okay then I don’t see a problem. You might get help at Issues · espressif/openocd-esp32 · GitHub if you describe your problem.

It very much looks a wiring problem:

  • Make sure you power the ESP32 board independently (typically via the USB port), and not via ESP-Prog
  • Double and triple check that you have connected the correct pins
  • Use short wires and do not go via a breadboard
  • Don’t forget to connect GND of ESP32 board to GND of ESP-Prog
  • Ensure the GND pin on the ESP32 board is working (some board have an incorrectly labelled GND pin)

So i try my second board and it work …it was bad board …now i want to make my proper design and i want to know what i need to connect minimum to program the esp32 . Thanks

Hi,
had this bunch of problems too.

One possibility to resove this issue:

eading symbols from C:\Users\js\Documents\PlatformIO\Projects\ESP32_BreadboardDisplay.pio\build\wemos_d1_mini32_debug\firmware.elf…
PlatformIO Unified Debugger → Redirecting...
PlatformIO: debug_tool = esp-prog
PlatformIO: Initializing remote target…
Open On-Chip Debugger v0.11.0-esp32-20220706 (2022-07-06-15:48)
Licensed under GNU GPL v2
For bug reports, read
OpenOCD: Bug Reporting
adapter speed: 20000 kHz

In my case “wemos_d1_mini32”-board:

  1. Check, if your controller was not preloaded with code, which is using ESP32-GPIOs 12, 13,14,15. i.e. SPI-Settings etc.

→ Debugger will not run (see err-message above) !
→ specially launching this annoying “pioinit failure”-messagebox pointing to lauch.json!

  1. To avoid this issue, load i.e. the basic Blink-sample as dummy to overwrite the previous pin settings.

  2. Launch the debugger => runs!

  3. The message "Error: libusb_open() failed with “LIBUSB_ERROR_NOT_SUPPORTED” has to be regarded only as Info and is not the reason the debugger fails!

  4. Make shure, that there is no hardware connectetd to GPIOs 12, 13,14,15 !
    This may cause major instabillity launching the debugger…

  5. Touching by code (mostly in testphase!) in any way the debugger pins will result in crash or denial to restart the debug process :sleepy:.

Error: error during select: Unknown error
.pioinit:11: Error in sourced command file:
Remote communication error. Target disconnected.: Success.

To resolve that: Start 2nd VS/PIO-instance and upload the blinky sketch, you gain again control to run the debugger. For some reason the OpennOCD-Debug is not capable to overwrite destructive setups by resetting the device.

Unfortunately there is no meaningful information out there about this “strange” behavior, regarding this “feature” specially for newcomers.

The supplied error-messages, from debugger or PIO are really not helpful, too.

This is my working platform.ini:

[platformio]
default_envs = wemos_d1_mini32_debug*
#default_envs = wemos_d1_mini32*

[env]*
build_flags =
#-v
-D VERSION=1.2.3
-D DEBUG=1
-D LED_BUILT_IN=2

lib_deps = 		

###########################################
[env:wemos_d1_mini32]
platform = espressif32
board = wemos_d1_mini32
framework = arduino
lib_deps = ${env.lib_deps}

monitor_speed = 115200
upload_port = COM6
upload_protocol = esptool

###########################################*
[env:wemos_d1_mini32_debug]
platform = espressif32
board = wemos_d1_mini32 #esp32dev #
framework = arduino
build_type = debug
build_flags = -D DEBUG
lib_deps = ${env.lib_deps}
monitor_speed = 115200

;-- GeräteManager \USB-Geräte\DualRS232HS 1+2
debug_tool		= 	esp-prog 
debug_init_break 	= 	tbreak setup

upload_port 		=  	COM12  #second ftdi channel
upload_protocol 	=  	esp-prog
upload_speed 	=  	460800  ; 115200;921600

Hope this helps … :wink: