boards: Fix openocd debug config on stm32h7 based boards

On these 3 stm32h7 based boards, 'connect_assert_srst' should
be used in order to be able to program after board unplug/plug.

Problem is that 'connect_assert_srst' prevents gdb-attach procedure
to complete which now requires 'reset halt' to be performed before
hand.
Fix this by forcing 'reset halt' by introducing a new init routine.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
This commit is contained in:
Erwan Gouriou 2020-12-02 18:20:24 +01:00 committed by Anas Nashif
parent 2c46d70ac1
commit cece97b96c
3 changed files with 30 additions and 3 deletions

View File

@ -13,11 +13,12 @@ set BOARDNAME NUCLEO-H723ZG
source [find target/stm32h7x.cfg]
# Use connect_assert_srst here to be able to programm
# even when core is in sleep mode
reset_config srst_only srst_nogate connect_assert_srst
$_CHIPNAME.cpu0 configure -event gdb-attach {
echo "Debugger attaching: halting execution"
reset halt
gdb_breakpoint_override hard
}
@ -25,3 +26,11 @@ $_CHIPNAME.cpu0 configure -event gdb-detach {
echo "Debugger detaching: resuming execution"
resume
}
# Due to the use of connect_assert_srst, running gdb requires
# to reset halt just after openocd init.
rename init old_init
proc init {} {
old_init
reset halt
}

View File

@ -6,11 +6,12 @@
source [find board/st_nucleo_h745zi.cfg]
# Use connect_assert_srst here to be able to programm
# even when core is in sleep mode
reset_config srst_only srst_nogate connect_assert_srst
$_CHIPNAME.cpu0 configure -event gdb-attach {
echo "Debugger attaching: halting execution"
reset halt
gdb_breakpoint_override hard
}
@ -18,3 +19,11 @@ $_CHIPNAME.cpu0 configure -event gdb-detach {
echo "Debugger detaching: resuming execution"
resume
}
# Due to the use of connect_assert_srst, running gdb requires
# to reset halt just after openocd init.
rename init old_init
proc init {} {
old_init
reset halt
}

View File

@ -5,11 +5,12 @@ transport select hla_swd
source [find target/stm32h7x.cfg]
# Use connect_assert_srst here to be able to programm
# even when core is in sleep mode
reset_config srst_only srst_nogate connect_assert_srst
$_CHIPNAME.cpu0 configure -event gdb-attach {
echo "Debugger attaching: halting execution"
reset halt
gdb_breakpoint_override hard
}
@ -17,3 +18,11 @@ $_CHIPNAME.cpu0 configure -event gdb-detach {
echo "Debugger detaching: resuming execution"
resume
}
# Due to the use of connect_assert_srst, running gdb requires
# to reset halt just after openocd init.
rename init old_init
proc init {} {
old_init
reset halt
}