使用 openOCD调试问题

daya123
Posts: 12
Joined: Fri Jun 25, 2021 7:50 am

使用 openOCD调试问题

Postby daya123 » Fri Jun 25, 2021 8:01 am

开发板:ESP32-S2-saola-1_V1.2
开发环境安装方式:esp-idf-tools-setup-offline-2.8.exe
安装后是 v4.2版本
开发环境 :eclipse
使用j-link调试时出现以下问题,未找到原因:

Code: Select all

Open On-Chip Debugger  v0.10.0-esp32-20200709 (2020-07-09-08:54)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
adapter speed: 9600 kHz

Started by GNU MCU Eclipse
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : J-Link V9 compiled Dec 13 2019 11:14:50
Info : Hardware version: 9.20
Info : VTarget = 3.301 V
Info : clock speed 9600 kHz
Info : JTAG tap: esp32s2.cpu tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : esp32s2: Target halted, PC=0x400314A4, debug_reason=00000001
Info : Detected ESP32-S2 chip
Info : Listening on port 3333 for gdb connections
Info : accepting 'gdb' connection on tcp/3333
Error: No symbols for FreeRTOS
Error: esp32s2: DSR (8000CC13) indicates DIR instruction generated an exception!
Warn : esp32s2: Failed reading 5284 bytes at address 0x40030000
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)!
Warn : Failed to get flash mappings (-308)!
Error: esp32s2: DSR (8000CC13) indicates DIR instruction generated an exception!
Warn : esp32s2: Failed reading 5284 bytes at address 0x40030000
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: esp32s2: DSR (8000CC13) indicates DIR instruction generated an exception!
Warn : esp32s2: Failed reading 5284 bytes at address 0x40030000
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 to probe flash, size 0 KB
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

ESP_Gargamel
Posts: 786
Joined: Wed Nov 14, 2018 8:45 am

Re: 使用 openOCD调试问题

Postby ESP_Gargamel » Fri Jun 25, 2021 8:49 am

openocd 使用的命令及参数提供下,比如:openocd -f board/esp32s2-ftdi.cfg,你用的哪个 cfg,如果是自己写的,也提供下。
从你的 log 看有 stub 相关的,你是要用 jtag 烧录固件?

daya123
Posts: 12
Joined: Fri Jun 25, 2021 7:50 am

Re: 使用 openOCD调试问题

Postby daya123 » Fri Jun 25, 2021 9:12 am

你好,.cfg文件如下,修改了一点,只是把速率改成了9600,没啥影响,准备调试设备,并没有下载,另外环境在win10下面的eclipse
Attachments
jlink.png
jlink.png (33.61 KiB) Viewed 4407 times
esp32se.png
esp32se.png (72.39 KiB) Viewed 4407 times
cfg.png
cfg.png (47.05 KiB) Viewed 4407 times

ESP_Gargamel
Posts: 786
Joined: Wed Nov 14, 2018 8:45 am

Re: 使用 openOCD调试问题

Postby ESP_Gargamel » Fri Jun 25, 2021 12:32 pm

你先直接在终端里试一下基本的连接:
一个终端:openocd.exe -f interface/jlink.cfg -f target/esp32s2.cfg
另一个终端:xtensa-esp32s2-elf-gdb.exe,然后出现 (gdb) 后输入 target remote :3333
看下结果。

另外,建议使用带 FT2232 的 JTAG,如 https://docs.espressif.com/projects/esp ... guide.html

daya123
Posts: 12
Joined: Fri Jun 25, 2021 7:50 am

Re: 使用 openOCD调试问题

Postby daya123 » Mon Jun 28, 2021 11:42 am

今天这个突然能调试了,但是还是有错误,使用的是hello_wold例程调试,加了两个断点
Attachments
hello_world_main.png
hello_world_main.png (43.94 KiB) Viewed 4321 times
error2.png
error2.png (19.52 KiB) Viewed 4321 times
error1.png
error1.png (70.91 KiB) Viewed 4321 times

Who is online

Users browsing this forum: No registered users and 38 guests