ESP32-S3 USB-JTAG

daniSi
Posts: 22
Joined: Thu Dec 23, 2021 9:43 am

ESP32-S3 USB-JTAG

Postby daniSi » Sun Jan 16, 2022 3:04 pm

Dear,

I want to use a external ESP-Prog for debugging, but the esp does not respond. Following the datasheet the setup should be correct, with setting the GPIO3 pin high over a pull-up resistor. After running openocd with:

Code: Select all

openocd -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp32s3-ftdi.cfg
the output is following:

Code: Select all

Open On-Chip Debugger v0.11.0-esp32-20211220 (2021-12-20-15:45)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 20000 kHz

Warn : Interface already configured, ignoring
DEPRECATED! use 'adapter speed' not 'adapter_khz'
adapter speed: 5000 kHz

Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 5000 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: esp32s3.cpu0: IR capture error; saw 0x00 not 0x01
Warn : Bypassing JTAG setup events due to errors
Warn : target esp32s3.cpu0 examination failed
Warn : target esp32s3.cpu1 examination failed
Info : starting gdb server for esp32s3.cpu0 on 3333
Info : Listening on port 3333 for gdb connections
It seems if still the builtin debugger would be selected since running:

Code: Select all

openocd -f board/esp32s3-builtin.cfg
still works.

Additionally, I would like to know what is the disadvantage of using the builtin debugger? In openocd v0.10.0-esp32-20211111 I have received the message that its recommended to disable flash support, would this apply also to the USB-JTAG? However, this message has now disappeared in v0.11.

ESP_Sprite
Posts: 6417
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32-S3 USB-JTAG

Postby ESP_Sprite » Mon Jan 17, 2022 1:20 am

The JTAG controller is only connected to one port at the time (either the USB-serial-JTAG controller or the external JTAG port) and you'll need to burn an eFuse to change it over from one to the other.

I think the openocd message you got was because in the earlier version, flash support may not have been fully developed yet; the latter version most likely fixed that.

The disadvantages of USB-serial-JTAG I can think of is that in certain situations it may be a tad slower than external JTAG (but I wouldn't be surprised in daily use it's actually faster), and that it does not play nice with light sleep/deep sleep, as in, if that happens the entire USB device disappears rather than just the JTAG tap. The advantage is that you get one for free with every chip :)

daniSi
Posts: 22
Joined: Thu Dec 23, 2021 9:43 am

Re: ESP32-S3 USB-JTAG

Postby daniSi » Mon Jan 17, 2022 8:46 am

Thank you for the practical explanation of advantages/disadvantages, it was helpful.

About the selection I have looked to the eFuses and by default they have been on 0, so actually, already by default the external JTAG should be selected, correct?

STRAP_JTAG_SEL 0b0
DIS_USB_JTAG 0b0
DIS_USB_SERIAL_JTAG 0b0 (I guess is the DIS_PAD_JTAG)

after this I have burned the STRAP_JTAG_SEL to 1, but still the result is the same, its connected to the builtin JTAG. Maybe some other idea?

ESP_Sprite
Posts: 6417
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32-S3 USB-JTAG

Postby ESP_Sprite » Mon Jan 17, 2022 8:54 am

See the ESP32S3 TRM; if you enable that efuse, you should be able to use GPIO3 as a bootstrap pin to switch between the two. You probably want to hit EFUSE_DIS_USB_JTAG if you want to permanently switch to external JTAG.

daniSi
Posts: 22
Joined: Thu Dec 23, 2021 9:43 am

Re: ESP32-S3 USB-JTAG

Postby daniSi » Mon Jan 17, 2022 11:42 am

This was my purpose to select over GPIO3 with a pullup, as it was also described in my first post, therefore is there something else which should be set, apart from the eFuse pins and the GPIO3? Thank you

Who is online

Users browsing this forum: No registered users and 10 guests