[Linux] ESP-Prog gets disconnected when starting debug

Hey there,

I have a little problem and don’t really know where it comes from.
I’m using PIO with the esp-prog and an ESP32.
Since today everytime I start debugging the JTAG tty-device gets disconnected…

[ 1600.030259] ftdi_sio 1-14:1.1: device disconnected
[ 1600.338307] usb 1-14: new high-speed USB device number 19 using xhci_hcd
[ 1600.503975] usb 1-14: New USB device found, idVendor=0403, idProduct=6010
[ 1600.503977] usb 1-14: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 1600.503979] usb 1-14: Product: Dual RS232-HS
[ 1600.503980] usb 1-14: Manufacturer: FTDI
[ 1600.511720] ftdi_sio 1-14:1.0: FTDI USB Serial Device converter detected
[ 1600.511751] usb 1-14: Detected FT2232H
[ 1600.516384] usb 1-14: FTDI USB Serial Device converter now attached to ttyUSB0
[ 1600.519017] ftdi_sio 1-14:1.1: FTDI USB Serial Device converter detected
[ 1600.519044] usb 1-14: Detected FT2232H
[ 1600.524382] usb 1-14: FTDI USB Serial Device converter now attached to ttyUSB1
[ 1741.346396] usb 1-14: USB disconnect, device number 19
[ 1741.346559] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
[ 1741.346582] ftdi_sio 1-14:1.0: device disconnected
[ 1741.346700] ftdi_sio ttyUSB1: FTDI USB Serial Device converter now disconnected from ttyUSB1
[ 1741.346718] ftdi_sio 1-14:1.1: device disconnected

So I already checked if all user groups are set correctly and also my platformio.ini but everything seems fine.
The two ports are also displayed in PIO as long as I don’t start debugging.

PIO itself gives me the following:

Preparing firmware for debugging...
Processing az-delivery-devkit-v4:debug (board: az-delivery-devkit-v4; framework: arduino; platform: espressif32)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/az-delivery-devkit-v4.html
PLATFORM: Espressif 32 (2.0.0) > AZ-Delivery ESP-32 Dev Kit C V4
HARDWARE: ESP32 240MHz, 520KB RAM, 16MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
 - framework-arduinoespressif32 3.10004.201016 (1.0.4)
 - tool-esptoolpy 1.20600.0 (2.6.0)
 - toolchain-xtensa32 2.50200.80 (5.2.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 31 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <U8g2> 2.28.6
|   |-- <SPI> 1.0
|   |-- <Wire> 1.0.1
|-- <Arduino_JSON> 0.1.0
|-- <ESP32AnalogRead> 0.0.5
|-- <HTTPClient> 1.2
|   |-- <WiFi> 1.0
|   |-- <WiFiClientSecure> 1.0
|   |   |-- <WiFi> 1.0
|-- <MFRC522>
|   |-- <SPI> 1.0
|-- <SPI> 1.0
|-- <WiFi> 1.0
|-- <Wire> 1.0.1
Building in debug mode
Retrieving maximum program size .pio/build/az-delivery-devkit-v4:debug/firmware.elf
Checking size .pio/build/az-delivery-devkit-v4:debug/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=         ]   7.9% (used 41840 bytes from 532480 bytes)
Flash: [=======   ]  72.7% (used 953326 bytes from 1310720 bytes)
========================= [SUCCESS] Took 3.17 seconds =========================

Environment                  Status    Duration
---------------------------  --------  ------------
az-delivery-devkit-v4:debug  SUCCESS   00:00:03.173
========================= 1 succeeded in 00:00:03.173 =========================
undefinedOpen On-Chip Debugger  v0.10.0-esp32-20190708 (2019-07-08-11:03)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
none separate
adapter speed: 20000 kHz
Info : Configured 2 cores
esp32 interrupt mask on
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi_tdo_sample_edge falling"
Info : clock speed 20000 kHz
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : Listening on port 3333 for gdb connections
Reading symbols from /media/jan-niklas/Data/Daten/Arduino/PlatformIO Projects/DLA_client_ESP32_MT/.pio/build/az-delivery-devkit-v4:debug/firmware.elf...
done.
PlatformIO Unified Debugger -> http://bit.ly/pio-debug
PlatformIO: debug_tool = esp-prog
PlatformIO: Initializing remote target...
.pioinit:11: Error in sourced command file:
/dev/ttyUSB0: Datei oder Verzeichnis nicht gefunden. (File or Dir not found)

I hope someone has an idea where to look for the problem.

JNB

How do you power the target board? I hope not through the esp-prog adapter?

Hey, thanks for the reply…

Well, I tried different ways, over the esp-prog only, esp-prog and USB, over the 5V pin from external source (it’s a development board from az-delivery.de without Vin).

So maybe if the esp-prog is underdimensioned in means of it’s power supply capacity I bricked it, or something else is going on, because I had it already working before but now it stopped…

I’m having the same problem under similar circumstances, it worked yesterday, it doesn’t work now, and I haven’t changed anything. Did you manage to find a solution?

Hi,
I have the same problem today, so even if it is 1.5 year after the last reply, did you manage to find a solution ?

Well, I didn’t touched the esp-prog for the last 1,5 years xD

Anyway, I put it together and installed PIO today to test it.
After deliting the .cache and installing the correct USB-Driver for the ESP-Prog everything worked. (On Win10)

I also noted that it can lead to strange behavior if the VCC-Line of the JTAG is connected to the ESP32 if external power supply is provided (in my case via USB to the D1 R32 board)

So I can’t tell you why this happens, but I can tell you that it’s seems not to be a bricked ESP-Prog (at least in my case).

Hope you find a propper solution for you.

I tried different power configurations, and I could make it work using the USB line from my Adafruit Feather v2 to the VDD line (5V) of the ESP-PROG (USB powered). Also, it works using both USB ports of the ESP-PROG and my board, independently. In my case, using 2x USB seems more stable than 1 USB + VDD line (5V). I’ll continue the tests to see what is the best setup.