ESP32-S3 USB-JTAG

daniSi
Posts: 47
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: 9769
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: 47
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: 9769
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: 47
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

ifoxbr
Posts: 8
Joined: Mon Jun 20, 2022 1:48 pm

Re: ESP32-S3 USB-JTAG

Postby ifoxbr » Thu Aug 18, 2022 1:19 pm

Hi DaniSi
Were you able to use esp-prog (external Jtag) with ESP32S3 ? Which USB driver did you use to connect both the internal and external Jtag? Are you using GPIO3 to select or burned eFuse?

Regards

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

Re: ESP32-S3 USB-JTAG

Postby daniSi » Thu Oct 06, 2022 7:31 am

Hi ifoxbr,

I have burned the fuses and use now the external jtag. To make it work i have burned the fuses as followed:

Code: Select all

espefuse.py --port COM4 burn_efuse DIS_USB_JTAG

ifoxbr
Posts: 8
Joined: Mon Jun 20, 2022 1:48 pm

Re: ESP32-S3 USB-JTAG

Postby ifoxbr » Wed Oct 19, 2022 2:08 pm

Hi DaniSi
Thanks for response
One more question, how was your configuration file "settings.json" on tags as shown below ?

  1.     "idf.openOcdConfigs": [
  2.         "board/esp32s3-builtin.cfg"
  3.     ],
  4.     "idf.portWin": "COM12",
  5.     "idf.pythonBinPathWin": "C:\\Espressif\\python_env\\idf5.0_py3.8_env\\Scripts\\python.exe",
  6.     "idf.toolsPathWin": "C:\\Espressif",
  7.     "idf.flashType": "JTAG",

Who is online

Users browsing this forum: Bing [Bot] and 88 guests