Page 1 of 1

JTAG debugging ESP32S3

Posted: Tue Jan 21, 2025 2:35 am
by dawime75
I have a new Linux install (Pop OS). I setup the esp-idf (v5.4.0) , and I am using the ESP32S3 DevKitC-1

The device instantiates a /dev/ttyACM0 device , which I can program if setup as UART
(output from the debug console in vscode):
esptool.py v4.8.1
Serial port /dev/ttyACM0
Connecting....
Chip is ESP32-S3 (QFN56) (revision v0.1)
Features: WiFi, BLE
Crystal is 40MHz
MAC: 60:55:f9:f5:21:d8
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Flash will be erased from 0x00000000 to 0x00005fff...
Flash will be erased from 0x00010000 to 0x00049fff...
Flash will be erased from 0x00008000 to 0x00008fff...
SHA digest in image updated
Compressed 21008 bytes to 13376...
Wrote 21008 bytes (13376 compressed) at 0x00000000 in 0.5 seconds (effective 326.7 kbit/s)...
Hash of data verified.
Compressed 235776 bytes to 125911...
Wrote 235776 bytes (125911 compressed) at 0x00010000 in 2.8 seconds (effective 667.2 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 103...
Wrote 3072 bytes (103 compressed) at 0x00008000 in 0.1 seconds (effective 384.6 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
I am trying to get the debugger running in vscode but was getting errors. Tried running on command line, but with the same error::
dawime@pop-os:~$ openocd -f board/esp32s3-builtin.cfg
Open On-Chip Debugger v0.12.0-esp32-20241016 (2024-10-16-14:17)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselecting 'jtag'
Info : esp_usb_jtag: VID set to 0x303a and PID to 0x1001
Info : esp_usb_jtag: capabilities descriptor set to 0x2000
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Error: libusb_open() failed with LIBUSB_ERROR_ACCESS
Error: esp_usb_jtag: could not find or open device!
/home/dawime/.espressif/tools/openocd-esp32/v0.12.0-esp32-20241016/openocd-esp32/share/openocd/scripts/target/esp_common.cfg:9: Error:
at file "/home/dawime/.espressif/tools/openocd-esp32/v0.12.0-esp32-20241016/openocd-esp32/share/openocd/scripts/target/esp_common.cfg", line 9

I have checked the VID/PID of the device, and they match the board configuration for the openocd app (see dmesg output):
[116313.159262] usb 1-4: new full-speed USB device number 17 using xhci_hcd
[116313.286802] usb 1-4: New USB device found, idVendor=303a, idProduct=1001, bcdDevice= 1.01
[116313.286821] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[116313.286828] usb 1-4: Product: USB JTAG/serial debug unit
[116313.286834] usb 1-4: Manufacturer: Espressif
[116313.286838] usb 1-4: SerialNumber: 60:55:F9:F5:21:D8
[116313.291701] cdc_acm 1-4:1.0: ttyACM0: USB ACM device
I believe I am doing everything right, but I cannot debug - I am probably missing something basic, but can't figure it out. Initially after installing I had to setup the groups to access /dev/ttyACM0, or I couldn't open the device, but after doing that I could program it, so I do not think its an access permission problem for /dev/ttyACM0.

Any suggestions on how to get this basic item working? I've attached the openocd log I got by running "openocd -l openocd_log.txt -d3 -f board/esp32s3-builtin.cfg"

Any help is appreciated. Thanks

Re: JTAG debugging ESP32S3

Posted: Tue Jan 21, 2025 7:41 am
by ESP_Sprite

Code: Select all

 Error: libusb_open() failed with LIBUSB_ERROR_ACCESS
 
Probably an udev permissions issue. See the last two lines here for the solution if that's the case.