Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stm32h7: Misc fixes (openocd related mainly) #30417

Merged
merged 6 commits into from
Dec 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions boards/arm/nucleo_h723zg/board.cmake
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# SPDX-License-Identifier: Apache-2.0

board_runner_args(openocd "--use-elf")
board_runner_args(jlink "--device=STM32H723ZG" "--speed=4000")
board_runner_args(stm32cubeprogrammer "--port=swd" "--reset=hw")

include(${ZEPHYR_BASE}/boards/common/stm32cubeprogrammer.board.cmake)
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
include(${ZEPHYR_BASE}/boards/common/stm32cubeprogrammer.board.cmake)
11 changes: 10 additions & 1 deletion boards/arm/nucleo_h723zg/support/openocd.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,24 @@ 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
}

$_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
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we could have a common h7 file, otherwise LGTM

11 changes: 10 additions & 1 deletion boards/arm/nucleo_h743zi/support/openocd.cfg
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
source [find board/st_nucleo_h743zi.cfg]

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
}

$_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
}
1 change: 0 additions & 1 deletion boards/arm/nucleo_h745zi_q/board.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# SPDX-License-Identifier: Apache-2.0

board_runner_args(openocd "--use-elf")
board_runner_args(jlink "--device=STM32H745ZI" "--speed=4000")

include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
Expand Down
11 changes: 10 additions & 1 deletion boards/arm/nucleo_h745zi_q/support/openocd.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,24 @@

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
}

$_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
}
2 changes: 1 addition & 1 deletion boards/arm/stm32h747i_disco/stm32h747i_disco_m4.dts
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@
&uart8 {
pinctrl-0 = <&uart8_tx_pj8 &uart8_rx_pj9>;
current-speed = <115200>;
/* status = "okay"; */
status = "okay";
};
7 changes: 3 additions & 4 deletions boards/arm/stm32h747i_disco/stm32h747i_disco_m4_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ CONFIG_ARM_MPU=y
# Enable HW stack protection
CONFIG_HW_STACK_PROTECTION=y

# By default SERIAL peripherals are assigned to m7

# enable uart driver
#CONFIG_SERIAL=y
# console
CONFIG_SERIAL=y

# By default CONSOLE is assigned to m7
#CONFIG_CONSOLE=y
#CONFIG_UART_CONSOLE=y
14 changes: 10 additions & 4 deletions boards/arm/stm32h747i_disco/stm32h747i_disco_m7.dts
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,16 @@
status = "okay";
};

/* From UM2411 Rev 4:
With the default setting, the Ethernet feature is not working because of
a conflict between ETH_MDC and SAI4_D1 of the MEMs digital microphone */
&mac {

&mac {
/*
* From UM2411 Rev 4:
* With the default setting, the Ethernet feature is not working due
* of a pin conflict between ETH_MDC and SAI4_D1 of the MEMs digital
* microphone.
* Cf Ethernet section in board documentation for more information on
* the hw modification to be done to enable it.
*/
status = "okay";
pinctrl-0 = <&eth_ref_clk_pa1
&eth_mdio_pa2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,24 @@ 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
}

$_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
}