GDB在尝试通过openocd调试时断开连接



我在windows 10上尝试使用stlink, openocd和vscode调试我的bluepill (STM32f103C8)板。我得到这个弹出窗口:"OpenOCD GDB服务器意外退出。有关详细信息,请参阅gdb-server输出。">

和终端中的这条消息:

Open On-Chip Debugger 0.11.0 (2021-11-18) [https://github.com/sysprogs/openocd]
Licensed under GNU GPL v2
libusb1 09e75e98b4d9ea7909e8837b7a3f00dda4589dc3
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
CDRTOSConfigure
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : DEPRECATED target event trace-config; use TPIU events {pre,post}-{enable,disable}
Info : Listening on port 50001 for tcl connections
Info : Listening on port 50002 for telnet connections
Info : clock speed 1000 kHz
Info : STLINK V2J36S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.186911
Info : stm32f1x.cpu: Cortex-M3 r1p1 processor detected
Info : stm32f1x.cpu: target has 6 breakpoints, 4 watchpoints
Info : starting gdb server for stm32f1x.cpu on 50000
Info : Listening on port 50000 for gdb connections
[2022-06-07T02:43:25.028Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session closed
GDB server session ended. This terminal will be reused, waiting for next session to start...

我的发射。Json格式如下:

"version": "0.2.0",
"configurations": 
[
{
"name": "GDB",
"cwd": "${workspaceFolder}",
"executable": "./Test/Build/snake.elf",
"request": "launch",
"type": "cortex-debug",
"runToEntryPoint": "main",
"servertype": "openocd",
"device": "STM32f103C8",
"interface": "swd",
"configFiles": 
[
"interface/stlink.cfg",
"target/stm32f1x.cfg",
],
}
]
}

我不确定我做错了什么。如有任何帮助,我将不胜感激。

我发现了我的问题,所以我想我已经分享了,以防其他人有类似的问题。

arm-none-eabi-gdb启动时崩溃。这是由于我丢失了python27.dll。你需要安装python 2.7,并且它必须是python 2.7的x86版本,因为gnu arm for windows是x86。

arm-none-eabi-gdb需要安装python 2.7,因为它在2020年是EOL,这很奇怪,但我们在这里。我想在未来的某个版本中,python 2.7的依赖会被移除。

Ed的回答完全正确。

另一种解决方案:我最终遇到了同样的问题,只是使用了早期版本的ARM嵌入式工具链(gcc-arm-none-eabi-10.3-2021.10),并使用OpenOCD对Nucleo STM32L476RG进行了调试。

希望对你有帮助。

最新更新