Showing results for 
Search instead for 
Did you mean: 

read_memory: failed to read memory


I'm trying to debug with an STM32H753BI using openocd and gdb using cube ide but im getting error like failed to read memory.
here is the log:

xPack Open On-Chip Debugger 0.12.0+dev-01312-g18281b0c4-dirty (2023-09-04-22:31)
Licensed under GNU GPL v2
For bug reports, read
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Started by GNU MCU Eclipse
Info : Listening on port 50001 for tcl connections
Info : Listening on port 50002 for telnet connections
Info : clock speed 1800 kHz
Info : STLINK V2J41S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.185855
Info : [STM32H753BITx.cpu0] Cortex-M7 r1p1 processor detected
Info : [STM32H753BITx.cpu0] target has 8 breakpoints, 4 watchpoints
Error executing event examine-end on target STM32H753BITx.cpu0:
read_memory: failed to read memory
Info : starting gdb server for STM32H753BITx.cpu0 on 50000
Info : Listening on port 50000 for gdb connections
Info : accepting 'gdb' connection on tcp/50000
Error: timed out while waiting for target halted
Error executing event gdb-attach on target STM32H753BITx.cpu0:

Error: auto_probe failed
Error: Connect failed. Consider setting up a gdb-attach event for the target to prepare target for GDB connect, or use 'gdb_memory_map disable'.
Error: attempted 'gdb' connection rejected
shutdown command invoked
Can someone assist me in resolving this problem?


Is this a custom board?

Can you connect to and program the device over STM32CubeProgrammer?

Does programming work within STM32CubeIDE?


If you feel a post has answered your question, please click "Accept as Solution".

Yes, it functions properly while utilizing STM32CubeProgrammer.
The mentioned error occurs during debugging using STM32CubeIDE.

ST Employee

Hello @user_gk 

First let me thank you for posting.

Could you please use GDB server with CubeIDE?


To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.