ESP-Prog cannot connect to ESP32-S3

rtborg
Posts: 67
Joined: Wed Oct 23, 2019 6:15 am

ESP-Prog cannot connect to ESP32-S3

Postby rtborg » Fri Jan 27, 2023 10:06 pm

openocd complains, but the connections appear fine. GPIO3 is pulled to 3.3V. I can't connect via USB to JTAG either.
Where should I look for the cause?
I am also attaching fuse dump.

Code: Select all

junk@yard:~/.espressif/tools/openocd-esp32/v0.11.0-esp32-20221026/openocd-esp32$ ./bin/openocd -f share/openocd/scripts/board/esp32s3-ftdi.cfg 
Open On-Chip Debugger v0.11.0-esp32-20221026 (2022-10-26-14:47)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
adapter speed: 1000 kHz

Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 1000 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
Error: [esp32s3.cpu0] Unexpected OCD_ID = 00000000
Warn : target esp32s3.cpu0 examination failed
Error: [esp32s3.cpu1] Unexpected OCD_ID = 00000000
Warn : target esp32s3.cpu1 examination failed
Info : starting gdb server for esp32s3.cpu0 on 3333
Info : Listening on port 3333 for gdb connections
Attachments
fuses.txt
(14.5 KiB) Downloaded 254 times

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

Re: ESP-Prog cannot connect to ESP32-S3

Postby ESP_Sprite » Sat Jan 28, 2023 3:43 am

If you didn't modify the fuses, the S3 will connect via the USB-serial-JTAG by default. What error do you get when trying to connect via that?

rtborg
Posts: 67
Joined: Wed Oct 23, 2019 6:15 am

Re: ESP-Prog cannot connect to ESP32-S3

Postby rtborg » Sat Jan 28, 2023 8:08 am

The fuse USB_PHY_SEL has been set to True, so trying to connect to USB-JTAG results in:

Code: Select all

 ./bin/openocd -f board/esp32s3-builtin.cfg
Open On-Chip Debugger v0.11.0-esp32-20221026 (2022-10-26-14:47)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
Info : esp_usb_jtag: VID set to 0x303a and PID to 0x1001
Info : esp_usb_jtag: capabilities descriptor set to 0x2000
Warn : Transport "jtag" was already selected
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Error: esp_usb_jtag: could not find or open device!

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

Re: ESP-Prog cannot connect to ESP32-S3

Postby ESP_Sprite » Sun Jan 29, 2023 2:32 am

From what I can tell, that fuse only selects the USB signal source. To divert JTAG to the pads, you need to burn EFUSE_DIS_USB_JTAG.

HopWorks
Posts: 8
Joined: Mon Sep 03, 2018 8:56 pm

Re: ESP-Prog cannot connect to ESP32-S3

Postby HopWorks » Sun Jan 29, 2023 7:58 pm

According to your fuse dump, the fuse for switching internal/external JTAG through GPIO3 is set to false, which I assume means it has not been burned.

Code: Select all

STRAP_JTAG_SEL (BLOCK0)                            Enable selection between usb_to_jtagor pad_to_jtag = False R/W (0b0)
                                                    through GPIO3                                    
This is the fuse I want to burn so I can switch between both options. I do not want to permanently disable the internal JTAG by burning EFUSE_DIS_USB_JTAG. Problem is, I do not see that fuse in my list and I am using ESP32-S3-WROOM-1U P1N8R8.

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

Re: ESP-Prog cannot connect to ESP32-S3

Postby ESP_Sprite » Mon Jan 30, 2023 12:16 am

I seem to recall that feature was broken on the S3, hence you're not seeing that option.

rtborg
Posts: 67
Joined: Wed Oct 23, 2019 6:15 am

Re: ESP-Prog cannot connect to ESP32-S3

Postby rtborg » Mon Jan 30, 2023 9:54 am

@ESP_Sprite,thank you for the input - I burned fuse DIS_USB_JTAG and now I can connect to ESP32S3 using ESP-Prog. Flashing over JTAG works.

I still have one issue. I am starting openocd from a terminal using `openocd -c 'set ESP_RTOS none' -f board/esp32s3-ftdi.cfg`, and then starting GDB from VS Code. It appears that GDB can connect to openocd fine, however when I set a breakpoint anywhere in code, VS Code shows a red message "Exception has occurred" and the code jumps into panic_abort() function. Do you have any idea how I could fix that?

Code: Select all

openocd -c 'set ESP_RTOS none' -f board/esp32s3-ftdi.cfg
Open On-Chip Debugger  v0.11.0-esp32-20220706 (2022-07-06-15:48)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
none
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 20000 kHz
Info : JTAG tap: esp32s3.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32s3.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : [esp32s3.cpu0] Target halted, PC=0x40000400, debug_reason=00000000
Info : [esp32s3.cpu1] Target halted, PC=0x40000400, debug_reason=00000000
Info : starting gdb server for esp32s3.cpu0 on 3333
Info : Listening on port 3333 for gdb connections
Info : accepting 'gdb' connection on tcp/3333
Info : [esp32s3.cpu0] Target halted, PC=0x403B2482, debug_reason=00000001
Info : Set GDB target to 'esp32s3.cpu0'
Info : Flash mapping 0: 0x10020 -> 0x3c030020, 56 KB
Info : Flash mapping 1: 0x20020 -> 0x42000020, 155 KB
Info : [esp32s3.cpu0] Target halted, PC=0x403B2482, debug_reason=00000001
Info : Auto-detected flash bank 'esp32s3.cpu0.flash' size 8192 KB
Info : Using flash bank 'esp32s3.cpu0.flash' size 8192 KB
Info : [esp32s3.cpu0] Target halted, PC=0x403B2482, debug_reason=00000001
Info : Flash mapping 0: 0x10020 -> 0x3c030020, 56 KB
Info : Flash mapping 1: 0x20020 -> 0x42000020, 155 KB
Info : Using flash bank 'esp32s3.cpu0.irom' size 156 KB
Info : [esp32s3.cpu0] Target halted, PC=0x403B2482, debug_reason=00000001
Info : Flash mapping 0: 0x10020 -> 0x3c030020, 56 KB
Info : Flash mapping 1: 0x20020 -> 0x42000020, 155 KB
Info : Using flash bank 'esp32s3.cpu0.drom' size 60 KB
Info : New GDB Connection: 1, Target esp32s3.cpu0, state: halted
Info : JTAG tap: esp32s3.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32s3.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : [esp32s3.cpu0] requesting target halt and executing a soft reset
Info : [esp32s3.cpu0] Debug controller was reset.
Info : [esp32s3.cpu0] Core was reset.
Info : [esp32s3.cpu0] Target halted, PC=0x500000EF, debug_reason=00000000
Info : [esp32s3.cpu1] requesting target halt and executing a soft reset
Info : [esp32s3.cpu0] Core was reset.
Info : [esp32s3.cpu0] Target halted, PC=0x40000400, debug_reason=00000000
Info : [esp32s3.cpu1] Debug controller was reset.
Info : [esp32s3.cpu1] Core was reset.
Info : [esp32s3.cpu1] Target halted, PC=0x40000400, debug_reason=00000000
Info : [esp32s3.cpu1] Debug controller was reset.
Info : [esp32s3.cpu1] Core was reset.
Info : esp32s3.cpu0: Detected debug stubs @ 3fc971f8
Info : [esp32s3.cpu0] Target halted, PC=0x40379EFE, debug_reason=00000000
Info : Set GDB target to 'esp32s3.cpu0'
Info : [esp32s3.cpu1] Target halted, PC=0x40379EFE, debug_reason=00000000
Warn : Not full dbg stub table 1 of 3
Warn : Not full dbg stub table 1 of 3
Info : [esp32s3.cpu0] Target halted, PC=0x40375E41, debug_reason=00000001
Info : Set GDB target to 'esp32s3.cpu0'

Who is online

Users browsing this forum: Majestic-12 [Bot] and 77 guests