GDB试图通过OpenOCD进行调试时断开连接

发布于 2025-02-04 22:36:59 字数 1981 浏览 4 评论 0原文

我在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",
            ],
        }
    ]
}

我不确定我在做什么错。任何帮助将不胜感激。

I'm on windows 10 trying to debug my bluepill (STM32f103C8) board using a stlink, openocd, and vscode. I get this pop up: "OpenOCD GDB Server Quit Unexpectedly. See gdb-server output for more details."

And this message in the terminal:

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...

My launch.json is as follows:

    "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",
            ],
        }
    ]
}

I'm not sure what I'm doing wrong. Any help would be greatly appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梨涡 2025-02-11 22:36:59

我弄清楚了我的问题,所以我想我会分享的,以防其他人有类似的问题。

启动时,Arm-None-Aebi-GDB正在崩溃。这是由于我缺少python27.dll。您需要安装Python 2.7,它必须是Python 2.7的X86版本,因为Windows的GNU ARM为X86。

非常奇怪的是,无需ARM-AEBI-GDB需要在2020年EOL时安装Python 2.7,但是我们在这里。我想在将来的某个版本中,Python 2.7依赖性将被删除。

I figured out my problem, so I figured I'd shared in case anyone else has similar issues.

arm-none-eabi-gdb was crashing at start up. This was due to me missing python27.dll. You need to have python 2.7 installed, and it has to be the x86 version of python 2.7 because gnu arm for windows is x86.

Its very odd that arm-none-eabi-gdb requires python 2.7 to be installed as it was EOL in 2020, but here we are. I imagine in some future release the python 2.7 dependency will be removed.

风筝有风,海豚有海 2025-02-11 22:36:59

埃德的答案是完全正确的。

另一种解决方案是:我最终遇到了同一问题,只是使用了较早版本的ARM嵌入式工具链(GCC-ARM-NONE-NONE-EABI-10.3-2021.10),然后让我的项目使用OpenOCD进行调试,以供Nucleo sTM32L476RG进行OpenOCD。

希望这会有所帮助。

Ed's answer is totally correct.

An alternative solution: I ended up running into the same issue and just went with an earlier version of the ARM Embedded Toolchain (gcc-arm-none-eabi-10.3-2021.10) and got my project to debug using OpenOCD for the Nucleo STM32L476RG.

Hope this helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文