1
2source [find interface/stlink.cfg]
3
4transport select hla_swd
5
6source [find target/stm32h7x.cfg]
7
8# Use connect_assert_srst here to be able to program
9# even when core is in sleep mode
10reset_config srst_only srst_nogate connect_assert_srst
11
12$_CHIPNAME.cpu0 configure -event gdb-attach {
13        echo "Debugger attaching: halting execution"
14        gdb_breakpoint_override hard
15}
16
17$_CHIPNAME.cpu0 configure -event gdb-detach {
18        echo "Debugger detaching: resuming execution"
19        resume
20}
21
22# Due to the use of connect_assert_srst, running gdb requires
23# to reset halt just after openocd init.
24rename init old_init
25proc init {} {
26        old_init
27        reset halt
28}
29