ESP32 debug with Segger J-link debugger

Hello all,

hope someone can help.
I’m trying to debug an ESP32 devkitC_V4 board with a Segger J-Link Plus debugger.

I’ve followed several tutorials and made some steps, but now I’m unable to proceed.

The code I’m uploading on the board is the famous “Hello World” example.
I’ve been able to lower the connection speed down to 500kHz.
Changed the USB driver with Zadig

When I press F5 and start the debug, this is the outcome:

Open On-Chip Debugger  v0.10.0-esp32-20190708 (2019-07-08-11:04)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
adapter speed: 20000 kHz
Info : Configured 2 cores
esp32 interrupt mask on
adapter speed: 500 kHz
Info : tcl server disabled
Info : telnet server disabled
Info : J-Link V10 compiled Nov  2 2021 12:14:50
Info : Hardware version: 10.10
Info : VTarget = 3.303 V
Info : clock speed 500 kHz
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 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 : esp32: Debug controller 1 was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core 1 was reset (pwrstat=0x5F, after clear 0x0F).
Info : Detected debug stubs @ 3ffc0ca4 on core0 of target 'esp32'
Info : accepting 'gdb' connection from pipe
Error: No symbols for FreeRTOS
Info : Target halted. PRO_CPU: PC=0x400E90EE (active)    APP_CPU: PC=0x400E90EE 
Info : Target halted. PRO_CPU: PC=0x400916EE (active)    APP_CPU: PC=0x400E90EE 
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 45 KB
Info : Flash mapping 1: 0x20018 -> 0x400d0018, 100 KB
Info : Target halted. PRO_CPU: PC=0x400916EE (active)    APP_CPU: PC=0x400E90EE 
Info : Auto-detected flash size 8192 KB
Info : Using flash size 8192 KB
Info : Target halted. PRO_CPU: PC=0x400916EE (active)    APP_CPU: PC=0x400E90EE 
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 45 KB
Info : Flash mapping 1: 0x20018 -> 0x400d0018, 100 KB
Info : Using flash size 104 KB
Info : Target halted. PRO_CPU: PC=0x400916EE (active)    APP_CPU: PC=0x400E90EE 
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 45 KB
Info : Flash mapping 1: 0x20018 -> 0x400d0018, 100 KB
Info : Using flash size 48 KB
0x400e90ee in String::setLen (this=0x0, len=<optimized out>) at D:\Users\F14205D\.platformio\packages\framework-arduinoespressif32\cores\esp32/WString.h:277
277	        inline void setLen(int len) { if (isSSO()) sso.len = len; else ptr.len = len; }
Loading section .dram0.data, size 0x253c lma 0x3ffbdb60
Loading section .iram0.vectors, size 0x400 lma 0x40080000
Loading section .iram0.text, size 0xdb40 lma 0x40080400
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Error: cpu0: xtensa_write_memory (line 807): DSR (FFFFFFFF) indicates target still busy!
Error: cpu0: xtensa_write_memory (line 807): DSR (FFFFFFFF) indicates DIR instruction generated an exception!
Error: cpu0: xtensa_write_memory (line 807): 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




Error: cpu0: xtensa_read_memory (line 700): DSR (FFFFFFFF) indicates target still busy!
Error: cpu0: xtensa_read_memory (line 700): DSR (FFFFFFFF) indicates DIR instruction generated an exception!
Error: cpu0: xtensa_read_memory (line 700): DSR (FFFFFFFF) indicates DIR instruction generated an overrun!
Warn : cpu0: Failed reading 5848 bytes at address 0x40090000
Error: no working area available, can't alloc space for stub code!
Error: Failed to load stub (-308)!
Error: Algorithm run failed (-308)!
Error: Failed to run flasher stub (-308)!
Error: failed erasing sectors 0 to 11
Error: flash_erase returned -308
.pioinit:12: Error in sourced command file:
Error erasing flash with vFlashErase packet

Can anyone help me with these errors?

Thank you

Usually errors like this are either too high of a debug speed or some bad cables. Once I think I got rid of this by not connecting JTRST (Jtag reset).

If none of this help, file an issue at Issues · espressif/openocd-esp32 · GitHub.