我该怎么才能查看到 寄存器的值

yogi_yi
Posts: 65
Joined: Tue May 25, 2021 11:02 am

我该怎么才能查看到 寄存器的值

Postby yogi_yi » Thu Jul 22, 2021 9:11 am

我在 VSCODE 中
Type "apropos word" to search for commands related to "word".
(gdb) x/8x 0x3F409000
0x3f409000: Cannot access memory at address 0x3f409000

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

Re: 我该怎么才能查看到 寄存器的值

Postby ESP_Gargamel » Fri Jul 23, 2021 3:06 am

猜你说的是 S2,但你最好告知一下是哪个芯片的。
在 openocd 的窗口有无相关 error log?试了下 S2,没有遇到问题:

Code: Select all

(gdb) x/8x 0x3F409000
0x3f409000:	0x000027ff	0x00000b00	0x00000a00	0x00000a00
0x3f409010:	0x00000800	0x00000800	0x00000800	0x00000800

yogi_yi
Posts: 65
Joined: Tue May 25, 2021 11:02 am

Re: 我该怎么才能查看到 寄存器的值

Postby yogi_yi » Wed Aug 25, 2021 10:46 am

我再VSCODE 中执行,没有出现,是需要做什么相关设置吗

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

Re: 我该怎么才能查看到 寄存器的值

Postby ESP_Gargamel » Thu Aug 26, 2021 1:47 am

你这没有出现是什么意思?你需要先保证 openocd 运行正常,在此基础上通过 gdb 就可以去读相关寄存器或地址的值。

yogi_yi
Posts: 65
Joined: Tue May 25, 2021 11:02 am

Re: 我该怎么才能查看到 寄存器的值

Postby yogi_yi » Thu Sep 02, 2021 7:18 am

ubuntu 中 VSCODE 环境

openocd sever 已经运行
在 terminal 下
(gdb) x/8x 0x3F409000
0x3f409000: Cannot access memory at address 0x3f409000

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

Re: 我该怎么才能查看到 寄存器的值

Postby ESP_Gargamel » Thu Sep 02, 2021 7:22 am

把你 openocd 的命令,以及 log 贴一下。

yogi_yi
Posts: 65
Joined: Tue May 25, 2021 11:02 am

Re: 我该怎么才能查看到 寄存器的值

Postby yogi_yi » Fri Sep 03, 2021 8:36 am

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: 20000 kHz

Warn : Interface already configured, ignoring
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
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: esp32s2.cpu tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : esp32s2: Debug controller 0 was reset.
Info : esp32s2: Core 0 was reset.
Info : Listening on port 3333 for gdb connections

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

Re: 我该怎么才能查看到 寄存器的值

Postby ESP_Gargamel » Fri Sep 03, 2021 9:05 am

1.png
1.png (283.57 KiB) Viewed 7327 times
右侧窗口 openocd -f board/esp32s2-kaluga-1.cfg
左侧窗口 idf.py gdbtui

yogi_yi
Posts: 65
Joined: Tue May 25, 2021 11:02 am

Re: 我该怎么才能查看到 寄存器的值

Postby yogi_yi » Fri Sep 03, 2021 9:53 am

我在 VSCODE 直接点击 Openocd 可以执行
在终端中 执行您给的
ubuntu:~/esp/esp_magnetic_designing$ idf.py openocd
Executing action: openocd
Note: OpenOCD cfg not found (via env variable OPENOCD_COMMANDS nor as a --openocd-commands argument)
OpenOCD arguments default to: "-f board/esp32s2-kaluga-1.cfg"
OpenOCD started as a background task 6621
Executing action: post_debug
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
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
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: esp32s2.cpu tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : Listening on port 3333 for gdb connections

另开终端 执行 idf.py gdbtui
出现
No Source Available

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

Re: 我该怎么才能查看到 寄存器的值

Postby ESP_Gargamel » Fri Sep 03, 2021 11:14 am

esp_magnetic_designing 是你的工程目录吗?需要在工程目录下编译烧录,然后再调试。

Who is online

Users browsing this forum: No registered users and 110 guests