gpt4 book ai didi

c++ - eclipse : Error: init mode failed (unable to connect to the target)

转载 作者:行者123 更新时间:2023-12-02 10:23:36 26 4
gpt4 key购买 nike

我正在使用基于 Eclipse 的 STM32Cube IDE。我的代码中没有什么特别的,只是初始化一个板载 LED 并在无限循环中打开它。第一次构建和调试成功(LED 确实亮了),但第二次可以构建但无法调试。

这是我得到的错误。

>Open On-Chip Debugger 0.10.0+dev-00021-g524e8c8 (2019-06-12-13:13)
>Licensed under GNU GPL v2
>For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
none separate
>Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
>adapter speed: 8000 kHz
>adapter_nsrst_delay: 100
>Info : Listening on port 6666 for tcl connections
>Info : Listening on port 4444 for telnet connections
>Info : clock speed 8000 kHz
>Info : STLINK v2 JTAG v25 API v2 SWIM v0 VID 0x0483 PID 0x3748
>Info : using stlink api v2
>Info : Target voltage: 2.891943
>Error: init mode failed (unable to connect to the target)
>in procedure 'init'
>in procedure 'ocd_bouncer'

当我尝试 st-info --probe(在 Linux 上)时,我得到:

Found 1 stlink programmers
serial: 390069063058303044662143
openocd: "\x39\x00\x69\x06\x30\x58\x30\x30\x44\x66\x21\x43"
flash: 0 (pagesize: 0)
sram: 0
chipid: 0x0000
descr: unknown device

但在上传之前我得到了相关数据例如:

  flash: 131072 (pagesize: 1024)
sram: 20480
chipid: 0x0410
descr: F1 Medium-density device

无法再以任何方式将代码上传到微 Controller 。当我尝试新板时,它只适用于那个上传 - 在该板被杀死并且不再工作之后:(即使在重新启动后第一次上传程序仍然有效(LED 仍在闪烁),但不向 ST-LINK v2 报告。

我尝试重置为默认设置,但也无济于事。有没有人遇到过类似的问题?

最佳答案

Stackexchange 上找到解决方案.

当您忘记在 STM32CubeIDE 中配置调试端口并上传代码时,ST-Link 将停止工作,因为它正在等待调试器连接,但尚未定义。

您必须在 IDE 中分配 SYS 调试端口(配置文件 -> SYS -> 模式 -> 串行线): Setup image

您可以通过 ST-Link Utility 删除整个闪存来使您的 STM32 再次工作(我在 linux 中尝试过但不起作用,因为它不支持复位连接)。在 ST-Link Utility 中,转到设置 -> 模式 -> 重置连接。然后用ST-Link连接mcu并按住reset。之后在 ST-link 实用程序中单击“连接到目标”,您就可以删除它了。

关于c++ - eclipse : Error: init mode failed (unable to connect to the target),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57628401/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com