I found this to be helpful. At least it got me far enough along to ask for more help.
I seem to be getting a JTAG connection, and connecting to the gdb app. However I seem to be failing to get a good connection to the processor. I am using a JLINK Plus Compact, with bare wires to a prototype board and a ESP32-U4WDH on a DevKit RevC Demo Board.
OpenOCD.cfg::
source [find interface/jlink.cfg]
set ESP32_FLASH_VOLTAGE 3.3
source [find board/esp32-u4wdh.cfg]
esp32-u4wdh.cfg::
transport select jtag
adapter_khz 1000
set ESP32_ONLYCPU 1
source [find target/esp32.cfg]
esp32.cfg is unchanged except for setting flash size if auto fails.
} else {
set _FLASH_SIZE 0x0400000
}
What I have for a JLINK definition is::
<!-- -->
<!-- Espressif ESP32 -->
<!-- -->
<Device>
<ChipInfo Vendor="Espressif" Name="ESP32-U4DWH" Core="Tensilica LX6" JLinkScriptFile="Devices/Espressif/ESP32-U4DWH.JLinkScript" />
<FlashBankInfo Name="Internal Flash" BaseAddr="0x3F400000" MaxSize="0x00400000" Loader="Devices/Maxim/MAX32600/MAX32600.FLM" LoaderType="FLASH_ALGO_TYPE_OPEN" AlwaysPresent="1"/>
</Device>
I do not have any expectation of the loader working, but I I was copying from another vendor part.
What I get with this is::
==================================================================================================
=
=
= OPENOCD OUTPUT
=
=
=================================================================================================
C:\Users\sbonomi\Desktop\esp-idf\simple>openocd
Open On-Chip Debugger v0.10.0-esp32-20190313 (2019-03-13-09:57)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 1000 kHz
adapter speed: 1000 kHz
Info : Configured 1 cores
esp32 interrupt mask on
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : J-Link V11 compiled Jun 9 2020 13:38:27
Info : Hardware version: 11.00
Info : VTarget = 3.341 V
Info : clock speed 1000 kHz
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : esp32: Debug controller 0 was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core 0 was reset (pwrstat=0x5F, after clear 0x0F).
Info : Listening on port 3333 for gdb connections
Info : accepting 'gdb' connection on tcp/3333
Error: No symbols for FreeRTOS
Info : Target halted. PRO_CPU: PC=0x4014A8D2
Info : Target halted. PRO_CPU: PC=0x4009171A
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 97 KB
Info : Flash mapping 1: 0x30018 -> 0x400d0018, 495 KB
Info : Target halted. PRO_CPU: PC=0x4009171A
Info : Auto-detected flash size 4096 KB
Info : Using flash size 4096 KB
Info : Target halted. PRO_CPU: PC=0x4009171A
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 97 KB
Info : Flash mapping 1: 0x30018 -> 0x400d0018, 495 KB
Info : Using flash size 496 KB
Info : Target halted. PRO_CPU: PC=0x4009171A
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 97 KB
Info : Flash mapping 1: 0x30018 -> 0x400d0018, 495 KB
Info : Using flash size 100 KB
Warn : negative reply, retrying
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Error: cpu0: xtensa_write_memory (line 802): DSR (FFFFFFFF) indicates target still busy!
Error: cpu0: xtensa_write_memory (line 802): DSR (FFFFFFFF) indicates DIR instruction generated an exception!
Error: cpu0: xtensa_write_memory (line 802): DSR (FFFFFFFF) indicates DIR instruction generated an overrun!
Warn : esp32: Failed writing 4 bytes at address 0x3ff48000, data - 00, 20, 49, 9c, 4c, 00, 00, 00
Error: xtensa_write_uint32_list: error writing to 3ff48000
Warn : esp32_soc_reset xtensa_write_uint32_list (reg_value_pairs_pre) err=-4
Info : xtensa_poll: Target offline
Error: xtensa_poll: Target failure
Polling target esp32 failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 100ms
Warn : xtensa_read_memory: esp32: target not halted
Warn : xtensa_read_memory: esp32: target not halted
Warn : xtensa_read_memory: esp32: target not halted
Warn : esp32: xtensa_resume: target not halted
Info : target esp32 was not halted when resume was requested
Error: xtensa_poll: Target failure
Error: xtensa_poll: Target failure
Warn : target esp32 is not halted (gdb fileio)
Error: FreeRTOS_update_threads not TARGET_HALTED!
Warn : xtensa_read_memory: esp32: target not halted
Error: Could not read FreeRTOS thread count from target
Polling target esp32 failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 300ms
Error: xtensa_poll: Target failure
Error: esp32: Failed to wait halted target to remove flash BPs (-305)!
Info : dropped 'gdb' connection
Info : accepting 'gdb' connection on tcp/3333
Error: FreeRTOS_update_threads not TARGET_HALTED!
Warn : xtensa_read_memory: esp32: target not halted
Error: Could not read FreeRTOS thread count from target
Error: xtensa_poll: Target failure
Warn : xtensa_read_memory: esp32: target not halted
Warn : xtensa_read_memory: esp32: target not halted
Error: FreeRTOS_update_threads not TARGET_HALTED!
Warn : xtensa_read_memory: esp32: target not halted
Error: Could not read FreeRTOS thread count from target
Warn : xtensa_read_memory: esp32: target not halted
Warn : xtensa_read_memory: esp32: target not halted
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
Error: xtensa_poll: Target failure
Error: xtensa_poll: Target failure
==================================================================================================
=
=
= GDB OUTPUT
=
=
=================================================================================================
C:\Users\sbonomi\Desktop\esp-idf\simple>xtensa-esp32-elf-gdb -x gdbinit build/simple.elf
GNU gdb (crosstool-NG esp-2019r2) 8.1.0.20180627-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <
http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-host_w64-mingw32 --target=xtensa-esp32-elf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<
http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<
http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from build/simple.elf...done.
0x4014a8d2 in esp_pm_impl_waiti () at C:/Users/sbonomi/Desktop/esp-idf/components/esp32/pm_esp32.c:484
484 asm("waiti 0");
JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
cpu0: xtensa_write_memory (line 802): DSR (FFFFFFFF) indicates target still busy!
cpu0: xtensa_write_memory (line 802): DSR (FFFFFFFF) indicates DIR instruction generated an exception!
cpu0: xtensa_write_memory (line 802): DSR (FFFFFFFF) indicates DIR instruction generated an overrun!
esp32: Failed writing 4 bytes at address 0x3ff48000, data - 00, 20, 49, 9c, 4c, 00, 00, 00
xtensa_write_uint32_list: error writing to 3ff48000
esp32_soc_reset xtensa_write_uint32_list (reg_value_pairs_pre) err=-4
xtensa_poll: Target offline
xtensa_poll: Target failure
Polling target esp32 failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 100ms
Hardware assisted breakpoint 1 at 0x400d6ecc: file ../main/main.c, line 909.
esp32: xtensa_resume: target not halted
target esp32 was not halted when resume was requested
xtensa_poll: Target failure
xtensa_poll: Target failure
[New Thread 1073463452]
[New Thread 1073538972]
[New Thread 1073542552]
[New Thread 1073474780]
[New Thread 1073468200]
[New Thread 1073486040]
[New Thread 1073412952]
[New Thread 1073526376]
[New Thread 1073479248]
[New Thread 1073453928]
Thread 1 received signal SIGINT, Interrupt.
[Switching to Thread 1073465436]
0x4014a8d2 in esp_pm_impl_waiti () at C:/Users/sbonomi/Desktop/esp-idf/components/esp32/pm_esp32.c:484
484 asm("waiti 0");
Thread 1 received signal SIGINT, Interrupt.
0x4014a8d2 in esp_pm_impl_waiti () at C:/Users/sbonomi/Desktop/esp-idf/components/esp32/pm_esp32.c:484
484 asm("waiti 0");
JTAG scan chain interrogation failed: all ones
Check JTAG interface, timings, target power, etc.
Trying to use configured scan chain anyway...
esp32.cpu0: IR capture error; saw 0x1f not 0x01
Bypassing JTAG setup events due to errors
xtensa_poll: Target failure
xtensa_poll: Target failure
xtensa_poll: Target failure
With the xtensa poll lines continuing forever
Suggestions appreciated