Question
Cannot debug CM4 on STM32MP151 (eng mode)
Both on Windows and on Linux, latest STM32CubeIDE, I cant get debug or run using ST-Link.
If I try to use ST-Link GDB Server
Error in final launch sequence:
Failed to execute MI command:
target remote localhost:61234
Error message from debugger back end:
Remote communication error. Target disconnected.: Connection reset by peer.
Failed to execute MI command:
target remote localhost:61234
Error message from debugger back end:
Remote communication error. Target disconnected.: Connection reset by peer.
Remote communication error. Target disconnected.: Connection reset by peer.STMicroelectronics ST-LINK GDB server. Version 6.1.0
Copyright (c) 2022, STMicroelectronics. All rights reserved.
Starting server with the following options:
Persistent Mode : Disabled
Logging Level : 1
Listen Port Number : 61234
Status Refresh Delay : 15s
Verbose Mode : Disabled
SWD Debug : Enabled
ST-LINK device status: UNKNOWN
Waiting for debugger connection...
Debugger connected
Waiting for debugger connection...
Failed halting target
Shutting down...
Exit.If I try to "Run" (instead of Debug) I got:
...
Info : accepting 'gdb' connection on tcp/3333
Info : Halt timed out, wake up GDB.
Error: timed out while waiting for target halted
Error executing event gdb-attach on target STM32MP151AACx.cm4:
Info : New GDB Connection: 2, Target STM32MP151AACx.cm4, state: reset
Warn : GDB connection 2 on target STM32MP151AACx.cm4 not halted
Warn : negative reply, retrying
Warn : negative reply, retrying
Warn : negative acknowledgment, but no packet pending
Warn : negative acknowledgment, but no packet pending
Info : stlink_dap_op_connect(connect)
Info : SWD DPIDR 0x6ba02477
Info : Deferring arp_examine of STM32MP151AACx.cpu1
Info : Use arp_examine command to examine it manually!
Info : Deferring arp_examine of STM32MP151AACx.cm4
Info : Use arp_examine command to examine it manually!
Info : stlink_dap_op_connect(connect)
Info : SWD DPIDR 0x6ba02477
Info : Deferring arp_examine of STM32MP151AACx.cpu1
Info : Use arp_examine command to examine it manually!
Info : STM32MP151AACx.cm4: Cortex-M4 r0p1 processor detected
Info : STM32MP151AACx.cm4: target has 6 breakpoints, 4 watchpoints
Info : Halt timed out, wake up GDB.
Error: timed out while waiting for target halted
Warn : target not halted
Info : target STM32MP151AACx.cm4 was not halted when resume was requested
Info : dropped 'gdb' connection
shutdown command invoked
Info : dropped 'gdb' connectionUsing Open On-Chip Debugger
Open On-Chip Debugger 0.11.0+dev-00443-gcf12591 (2022-02-09-13:30) [ST Internal]
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
srst_only srst_pulls_trst 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 V2J39S0 (API v2) VID:PID 0483:3748
Info : Target voltage: 2.908319
Info : clock speed 4000 kHz
Info : stlink_dap_op_connect(connect)
Info : SWD DPIDR 0x6ba02477
Info : stlink_dap_op_connect(connect)
Info : SWD DPIDR 0x6ba02477
Info : STM32MP151AACx.cm4: Cortex-M4 r0p1 processor detected
Info : STM32MP151AACx.cm4: target has 6 breakpoints, 4 watchpoints
Info : STM32MP151AACx.cm4: external reset detected
Info : STM32MP151AACx.cpu0: hardware has 6 breakpoints, 4 watchpoints
Info : gdb port disabled
Info : gdb port disabled
Info : gdb port disabled
Info : starting gdb server for STM32MP151AACx.cpu0 on 3334
Info : Listening on port 3334 for gdb connections
Info : starting gdb server for STM32MP151AACx.cm4 on 3333
Info : Listening on port 3333 for gdb connections
Info : accepting 'gdb' connection on tcp/3333
Info : Halt timed out, wake up GDB.
Error: timed out while waiting for target halted
Error executing event gdb-attach on target STM32MP151AACx.cm4:
Info : New GDB Connection: 1, Target STM32MP151AACx.cm4, state: reset
Warn : GDB connection 1 on target STM32MP151AACx.cm4 not halted
Warn : negative reply, retrying
Warn : negative reply, retrying
O.K.
O.K.:0xE00FFFD0
Info : accepting 'gdb' connection on tcp/3333
Info : Halt timed out, wake up GDB.
Error: timed out while waiting for target halted
Error executing event gdb-attach on target STM32MP151AACx.cm4:
Info : New GDB Connection: 2, Target STM32MP151AACx.cm4, state: reset
Warn : GDB connection 2 on target STM32MP151AACx.cm4 not halted
Warn : negative reply, retrying
Warn : negative reply, retrying
Warn : negative acknowledgment, but no packet pending
Warn : negative acknowledgment, but no packet pending
Info : stlink_dap_op_connect(connect)
Info : SWD DPIDR 0x6ba02477
Info : Deferring arp_examine of STM32MP151AACx.cpu1
Info : Use arp_examine command to examine it manually!
Info : Deferring arp_examine of STM32MP151AACx.cm4
Info : Use arp_examine command to examine it manually!
Info : stlink_dap_op_connect(connect)
Info : SWD DPIDR 0x6ba02477
Info : Deferring arp_examine of STM32MP151AACx.cpu1
Info : Use arp_examine command to examine it manually!
Info : STM32MP151AACx.cm4: Cortex-M4 r0p1 processor detected
Info : STM32MP151AACx.cm4: target has 6 breakpoints, 4 watchpoints
Info : Halt timed out, wake up GDB.
Error: timed out while waiting for target halted
Warn : target STM32MP151AACx.cm4 is not halted (add breakpoint)
Error: can't add breakpoint: target running