cancel
Showing results for 
Search instead for 
Did you mean: 

ST-Link v2 (OpenOCD) not work on STM32H7x

HarryXia
Associate II

I want to use ST-Link OpenOCD to debug and program my STM32H7x board. But always got failure.

My STM32CubeIDE version is STM32CubeIDE_1.13.2, .openocd_2.1.0.202306221132 is within CubeIDE.

The attached is the config file for openOCD(.cfg is not allowed to upload, so I add .log at end of the file). interface/stlink.cfg and target/stm32h7x.cfg should be located to openocd_2.1.0.202306221132/resources/openocd/st_scripts.

When I started debug, I got below information in IDE console. Is there anything I missed or wrong?

 

Open On-Chip Debugger 0.12.0-00024-gc3ff39f8b (2023-06-26-16:51) [https://github.com/STMicroelectronics/OpenOCD]

Licensed under GNU GPL v2

For bug reports, read

http://openocd.org/doc/doxygen/bugs.html

stm32h7x_cti_prepare_restart_one

Info : Listening on port 6666 for tcl connections

Info : Listening on port 4444 for telnet connections

Info : STLINK V2J42S7 (API v2) VID:PID 0483:3748

Info : Target voltage: 3.252984

Info : Unable to match requested speed 8000 kHz, using 4000 kHz

Info : Unable to match requested speed 8000 kHz, using 4000 kHz

Info : clock speed 4000 kHz

Info : stlink_dap_op_connect(connect)

Info : SWD DPIDR 0x6ba02477

Info : [STM32H750VBTx.cm7] Cortex-M7 r1p1 processor detected

Info : [STM32H750VBTx.cm7] target has 8 breakpoints, 4 watchpoints

Info : gdb port disabled

Info : starting gdb server for STM32H750VBTx.cm7 on 3333

Info : Listening on port 3333 for gdb connections

Info : accepting 'gdb' connection on tcp/3333

Error: timed out while waiting for target halted

Error executing event gdb-attach on target STM32H750VBTx.cm7:

C:/stm32/STM32CubeIDE_1.13.2/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.debug.openocd_2.1.0.202306221132/resources/openocd/st_scripts/gdb_helper.tcl:18: Error: TARGET: STM32H750VBTx.cm7 - Not halted

in procedure 'gdb_attach_hook' called at file "C:/stm32/STM32CubeIDE_1.13.2/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.debug.openocd_2.1.0.202306221132/resources/openocd/st_scripts/target/stm32h7x.cfg", line 349

in procedure 'first_gdb_attach_hook' called at file "C:/stm32/STM32CubeIDE_1.13.2/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.debug.openocd_2.1.0.202306221132/resources/openocd/st_scripts/gdb_helper.tcl", line 18

Info : Device: STM32H74x/75x

Info : flash size probed value 128k

Info : STM32H7 flash has a single bank

Info : Bank (0) size is 128 kb, base address is 0x08000000

Info : New GDB Connection: 1, Target STM32H750VBTx.cm7, state: running

Warn : GDB connection 1 on target STM32H750VBTx.cm7 not halted

Info : accepting 'gdb' connection on tcp/3333

Info : New GDB Connection: 2, Target STM32H750VBTx.cm7, state: running

Warn : GDB connection 2 on target STM32H750VBTx.cm7 not halted

Error: timed out while waiting for target halted

Error executing event gdb-flash-erase-start on target STM32H750VBTx.cm7:

TARGET: STM32H750VBTx.cm7 - Not halted

Error: failed erasing sectors 0 to 0

Error: flash_erase returned -304

Info : dropped 'gdb' connection

Info : dropped 'gdb' connection

shutdown command invoked

2 REPLIES 2
Imen.D
ST Employee

Hello @HarryXia,

Make sure to recover the board 10 kΩ resistor from R143 and soldered on to R144 as mentioned in the Caution part, in the STM32H750 User manual.

Check also the SMPS/LDO and VOS settings.

  ImenD_0-1700487441232.png

Hope this helped!

Imen

 

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
HarryXia
Associate II

@Imen.D thaks your reply.

I checked the manual. "recover the board 10 kΩ resistor from R143 and soldered on to R144" should change the BOOT0 pin to 1 instead of 0, and start in System memory for programming to fix the deadlock issue. But my issue should not be deadlock issue. If I use ST-Link (ST-Link GDB server) instead of ST-Link(OpenOCD), I have no any issue.