1# STM32H745ZI Nucleo board OpenOCD ST-LINK V3 configuration
2#
3# Copyright (c) 2024 S&C Electric Company <Michael.Banducci@sandc.com>
4# SPDX-License-Identifier: Apache-2.0
5#
6
7# Borrow the nucleo_h745zi openocd configuration as no config exists for the h755 yet.
8source [find board/st_nucleo_h745zi.cfg]
9
10# Use connect_assert_srst here to be able to program
11# even when core is in sleep mode
12reset_config srst_only srst_nogate connect_assert_srst
13
14$_CHIPNAME.cpu0 configure -event gdb-attach {
15        echo "Debugger attaching: halting execution"
16        gdb_breakpoint_override hard
17}
18
19$_CHIPNAME.cpu0 configure -event gdb-detach {
20        echo "Debugger detaching: resuming execution"
21        resume
22}
23
24# Due to the use of connect_assert_srst, running gdb requires
25# to reset halt just after openocd init.
26rename init old_init
27proc init {} {
28        old_init
29        reset halt
30}
31