ESP32 WROOM 32D + JLink JTAG + Debugging not working
Posted: Thu Jul 07, 2022 7:15 pm
Hello,
I am pretty new to ESP32 platform and I am currently working of another person's development who have completely depended on the UART to debug. I prefer if I am able to do inline debugging. I am hoping someone can point me on my mistake here to get this working.
I followed the instructions as per https://mcuoneclipse.com/2019/09/22/ecl ... r-j-link/ .
My OpenOCD is version: v0.10.0-esp32-20210401
My GDB is version GNU gdb (crosstool-NG esp-2021r1) 8.1.0.20180627-git
The problem occurs when while running the OpenOCD, the GDB hardware debugging fails.
The error occurs,when I start the xtensa-esp32-elf-gdb -x gdbinit build/gateway.elf:
The gdbinit file look like this:
This is the OpenOCD log:
And when I run the openocd with app memory offset, the OpenOCD crashed before i can even ran gdb:
I ran the same call for OpenOCD as above without the halt:
I am pretty new to ESP32 platform and I am currently working of another person's development who have completely depended on the UART to debug. I prefer if I am able to do inline debugging. I am hoping someone can point me on my mistake here to get this working.
I followed the instructions as per https://mcuoneclipse.com/2019/09/22/ecl ... r-j-link/ .
My OpenOCD is version: v0.10.0-esp32-20210401
My GDB is version GNU gdb (crosstool-NG esp-2021r1) 8.1.0.20180627-git
The problem occurs when while running the OpenOCD, the GDB hardware debugging fails.
The error occurs,when I start the xtensa-esp32-elf-gdb -x gdbinit build/gateway.elf:
The gdbinit file look like this:
Code: Select all
target remote :3333
set remote hardware-watchpoint-limit 2
mon reset halt
flushregs
htb app_main
c
Code: Select all
esp32@esp32-kubuntu-22:~/.espressif/tools/openocd-esp32/v0.10.0-esp32-20210401/openocd-esp32/share/openocd/scripts/interface$ openocd -f interface/jlink.cfg -f board/esp-wroom-32.cfg
Open On-Chip Debugger v0.10.0-esp32-20210401 (2021-04-01-15:45)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 4000 kHz
WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release.
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : J-Link Ultra V4 compiled Mar 7 2019 15:19:46
Info : Hardware version: 4.00
Info : VTarget = 3.282 V
Info : clock speed 4000 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.cpu0: Debug controller was reset.
Info : esp32.cpu0: Core was reset.
Info : Listening on port 3333 for gdb connections
Info : esp32.cpu0: Debug controller was reset.
Info : esp32.cpu0: Core was reset.
Info : esp32.cpu0: Debug controller was reset.
Info : esp32.cpu0: Core was reset.
Info : esp32.cpu0: Debug controller was reset.
Info : esp32.cpu0: Core was reset.
Info : esp32.cpu0: Debug controller was reset.
Info : esp32.cpu0: Core was reset.
Info : esp32.cpu0: Debug controller was reset.
Info : esp32.cpu0: Core was reset.
Info : esp32.cpu0: Debug controller was reset.
Info : esp32.cpu0: Core was reset.
Info : accepting 'gdb' connection on tcp/3333
Warn : No symbols for FreeRTOS!
Error: Target not examined yet
Error executing event gdb-attach on target esp32.cpu0:
Error: Target not halted
Error: auto_probe failed
Error: Connect failed. Consider setting up a gdb-attach event for the target to prepare target for GDB connect, or use 'gdb_memory_map disable'.
Error: attempted 'gdb' connection rejected
Code: Select all
esp32@esp32-kubuntu-22:~/.espressif/tools/openocd-esp32/v0.10.0-esp32-20210401/openocd-esp32/share/openocd/scripts/interface$ openocd -f interface/jlink.cfg -f board/esp-wroom-32.cfg -c "init; halt; esp appimage_offset 0x20000"
Open On-Chip Debugger v0.10.0-esp32-20210401 (2021-04-01-15:45)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 4000 kHz
WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release.
Info : J-Link Ultra V4 compiled Mar 7 2019 15:19:46
Info : Hardware version: 4.00
Info : VTarget = 3.289 V
Info : clock speed 4000 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 : Listening on port 3333 for gdb connections
Error: Target not examined yet
Code: Select all
esp32@esp32-kubuntu-22:~/.espressif/tools/openocd-esp32/v0.10.0-esp32-20210401/openocd-esp32/share/openocd/scripts/interface$ openocd -f interface/jlink.cfg -f board/esp-wroom-32.cfg -c "init; esp appimage_offset 0x20000"
Open On-Chip Debugger v0.10.0-esp32-20210401 (2021-04-01-15:45)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 4000 kHz
WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release.
Info : J-Link Ultra V4 compiled Mar 7 2019 15:19:46
Info : Hardware version: 4.00
Info : VTarget = 3.282 V
Info : clock speed 4000 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 : Listening on port 3333 for gdb connections
Info : esp32.cpu0: Debug controller was reset.
Info : esp32.cpu0: Core was reset.
Error: Target not halted
Error: auto_probe failed
Error: Failed to find bank 'esp32.cpu0.irom'!