2025-07-03 4:23 PM - last edited on 2025-07-09 2:26 AM by Andrew Neil
Sorry if this is extremely basic, as part of our program we had to install(?) RTOS on our boards to do some of the labs, but we had to reinstall ST-Link after. Now the board refuses to debug. I'm getting these logs:
xPack Open On-Chip Debugger 0.12.0+dev-01850-geb6f2745b-dirty (2025-02-07-10:08)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
DEPRECATED! use 'gdb port', not 'gdb_port'
DEPRECATED! use 'telnet port', not 'telnet_port'
DEPRECATED! use 'tcl port' not 'tcl_port'
Info : auto-selecting first available session transport "dapdirect_swd". To override use 'transport select <transport>'.
adapter speed: 100 kHz
Started by GNU MCU Eclipse
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : STLINK V2J45M31 (API v2) VID:PID 0483:374B
Info : Target voltage: 3.217255
Error: Unable to set adapter speed
Info : clock speed 100 kHz
Error: SRST error
Info : stlink_dap_op_connect(connect)
Info : SWD DPIDR 0x2ba01477
Error: Fail reading CTRL/STAT register. Force reconnect
Error: [stm32f4x.cpu] Examination failed
Warn : target stm32f4x.cpu examination failed
Info : [stm32f4x.cpu] starting gdb server on 3333
Info : Listening on port 3333 for gdb connections
Info : accepting 'gdb' connection on tcp/3333
Error: Target not examined yet
Error: [stm32f4x.cpu] Execution of event gdb-attach failed:
Error: Target not examined yet
Error: auto_probe failed
Error: Connect failed. Consider setting up a gdb-attach event for the target to prepare target for GDB connect, or use 'gdb_memory_map disable'.
Error: attempted 'gdb' connection rejected
shutdown command invoked
Error in final launch sequence
Failed to execute MI command:
-target-select remote localhost:3333
Error message from debugger back end:
Remote communication error. Target disconnected: error while reading: Connection reset by peer.
Failed to execute MI command:
-target-select remote localhost:3333
Error message from debugger back end:
Remote communication error. Target disconnected: error while reading: Connection reset by peer.
Remote communication error. Target disconnected: error while reading: Connection reset by peer.
2025-07-03 5:40 PM
> Started by GNU MCU Eclipse
It looks like you're not using CubeIDE (which includes the proper version of OpenOCD).
2025-07-03 9:53 PM
I tend to agree to Pavel A.
It looks like some issue with the OpenOCD version.
I don't have experience with MCU Eclipse, although I tried it years ago.
OTOH, I recently flashed NuttX firmware to some STM32 boards under Linux, using OpenOCD, which worked well.
Perhaps you could try to 'convert' the ST-Link into a JLink with the firmware available on Segger's website, assuming MCU Eclipse supports JLink debug pods.
This step is reversible, by the way.