“
D:\meenv\OpenOCD-20230202-0.12.0\bin\openocd.exe -s D:\meenv\OpenOCD-20230202-0.12.0\share\openocd\scripts -f E:\devdocs\clionrelated\stm32codes\stm32demo2\stm32f4discovery.cfg -c "tcl_port disabled" -c "gdb_port disabled" -c "tcl_port disabled" -c "program \"E:/devdocs/clionrelated/stm32codes/stm32demo2/cmake-build-debug/stm32demo2.elf\"" -c reset -c shutdown
[0mOpen On-Chip Debugger 0.12.0 (2023-02-02) [https://github.com/sysprogs/openocd]
Licensed under GNU GPL v2
libusb1 09e75e98b4d9ea7909e8837b7a3f00dda4589dc3
For bug reports, read http://openocd.org/doc/doxygen/bugs.html
[0mInfo : CMSIS-DAP: SWD supported
Info : CMSIS-DAP: JTAG supported
Info : CMSIS-DAP: FW Version = 1.0
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 0 TDO = 1 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 2000 kHz
Info : SWD DPIDR 0x2ba01477
Info : [stm32f4x.cpu] Cortex-M4 r0p1 processor detected
Info : [stm32f4x.cpu] target has 6 breakpoints, 4 watchpoints
Info : gdb port disabled
Error: timed out while waiting for target halted
embedded:startup.tcl:1467: Error: ** Unable to reset target **
in procedure 'program'
in procedure 'program_error' called at file "embedded:startup.tcl", line 1504
at file "embedded:startup.tcl", line 1467
”
主要的错误提示是:
Error: timed out while waiting for target halted
embedded:startup.tcl:1467: Error: ** Unable to reset target **
另外,使用的F407 OpenOCD配置文件内容如下:
source [find interface/cmsis-dap.cfg]
transport select swd
# increase working area to 64KB
set WORKAREASIZE 0x10000
source [find target/stm32f4x.cfg]
reset_config none separate
KEIL仿真时Debug的reset配置是sysresetreq,最新OpenOCD的board/stm32f4discovery.cfg这里srst_only就是模拟reset。
OpenOCD官方的原文如下:
System Reset: the SRST hardware signal resets all chips connected to the JTAG adapter, such as processors, power management chips, and I/O
controllers. Normally resets triggered with this signal behave exactly like pressing a RESET button。