Setup debugger with ESP32 wrover

Hi all,
I am trying to use the debugger with the wrover as explained here

https://docs.platformio.org/en/latest/boards/espressif32/esp-wrover-kit.html#debugging

https://docs.platformio.org/en/latest/plus/debug-tools/ftdi.html#debugging-tool-ftdi

But I am lost… I downloaded the FTDI drivers X64 but I do not understand how to install them… The contents of the zip do not tell me anything

For now, I just made changes to my platformio.ini file

[env:esp-wrover-kit]
platform = espressif32
board = esp-wrover-kit
framework = arduino
monitor_speed = 115200
build_type = debug
debug_tool = ftdi

and I get this error

image

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/esp32-wrover.cfg is deprecated, and may be removed in a future release.
         If your board is ESP32-WROVER-KIT, use board/esp32-wrover-kit-1.8v.cfg instead.
2
Info : FreeRTOS creation
adapter speed: 5000 kHz

I’m not sure why one would need to install the official VCP drivers if they’re immediately overloaded by using Zadig + libusb… Did you just try Zadig?

In the Windows device manager, you can manually right-click on a device (here it should be the FTDI USB device) → “Update Driver” → select manual directory → point to the above folder. The inf and cat files are the driver description files

I did not try zadig, I am worried I screw something up and cannot program the device if I install the wrong drivers…

Nah, drivers can be arbitrarily reinstalled, I’ve done that many times. The changes made by Zadig can also be undone with the program itself.

I have tried libusb with zadig, did not change the error, and then I tried updating the drivers for the ones I downloaded (ftdi), and it sais The best drivers are already installed…

I also cannot program anymore after using zadig

CURRENT: upload_protocol = esptool
Looking for upload port...
Error: Please specify `upload_port` for environment or use global `--upload-port` option.
For some development platforms it can be a USB flash drive (i.e. /media/<user>/<device name>)
*** [upload] Explicit exit, status 1

How do I reverse the installation?? I could always use the upload_port parameter but I liked when it found it automatically

I reverted the changes in the driver ettings in device manager, but now I get this error when uploading

Uploading .pio\build\esp-wrover-kit\firmware.bin
esptool.py v3.0
Serial port 
Traceback (most recent call last):
  File "C:\Users\jcbsk\.platformio\packages\tool-esptoolpy\esptool.py", line 3969, in <module>
    _main()
  File "C:\Users\jcbsk\.platformio\packages\tool-esptoolpy\esptool.py", line 3962, in _main
    main()
  File "C:\Users\jcbsk\.platformio\packages\tool-esptoolpy\esptool.py", line 3551, in main
    esp = chip_class(each_port, initial_baud, args.trace)
  File "C:\Users\jcbsk\.platformio\packages\tool-esptoolpy\esptool.py", line 271, in __init__
    self._port = serial.serial_for_url(port)
  File "c:\users\jcbsk\.platformio\penv\lib\site-packages\serial\__init__.py", line 90, in serial_for_url
    instance.open()
  File "c:\users\jcbsk\.platformio\penv\lib\site-packages\serial\serialwin32.py", line 64, in open
    raise SerialException("could not open port {!r}: {!r}".format(self.portstr, ctypes.WinError()))
serial.serialutil.SerialException: could not open port '': FileNotFoundError(2, 'The system cannot find the path specified.', None, 3)
*** [upload] Error 1
======================================== [FAILED] Took 6.30 seconds ========================================
The terminal process "C:\Users\jcbsk\.platformio\penv\Scripts\platformio.exe 'run', '--target', 'upload'" terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

What kind of hardware do you use for debugging? Do you have a debug adapter like ESP-Prog or a separate FTDI board?

Your device manager screenshot shows that you have configured Silicon Labs CP2102N chip for libusb. This is USB-to-serial chip often found on ESP32 development board. This chip is used for the serial connection only and not suitable for debugging. But there might be additional devices not shown in your screenshot.

1 Like

I am using the ESP32-DEVKITC-VE from digikey, which is a ESP32-WROVER-E series.

This link Espressif ESP-WROVER-KIT — PlatformIO latest documentation
mentions that

Espressif ESP-WROVER-KIT has on-board debug probe and IS READY for debugging. You don’t need to use/buy external debug probe.

Fom what I understood, my board could be used as a standalone debugger given I install the right drivers.

But I am unsure of how I can return to previous driver configs, I tried all of zadig’s drivers and reverting back, it’s no use.

As far as I can tell, you have a simple development board without debug adapter. The ESP-WROVER-KIT would look like this:

https://www.espressif.com/en/products/hardware/esp-wrover-kit/overview

In order to debug your board, you will need to buy some sort of debug adapter, either a simple break-out board with an FTDI FT2232HL chip, an ESP-Prog or one of the supported JTAG adapters. Also see:

https://medium.com/@manuel.bl/low-cost-esp32-in-circuit-debugging-dbbee39e508b

1 Like

Nice! very good to know. I will get a ESP-PROG.

And is there a way I can revert the drivers to upload to it without the probe for now?

The procedure for removing WinUSB/libUBS driver for thedevice is described in the Zadig FAQ:

1 Like