init mode failed (unable to connect to the target)
我在尝试的时候突然弄得无法连接了
bash
WARNING: interface/stlink-v2-1.cfg is deprecated, please switch to interface/stlink.cfg
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select '.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 1000 kHz
Info : STLINK V2J37M26 (API v2) VID:PID 0483:374B
Info : Target voltage: 2.885933
Error: init mode failed (unable to connect to the target)
幸运的是通过 google 发现了下面这段
I had same situation on Ubuntu. I solved this, using STM32CubeProgrammer.
On the ST-LINK configuration area:
1.
Serial number -> refresh to get your stlink serial
2.
Mode: Under reset
3.
Reset mode: Core reset
try to connect asap when power your board. When you connect you can do "full chip erease". It suppose to be ready for next usage. I hope it helps