This bug is already fixed upstream with patch https://review.openocd.org/6443 
merged last August.
Please update to a more recent version of OpenOCD


---

** [tickets:#325] ST-LINK V3 fails to connect to an STM8 target**

**Status:** new
**Milestone:** 0.11.0
**Created:** Sat Nov 13, 2021 04:31 AM UTC by Arseny Vakhrushev
**Last Updated:** Sat Nov 13, 2021 04:31 AM UTC
**Owner:** nobody


An ST-LINK V3 probe fails to work with an STM8 target. Two distinct probes were 
tested, and the issue appears to be OpenOCD-related. The probes work well with 
STM8 if the original ST utilities are used on Windows.

Please consider the following output on Arch Linux:
~~~
$ openocd -f /usr/share/openocd/scripts/interface/stlink-dap.cfg -f 
/usr/share/openocd/scripts/target/stm8s.cfg
Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
srst_only separate srst_gates_jtag srst_open_drain connect_deassert_srst

Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : STLINK V3J8M3B5S1 (API v3) VID:PID 0483:3753
Info : Target voltage: 3.282777
Error: Unable to set adapter speed
Error: stlink_swim_enter_failed (unable to connect to the target)
~~~

If repeated, the same command produces a slightly different error:
~~~
$ openocd -f /usr/share/openocd/scripts/interface/stlink-dap.cfg -f 
/usr/share/openocd/scripts/target/stm8s.cfg
Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
srst_only separate srst_gates_jtag srst_open_drain connect_deassert_srst

Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : STLINK V0J12S3 (API v0) VID:PID 0000:0000  <----------------- Incorrect 
device info!!!
Error: init mode failed (unable to connect to the target)
~~~

Please note that the probe works with STM32 targets without any issues:
~~~
$ openocd -f /usr/share/openocd/scripts/interface/stlink-dap.cfg -f 
/usr/share/openocd/scripts/target/stm32f1x.cfg
Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "dapdirect_swd". To 
override use 'transport select <transport>'.
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : STLINK V3J8M3B5S1 (API v3) VID:PID 0483:3753
Info : Target voltage: 3.282777
Info : clock speed 1000 kHz
Info : stlink_dap_op_connect(connect)
Info : SWD DPIDR 0x1ba01477
Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for stm32f1x.cpu on 3333
Info : Listening on port 3333 for gdb connections
^C
~~~



---

Sent from sourceforge.net because [email protected] is 
subscribed to https://sourceforge.net/p/openocd/tickets/

To unsubscribe from further messages, a project admin can change settings at 
https://sourceforge.net/p/openocd/admin/tickets/options.  Or, if this is a 
mailing list, you can unsubscribe from the mailing list.


Reply via email to