From 4e95fde58ccf94290164cc3ac2f302a30f21e4b2 Mon Sep 17 00:00:00 2001 From: Daniel Schultz Date: Fri, 19 Apr 2024 16:08:31 -0700 Subject: [PATCH] boards: phytec: phyboard_lyra: Add OpenOCD support for M4 The phyBOARD-Lyra AM62x is equipped with an XDS110 JTAG debugger. Add missing OpenOCD configuration and some documentation to support 'west debug'. Signed-off-by: Daniel Schultz --- boards/phytec/phyboard_lyra/board.cmake | 10 ++++++++++ .../doc/phyboard_lyra_am62xx_m4.rst | 18 ++++++++++++++++++ .../phytec/phyboard_lyra/support/openocd.cfg | 7 +++++++ 3 files changed, 35 insertions(+) create mode 100644 boards/phytec/phyboard_lyra/board.cmake create mode 100644 boards/phytec/phyboard_lyra/support/openocd.cfg diff --git a/boards/phytec/phyboard_lyra/board.cmake b/boards/phytec/phyboard_lyra/board.cmake new file mode 100644 index 00000000000..5f42441db69 --- /dev/null +++ b/boards/phytec/phyboard_lyra/board.cmake @@ -0,0 +1,10 @@ +# PHYTEC phyBOARD-Lyra AM62x M4/A53 +# +# Copyright (c) 2024, PHYTEC Messtechnik GmbH +# +# SPDX-License-Identifier: Apache-2.0 + +if(CONFIG_SOC_AM6234_M4) + board_runner_args(openocd "--no-init" "--no-halt" "--no-targets" "--gdb-client-port=3339") + include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) +endif() diff --git a/boards/phytec/phyboard_lyra/doc/phyboard_lyra_am62xx_m4.rst b/boards/phytec/phyboard_lyra/doc/phyboard_lyra_am62xx_m4.rst index a8765c0fcc3..0736292446c 100644 --- a/boards/phytec/phyboard_lyra/doc/phyboard_lyra_am62xx_m4.rst +++ b/boards/phytec/phyboard_lyra/doc/phyboard_lyra_am62xx_m4.rst @@ -131,6 +131,21 @@ The board should boot into Linux and the binary will run and print Hello world t port. +Debugging +********* + +The board is equipped with an XDS110 JTAG debugger. To debug a binary, utilize the `debug` build target: + +.. zephyr-app-commands:: + :zephyr-app: + :board: phyboard_lyra/am6234/m4 + :maybe-skip-config: + :goals: debug + +.. hint:: + To utilize this feature, you'll need OpenOCD version 0.12 or higher. Due to the possibility of + older versions being available in package feeds, it's advisable to `build OpenOCD from source`_. + .. _PHYTEC AM62x Product Page: https://www.phytec.com/product/phycore-am62x/ @@ -143,3 +158,6 @@ port. .. _phyBOARD SD Card Booting Essentials: https://docs.phytec.com/projects/yocto-phycore-am62x/en/bsp-yocto-ampliphy-am62x-pd23.2.1/bootingessentials/sdcard.html + +.. _build OpenOCD from source: + https://docs.u-boot.org/en/latest/board/ti/k3.html#building-openocd-from-source diff --git a/boards/phytec/phyboard_lyra/support/openocd.cfg b/boards/phytec/phyboard_lyra/support/openocd.cfg new file mode 100644 index 00000000000..39eed02c401 --- /dev/null +++ b/boards/phytec/phyboard_lyra/support/openocd.cfg @@ -0,0 +1,7 @@ +# PHYTEC phyBOARD-Lyra AM62x M4/A53 +# +# Copyright (c) 2024, PHYTEC Messtechnik GmbH +# +# SPDX-License-Identifier: Apache-2.0 + +source [find board/ti_am625evm.cfg]