gpt4 book ai didi

embedded - 为什么在尝试使用 openocd 连接 STLink-v2 时出现通信失败

转载 作者:行者123 更新时间:2023-12-05 02:44:17 31 4
gpt4 key购买 nike

我正在尝试使用 STLink-v2 连接到“stm32”“bluepill”以向其写入一些代码

每当我运行 openocd 时,它都无法连接我的 openocd.cfg 文件看起来像这样

source [find interface/stlink-v2.cfg]
source [find target/stm32f3x.cfg]

当我运行 openocd 时,这是我收到的响应:

Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 1000 kHz
adapter_nsrst_delay: 100
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
none separate
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : clock speed 950 kHz
Info : STLINK v2 JTAG v35 API v2 SWIM v7 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 3.166623
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f3x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 100ms
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f3x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 300ms
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f3x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 700ms
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f3x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 1500ms
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f3x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 3100ms
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f3x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 6300ms
^C

我之前在 bluepill 上为 stm32f103 编写了一些代码,当我连接到我的 PC 时,代码运行(它导致 pc13 上的 LED 闪烁)

我没有更改 openocd.cfg 文件,因为上次它运行良好

最佳答案

在 OpenOCD 尝试连接时按住重置按钮。

我在我的 STM32F3DISCOVERY 板上遇到了完全相同的错误。
这样做让我再次连接。

关于embedded - 为什么在尝试使用 openocd 连接 STLink-v2 时出现通信失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66533547/

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