cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot Start SWD Debugging on STM32MP135 in STM32CubeIDE

vad_74
Associate

Hello Support Team,

I am trying to start SWD debugging for the STM32MP135DAF7 in STM32CubeIDE using an ST-LINK V2 probe, but I cannot get the debugger to work correctly.

My development board is MYD-YF135-256N256D-100-I based on STM32MP135DAF7.

I enabled Engineering boot mode (B2 = 1, B1 = 0, B0 = 0)

Software versions:

  • STM32CubeMX v6.17.0

  • STM32CubeIDE v2.1.1

  • STM32CubeMP13 Firmware Package V1.2.0

Debugger:

  • Original ST-LINK V2

  • Serial number: 30FF6F064E58373521xxxx43
  • Firmware version: V2J47S7

I created a simple project in STM32CubeMX and enabled only RCC and SWD debug. Then I opened the project in STM32CubeIDE and configured debugging through OpenOCD with “Connect under reset”.

The debugger can detect the target correctly:

  • SWD DPIDR is detected
  • CPU examination succeeds
  • The core sometimes halts correctly

But after that, the debug session fails with many OpenOCD errors such as:

  • timeout waiting for DSCR bit change
  • Error waiting for InstrCompl=1
  • Error waiting for cortex_a_exec_opcode
  • Fail reading CTRL/STAT register

As a result, debugging never starts in STM32CubeIDE.

Could you please advise what exactly should be configured to make SWD debugging work correctly on STM32MP135 in STM32CubeIDE?

Specifically:

  • Are there recommended OpenOCD settings for STM32MP13?
  • Is some additional initialization required before debugging?
  • Is there a recommended reset sequence or boot mode configuration?

I attached the complete OpenOCD log below.

Thank you.

Spoiler
Open On-Chip Debugger 0.12.0+dev-00645-g2306f32ee (2026-02-09-11:36) [https://github.com/STMicroelectronics/OpenOCD]
Licensed under GNU GPL v2
For bug reports, read
srst_only srst_pulls_trst srst_gates_jtag srst_open_drain connect_deassert_srst
srst_only srst_pulls_trst srst_gates_jtag srst_open_drain connect_deassert_srst
adapter speed: 1800 kHz
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : STLINK V2J47S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.237574
Info : clock speed 1800 kHz
Info : stlink_dap_op_connect(connect)
Info : SWD DPIDR 0x6ba02477
Info : stlink_dap_op_connect(connect)
Info : SWD DPIDR 0x6ba02477
Info : [STM32MP135DAFx.ap1] Examination succeed
Info : [STM32MP135DAFx.axi] Examination succeed
Info : STM32MP135DAFx.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : [STM32MP135DAFx.cpu] Examination succeed
Info : gdb port disabled
Info : gdb port disabled
Info : starting gdb server for STM32MP135DAFx.cpu on 3333
Info : Listening on port 3333 for gdb connections
Info : accepting 'gdb' connection on tcp/3333
Info : STM32MP135DAFx.cpu: MPIDR level2 0, cluster 0, core 0, multi core, no SMT
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x200001d3 pc: 0x00004da8
MMU: disabled, D-Cache: disabled, I-Cache: disabled
Info : New GDB Connection: 1, Target STM32MP135DAFx.cpu, state: halted
Error: timeout waiting for DSCR bit change
Error: Error waiting for InstrCompl=1
Error: Error waiting for cortex_a_exec_opcode
Error: timeout waiting for DSCR bit change
Error: Error waiting for InstrCompl=1
Error: timeout waiting for DSCR bit change
Error: Error waiting for InstrCompl=1
Error: Error waiting for dpm prepare
Error: timeout waiting for DSCR bit change
Error: Error waiting for InstrCompl=1
Error: Error waiting for cortex_a_exec_opcode
Warn : keep_alive() was not invoked in the 1000 ms timelimit. GDB alive packet not sent! (4021 ms). Workaround: increase "set remotetimeout" in GDB
Info : stlink_dap_op_connect(connect)
Error: Fail reading CTRL/STAT register. Force reconnect
Error executing event examine-start on target STM32MP135DAFx.ap1:
embedded:startup.tcl:1353: Error: 
in procedure 'ocd_process_reset' 
in procedure 'ocd_process_reset_inner' called at file "embedded:startup.tcl", line 1353
Info : stlink_dap_op_connect(reconnect)
Info : SWD DPIDR 0x6ba02477
Info : stlink_dap_op_connect(connect)
Error: Fail reading CTRL/STAT register. Force reconnect
Info : stlink_dap_op_connect(reconnect)
Info : SWD DPIDR 0x6ba02477
Warn : STM32MP135DAFx.cpu: ran after reset and before halt ...
target halted in Thumb state due to debug-request, current mode: Supervisor
cpsr: 0x200001f3 pc: 0x00002058
MMU: disabled, D-Cache: disabled, I-Cache: disabled
Error: timeout waiting for DSCR bit change
Error: Error waiting for InstrCompl=1
Error: Error waiting for cortex_a_exec_opcode
Error: timeout waiting for DSCR bit change
Error: Error waiting for InstrCompl=1
Error: timeout waiting for DSCR bit change
Error: Error waiting for InstrCompl=1
Error: Error waiting for dpm prepare
Error: timeout waiting for DSCR bit change
Error: Error waiting for InstrCompl=1
Error: Error waiting for cortex_a_exec_opcode
Warn : keep_alive() was not invoked in the 1000 ms timelimit. GDB alive packet not sent! (4036 ms). Workaround: increase "set remotetimeout" in GDB
Error: timeout waiting for DSCR bit change
Error: Error waiting for InstrCompl=1
Error: Error waiting for cortex_a_exec_opcode
Error: timeout waiting for DSCR bit change
Error: Error waiting for InstrCompl=1
Error: Error waiting for dpm prepare
Error: DSCR InstrCompl must be set before leaving debug!
Error: timeout waiting for DSCR bit change
Error: Error waiting for resume
0 REPLIES 0