Page 1 of 1

Unable to make debugging work in command line

Posted: Mon Mar 29, 2021 12:41 am
by beryllium
Hello,

I am a newbie to the MCU field. I did not find an answer in the forum to my problem, although several posts relate around the same problem, namely application debugging for ESP32. You will forgive me if my questions seem simplistic to you.

Here is my problem:
I'm desperately trying to turn on debug mode in command line mode and I always get the following output:

------------------------------------------------------------------------------------
openocd --file board / esp32-wrover-kit-3.3v.cfg
Open On-Chip Debugger v0.10.0-esp32-20200709 (2020-07-09-08: 54)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info: Configured 2 cores
Info: Listening on port 6666 for tcl connections
Info: Listening on port 4444 for telnet connections
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 20,000 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: Listening on port 3333 for gdb connections
------------------------------------------------------------------------------------
The console hangs as shown on the last line. The only way to escape is CTRL + C, which produces the following message: "shutdown command invoked"

I use a genuine espressif board ESP-WROVER-KIT model (card with display and microSD card reader). The board is connected via the USB port to a Windows 10 PC running VirtualBox 6.1. The esp-idf software is running on a VM (virtualbox). The host machine and the guest machine are both Windows 10 version 20H2. The USB device are well captured by the guest VM running esp-idf.

esp-idf software was installed using the windows tool: esp-idf-tools-setup-online-2.6.exe

The idf.py menuconfig, build, and flash commands work as expected; but it is impossible to enter in debug mode.
I have of course checked the configuration of the jumpers to enable JTAG mode as indicated in the documentation.

1 - What's wrong with libusb_open?
2 - what does mean this error: esp32.cpu0: IR capture error; saw 0x1f not 0x01


What mistake(s) did I make? Your help is welcome to get me out of this dead end.
Thank you


------------------------
Zadig output:

Zadig 2.5.730
Windows 10 64-bit (Build 19042)
ini file 'zadig.ini' not found in 'C:\Users\*****\Desktop' - default parameters will be used
default driver set to 'WinUSB'
0 devices found.
3 devices found.
libwdi:debug [wdi_create_list] Hardware ID: USB\VID_0403&PID_6010&REV_0700&MI_01
libwdi:debug [wdi_create_list] Compatible ID: USB\Class_ff&SubClass_ff&Prot_ff
libwdi:debug [wdi_create_list] Driver version: 2.12.28.0
libwdi:debug [wdi_create_list] FTDIBUS USB device (0): USB\VID_0403&PID_6010&MI_01\6&5E8EF3F&0&0001
libwdi:debug [wdi_create_list] Device description: 'Dual RS232-HS (Interface 1)'
libwdi:debug [wdi_create_list] Hardware ID: USB\VID_0403&PID_6010&REV_0700&MI_00
libwdi:debug [wdi_create_list] Compatible ID: USB\Class_ff&SubClass_ff&Prot_ff
libwdi:debug [wdi_create_list] Driver version: 6.1.7600.16385
libwdi:debug [wdi_create_list] WinUSB USB device (1): USB\VID_0403&PID_6010&MI_00\6&5E8EF3F&0&0000
libwdi:debug [wdi_create_list] Device description: 'Dual RS232-HS (Interface 0)'
libwdi:debug [wdi_create_list] Hardware ID: USB\VID_80EE&PID_0021&REV_0100
libwdi:debug [wdi_create_list] Compatible ID: USB\Class_03&SubClass_00&Prot_00
libwdi:debug [wdi_create_list] Driver version: 10.0.19041.868
libwdi:debug [wdi_create_list] HidUsb USB device (4): USB\VID_80EE&PID_0021\5&D788E13&0&1
libwdi:debug [wdi_create_list] Device description: 'USB Tablet'

The device manager shows 2 devices:
a) an usb serial associated to a com port ( COM4 ) FTDIBUS\COMPORT&VID_0403&PID_6010,
Device ID: FTDIBUS\COMPORT&VID_0403&PID_6010&MI_01

b) an usb serial bus device not connected to a com port labeled "Dual RS232-HS (Interface 0)"
Device ID: USB\VID_0403&PID_6010&REV_0700&MI_00

Re: Unable to make debugging work in command line

Posted: Mon Mar 29, 2021 2:43 am
by ESP_Sprite
The libusb_open call may be because OpenOCD sees a different device in your computer it thinks it may be able to open, but it fails. The actual libusb_open on your board seems to have worked, as OpenOCD continues afterwards. ' Error: JTAG scan chain interrogation failed: all ones' in general means there's something wrong with the JTAG connection between the JTAG adapter or chip and the ESP32. Generally, this is either incorrect wiring / jumper settings, or your ESP32 could have a program running that re-uses the JTAG pins (GPIO12-15) for different purposes, disabling the JTAG functionality.

Re: Unable to make debugging work in command line

Posted: Mon Mar 29, 2021 10:16 pm
by beryllium
Hello ESP-Sprite,
This is it, it is working. I have reviewed the jumpers and followed the documentation to the letter by not setting the jumpers for RTS / CTS flow control. For the other jumpers, I haven't changed anything. I don't understand why these 2 jumpers have an effect on the JTAG path, but removing them fixes the problem.
Now I will be able to move forward in my practice with this MCU.
Thank you again for your help.

Re: Unable to make debugging work in command line

Posted: Tue Mar 30, 2021 4:38 am
by ESP_Sprite
That's odd indeed... perhaps a more likely explanation is you messing with the jumpers happened to fix a bad contact? That sometimes happens.

Re: Unable to make debugging work in command line

Posted: Wed Mar 31, 2021 4:27 pm
by beryllium
I wanted to be clear about this, so I put the CTS / RTS jumpers back on, and indeed with this hardware setting the JTAG port is not accessible! By putting the jumpers, we can see on ESP-WROVER-KIT V4.1 schematic that a connection is established between CTS and TCK on the one hand and RTS and TDO on the other hand. The doc is clear, do not connect these jumpers.
Initial_setup.png
Initial_setup.png (273.69 KiB) Viewed 4465 times

Re: Unable to make debugging work in command line

Posted: Thu Apr 01, 2021 1:29 am
by ESP_Sprite
Ah gotcha, I didn't realize cts/rts doubled as tdo/tck.