Showing results for 
Search instead for 
Did you mean: 

Nucleo-H755 connection issues after secure memory flash erase

Associate II


my problem is as follows:I did a chip regression with flash erase and now I cannot connect to the mcu anymore.

I had secure area set, but I also set DMES, such that the secure area is also removed. As far as I can tell, this worked, as my secure area code had some LEDs blinking and this no longer happens.


Things I tried:

Connect via st link utility

not detected (tested multiple modes to no avail)

Connect via cube programmer

mode: under reset, reset mode: hardware/software/core reset -> ST_Link Error: DEV_TARGET_CMD_ERR
mode: normal, reset mode: hardware reset -> ST_Link Error: DEV_TARGET_CMD_ERR
mode: normal, reset mode: software/core reset -> Error: No STM32 Target found
mode: hotplug, reset mode: hardware/software/core reset -> Error: No STM32 Target found
pulling bt0 to vdd and retrying all of the above
    exactly the same results as above

Connect via cube ide

flashing a piece of firmware: errors (cubeide_flash_log.txt)

debugging the firmware: errors (cubeide_debug_log.txt)

Connecting via openocd (stock openocd)

Basic command: openocd -f /usr/share/openocd/scripts/board/stm32h745i-disco.cfg -c "init"
I found some forum post that suggested setting reset_config srst_only srst_nogate connect_assert_srst. After this, openocd starts. The st link LED (COM/LD4) is flashing red and green for the first time (was only red the other times), which, according to um2408 indicates: Blinking red/green: During communication with the target

But: gdb connection dies immediately

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'.

setting gdb_memory_map disable helps, gdb now connects!

connecting via gdb gives me:

Error: timed out while waiting for target halted
Error executing event gdb-attach on target stm32h745xih6.cpu0

gdb is there, but there is nothing meaningful I can do, reading memory always returns 0.

monitor halt times out,monitor reset gives me

monitor reset
read_memory: read at 0x5c001004 with width=32 and count=1 failed
Error executing event examine-end on target stm32h745xih6.cpu0:
/usr/bin/../share/openocd/scripts/target/stm32h7x.cfg:237: Error: read_memory: failed to read memory
in procedure 'ocd_process_reset'
in procedure 'ocd_process_reset_inner' called at file "embedded:startup.tcl", line 1193
in procedure 'stm32h7x_dbgmcu_mmw' called at file "/usr/bin/../share/openocd/scripts/target/stm32h7x.cfg", line 170
in procedure 'stm32h7x_mmw' called at file "/usr/bin/../share/openocd/scripts/target/stm32h7x.cfg", line 260
in procedure 'stm32h7x_mrw' called at file "/usr/bin/../share/openocd/scripts/target/stm32h7x.cfg", line 242
at file "/usr/bin/../share/openocd/scripts/target/stm32h7x.cfg", line 237
jtag status contains invalid mode value - communication failure
Polling target stm32h745xih6.cpu0 failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 100ms

openocd (the stlink one)

does not build

I am running out of ideas what is going on, how to get more info, how to debug it in general or how to fix this.

Does anyone have an idea how to fix it/how to get more information what is going on?