From 82ce5c57ef4f06acb2a972fb7abfbb61dce8c4e1 Mon Sep 17 00:00:00 2001 From: Alexandre Bourdiol Date: Wed, 13 Oct 2021 17:33:53 +0200 Subject: [PATCH] boards: arm: stm32l562e_dk and nucleo_l552ze_q add openocd support OpenOCD was partially implemented in board.cmake, it is now functional. Signed-off-by: Alexandre Bourdiol --- .../nucleo_l552ze_q/doc/nucleol552ze_q.rst | 12 +++++------- .../arm/nucleo_l552ze_q/support/openocd.cfg | 19 +++++++++++++++++++ boards/arm/stm32l562e_dk/doc/index.rst | 10 ++++------ boards/arm/stm32l562e_dk/support/openocd.cfg | 19 +++++++++++++++++++ 4 files changed, 47 insertions(+), 13 deletions(-) create mode 100644 boards/arm/nucleo_l552ze_q/support/openocd.cfg create mode 100644 boards/arm/stm32l562e_dk/support/openocd.cfg diff --git a/boards/arm/nucleo_l552ze_q/doc/nucleol552ze_q.rst b/boards/arm/nucleo_l552ze_q/doc/nucleol552ze_q.rst index 80b1ccf90d1..13692195b0e 100644 --- a/boards/arm/nucleo_l552ze_q/doc/nucleol552ze_q.rst +++ b/boards/arm/nucleo_l552ze_q/doc/nucleol552ze_q.rst @@ -255,19 +255,17 @@ flashed in the usual way (see :ref:`build_an_application` and Flashing ======== -Nucleo L552ZE Q board includes an ST-LINK/V3E embedded debug tool -interface. This interface is not yet supported by the openocd version. -Instead, support can be enabled on pyocd by adding "pack" support with -the following pyocd command: +Nucleo L552ZE Q board includes an ST-LINK/V2-1 embedded debug tool +interface. Support can be enabled on pyocd by adding "pack" support with the +following pyocd command: .. code-block:: console $ pyocd pack --update $ pyocd pack --install stm32l552ze -Nucleo L552ZE Q board includes an ST-LINK/V2-1 embedded debug tool -interface. This interface is supported by the openocd version -included in the Zephyr SDK since v0.9.2. +Alternatively, this interface is supported by the openocd version +included in the Zephyr SDK since v0.13.1. Flashing an application to Nucleo L552ZE Q ------------------------------------------ diff --git a/boards/arm/nucleo_l552ze_q/support/openocd.cfg b/boards/arm/nucleo_l552ze_q/support/openocd.cfg new file mode 100644 index 00000000000..f4ccc564125 --- /dev/null +++ b/boards/arm/nucleo_l552ze_q/support/openocd.cfg @@ -0,0 +1,19 @@ +source [find interface/stlink.cfg] + +transport select hla_swd + +source [find target/stm32l5x.cfg] + +# use hardware reset +reset_config srst_only srst_nogate + +$_TARGETNAME configure -event gdb-attach { + echo "Debugger attaching: halting execution" + reset halt + gdb_breakpoint_override hard +} + +$_TARGETNAME configure -event gdb-detach { + echo "Debugger detaching: resuming execution" + resume +} diff --git a/boards/arm/stm32l562e_dk/doc/index.rst b/boards/arm/stm32l562e_dk/doc/index.rst index 9d48980f4d0..863f3be0627 100644 --- a/boards/arm/stm32l562e_dk/doc/index.rst +++ b/boards/arm/stm32l562e_dk/doc/index.rst @@ -254,18 +254,16 @@ Flashing ======== STM32L562E-DK Discovery board includes an ST-LINK/V3E embedded debug tool -interface. This interface is not yet supported by the openocd version. -Instead, support can be enabled on pyocd by adding "pack" support with -the following pyocd command: +interface. Support can be enabled on pyocd by adding "pack" support with the +following pyocd command: .. code-block:: console $ pyocd pack --update $ pyocd pack --install stm32l562qe -STM32L562E-DK Discovery board includes an ST-LINK/V2-1 embedded debug tool -interface. This interface is supported by the openocd version -included in the Zephyr SDK since v0.9.2. +Alternatively, this interface is supported by the openocd version +included in the Zephyr SDK since v0.13.1. Flashing an application to STM32L562E-DK Discovery -------------------------------------------------- diff --git a/boards/arm/stm32l562e_dk/support/openocd.cfg b/boards/arm/stm32l562e_dk/support/openocd.cfg new file mode 100644 index 00000000000..f4ccc564125 --- /dev/null +++ b/boards/arm/stm32l562e_dk/support/openocd.cfg @@ -0,0 +1,19 @@ +source [find interface/stlink.cfg] + +transport select hla_swd + +source [find target/stm32l5x.cfg] + +# use hardware reset +reset_config srst_only srst_nogate + +$_TARGETNAME configure -event gdb-attach { + echo "Debugger attaching: halting execution" + reset halt + gdb_breakpoint_override hard +} + +$_TARGETNAME configure -event gdb-detach { + echo "Debugger detaching: resuming execution" + resume +}