| 
 
| 本帖最后由 梧桐uuu 于 2025-8-3 23:10 编辑 
 在使用SEGGER JLink和STM32CubeIDE时遇到代码运行与退出调试模式的问题。调试器请求暂停目标设备......目标设备已暂停。
 我的环境:Windows10系统,STM32CubeIDE v1.5.1,SEGGER JLink调试器,硬件为STM32F103C8T6,固件为默认的HAL库闪烁灯程序。该问题在所有项目中均出现。
 
 SEGGER J-Link GDB Server V6.82g Command Line Version
 
 JLinkARM.dll V6.82g (DLL compiled Aug 28 2020 16:57:23)
 
 Command line: -port 2331 -s -device STM32F103C8 -endian little -speed 4000 -if swd -vd
 -----GDB Server start settings-----
 GDBInit file:                  none
 GDB Server Listening port:     2331
 SWO raw output listening port: 2332
 Terminal I/O port:             2333
 Accept remote connection:      localhost only
 Generate logfile:              off
 Verify download:               on
 Init regs on start:            off
 Silent mode:                   off
 Single run mode:               on
 Target connection timeout:     0 ms
 ------J-Link related settings------
 J-Link Host interface:         USB
 J-Link script:                 none
 J-Link settings file:          none
 ------Target related settings------
 Target device:                 STM32F103C8
 Target interface:              SWD
 Target interface speed:        4000kHz
 Target endian:                 little
 
 Connecting to J-Link...
 J-Link is connected.
 Firmware: J-Link V9 compiled Dec 13 2019 11:14:50
 Hardware: V9.60
 S/N: XXXXXXXXX
 Feature(s): GDB, RDI, FlashBP, FlashDL, JFlash, RDDI
 Checking target voltage...
 Target voltage: 3.28 V
 Listening on TCP/IP port 2331
 Connecting to target...
 Connected to target
 Waiting for GDB connection...Connected to 127.0.0.1
 Reading all registers
 Read 4 bytes @ address 0x0800048E (Data = 0x002C4770)
 Read 2 bytes @ address 0x0800048E (Data = 0x4770)
 Connected to 127.0.0.1
 Reading all registers
 Read 4 bytes @ address 0x0800048E (Data = 0x002C4770)
 Received monitor command: WriteDP 0x2 0xF0
 O.K.
 Received monitor command: ReadAP 0x2
 O.K.:0xE00FF003
 Reading 32 bytes @ address 0xE00FFFD0
 Received monitor command: reset
 Resetting target
 Downloading 268 bytes @ address 0x08000000 - Verified OK
 Downloading 4368 bytes @ address 0x0800010C - Verified OK
 Downloading 32 bytes @ address 0x0800121C - Verified OK
 Downloading 4 bytes @ address 0x0800123C - Verified OK
 Downloading 4 bytes @ address 0x08001240 - Verified OK
 Downloading 12 bytes @ address 0x08001244 - Verified OK
 Writing register (PC = 0x 8000384)
 Starting target CPU...
 GDB closed TCP/IP connection (Socket 1008)
 Debugger requested to halt target...
 ...Target halted (PC = 0x08000486)
 GDB closed TCP/IP connection (Socket 1036)
 
 
 | 
 |