Issues on Debugging External Application Using ST-Link
Hi,
I am trying to debug an external application with an ST-Link coming together with my Nucleo-G070RB board. I tried all three available debugger probes in CubeIDE: ST-Link (Open-OCD), ST-Link (ST-Link GDB Server), and Segger J-Link. they all failed.
The pins used for connecting the external application and ST-Link: VDD from target, GND, SWDIO, SWDCLK, Reset
The console messages when setting the debugger probe to ST-Link (Open-OCD:(
At debug start:

after clicking on Step-Over:
Error: Fail reading CTRL/STAT register. Force reconnect
Error: Fail reading CTRL/STAT register. Force reconnect
Warn : target STM32F103ZETx.cpu is not halted (gdb fileio)
Polling target STM32F103ZETx.cpu failed, trying to reexamine
Error: Fail reading CTRL/STAT register. Force reconnect
Examination failed, GDB will be halted. Polling again in 100ms
... ...
The console messages when setting the debugger probe to ST-Link (ST-Link GDB Server:(

The console messages when setting the debugger probe to Segger J-Link :
SEGGER J-Link GDB Server V7.92n Command Line Version
JLinkARM.dll V7.92n (DLL compiled Oct 31 2023 15:10:15)
Command line: -port 2331 -s -device STM32F103ZE -endian little -speed 4000 -if swd -vd
... ...
------Target related settings------
Target device: STM32F103ZE
Target device parameters: none
Target interface: SWD
Target interface speed: 4000kHz
Target endian: little
Connecting to J-Link...
J-Link is connected.
... ...
Checking target voltage...
Target voltage: 3.31 V
Listening on TCP/IP port 2331
Connecting to target...
Connected to target
... ...
Read register r0 - r12, sp, lr, pc, xpsr --- all OK
... ...
Received monitor command: reset
Resetting target
Downloading 484 bytes @ address 0x08000000 - Verified OK
Downloading 16060 bytes @ address 0x080001E4 - Verified OK
... ...
Starting target CPU...
GDB closed TCP/IP connection (Socket 984)
Debugger requested to halt target...
ERROR: Cannot read register 15 (R15) while CPU is running
...Target halted (PC = 0x00000000)
Reading common registers: ERROR: Cannot read register 0 (R0) while CPU is running
Read register 'r0' (4 bytes) from hardware: 0xEFBEADDE
ERROR: Cannot read register 1 (R1) while CPU is running
Read register 'r1' (4 bytes) from hardware: 0xEFBEADDE
ERROR: Cannot read register 2 (R2) while CPU is running
... ...
error occurs on reading all other registers and memory
... ...
GDB closed TCP/IP connection (Socket 980)
Restoring target state and closing J-Link connection...
Shutting down...
This is my first time to use debugger in CubeIDE, so it might be a simple configuration issue.
Regards
Chao