2

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

以前に にいくつかのコードを書いていstm32f103ましたbluepillが、PC に接続するとコードが実行されます (pc13 の LED が点滅します)。

openocd.cfg ファイルが最後に正常に機能したときは変更していません。

4

1 に答える 1

3

OpenOCD が接続を試みている間、リセット ボタンを押し続けます。

STM32F3DISCOVERY ボードでまったく同じエラーが発生しました。
これを行うと、再び接続できるようになりました。

于 2021-06-21T01:34:17.310 に答える