From f1452f2caabb014f619417967802473a720d8a4e Mon Sep 17 00:00:00 2001 From: Mathieu Choplain Date: Wed, 2 Apr 2025 14:45:12 +0200 Subject: [PATCH] boards: st: nucleo_wb09ke: replace OpenOCD with pyOCD for debugging pyOCD is installed along with Zephyr, and can debug apps on STM32WB09 once the appropriate pack (already publicly available) is installed. On the other hand, OpenOCD comes with the Zephyr SDK but only on Linux, and both Zephyr's fork and upstream lack support for STM32WB09, which was added by commit 89b053b660bcef803e19c89584de933158c59299 in ST's OpenOCD fork[1]. While pre-builts for this OpenOCD fork are provided by ST as part of other software packages (e.g., STM32CubeIDE), it is less convenient to use and the exact support script to use varies depending on which tool OpenOCD is borrowed from. Remove OpenOCD support for STM32WB09 entirely, replacing it with pyOCD, and add instructions about pack installation in the board documentation. While this also applies to flashing, STM32CubeProgrammer is the default runner for this, and already supports STM32WB09 without any shenanigans (i.e., a bare "west flash" will work with CubeProg) - as such, place the notice only in the debugging section, which is the only operation CubeProg does not support. [1] https://github.com/STMicroelectronics/OpenOCD Signed-off-by: Mathieu Choplain --- boards/st/nucleo_wb09ke/board.cmake | 3 ++- boards/st/nucleo_wb09ke/doc/index.rst | 9 +++++++++ boards/st/nucleo_wb09ke/support/openocd.cfg | 5 ----- 3 files changed, 11 insertions(+), 6 deletions(-) delete mode 100644 boards/st/nucleo_wb09ke/support/openocd.cfg diff --git a/boards/st/nucleo_wb09ke/board.cmake b/boards/st/nucleo_wb09ke/board.cmake index 10041643921..7f80e9325ae 100644 --- a/boards/st/nucleo_wb09ke/board.cmake +++ b/boards/st/nucleo_wb09ke/board.cmake @@ -1,7 +1,8 @@ # SPDX-License-Identifier: Apache-2.0 # keep first board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=sw" "--start-address=0x10000000") +board_runner_args(pyocd "--target=stm32wb09kevx") # keep first include(${ZEPHYR_BASE}/boards/common/stm32cubeprogrammer.board.cmake) -include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) +include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake) diff --git a/boards/st/nucleo_wb09ke/doc/index.rst b/boards/st/nucleo_wb09ke/doc/index.rst index ccd9b796c49..854e83c7ed8 100644 --- a/boards/st/nucleo_wb09ke/doc/index.rst +++ b/boards/st/nucleo_wb09ke/doc/index.rst @@ -121,6 +121,15 @@ You can debug an application in the usual way. Here is an example for the :maybe-skip-config: :goals: debug +.. warning:: + Application debugging on this board uses the pyOCD runner, which requires an additional pack + to be installed beforehand. This can be performed using the following commands: + + .. code-block:: console + + $ pyocd pack update + $ pyocd pack install stm32wb0 + .. _`Nucleo WB09KE webpage`: https://www.st.com/en/evaluation-tools/nucleo-wb09ke.html diff --git a/boards/st/nucleo_wb09ke/support/openocd.cfg b/boards/st/nucleo_wb09ke/support/openocd.cfg deleted file mode 100644 index 6d294443fcf..00000000000 --- a/boards/st/nucleo_wb09ke/support/openocd.cfg +++ /dev/null @@ -1,5 +0,0 @@ -source [find interface/stlink-dap.cfg] - -transport select "dapdirect_swd" - -source [find target/stm32wb0x.cfg]