From 0e036a368c3b6be3f1b968b53036ea5d75f90e78 Mon Sep 17 00:00:00 2001 From: Yves Vandervennet Date: Mon, 28 Oct 2024 16:09:36 -0400 Subject: [PATCH 1/2] west: linkserver: change the default port number for semihost LinkServer manages port numbers for gdb and semihost as separate linear sequences when invoked to debug multi-core applications, e.g the gdb-server instance for cpu0 will have the default GDB port 3333 and the next gdb-server instance will be assigned the port 3334. The latter will conflict with the default port for semihost which is 3334. This patch changes the default port for semihost to 8888. Port numbers can be changed when invoking the linkserver runner. Signed-off-by: Yves Vandervennet --- scripts/west_commands/runners/linkserver.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/west_commands/runners/linkserver.py b/scripts/west_commands/runners/linkserver.py index 3e0baf9f60576..f1a4630dd8798 100644 --- a/scripts/west_commands/runners/linkserver.py +++ b/scripts/west_commands/runners/linkserver.py @@ -18,7 +18,7 @@ DEFAULT_LINKSERVER_EXE = 'Linkserver.exe' if sys.platform == 'win32' else 'LinkServer' DEFAULT_LINKSERVER_GDB_PORT = 3333 -DEFAULT_LINKSERVER_SEMIHOST_PORT = 3334 +DEFAULT_LINKSERVER_SEMIHOST_PORT = 8888 class LinkServerBinaryRunner(ZephyrBinaryRunner): '''Runner front-end for NXP Linkserver''' @@ -95,6 +95,7 @@ def do_add_parser(cls, parser): @classmethod def do_create(cls, cfg, args): + print("RUNNER - gdb_port = " + str(args.gdb_port) + ", semih port = " + str(args.semihost_port)) return LinkServerBinaryRunner(cfg, args.device, args.core, linkserver=args.linkserver, dt_flash=args.dt_flash, From baf4b70ef749a79ed407c82f52a07bd2db8edbb8 Mon Sep 17 00:00:00 2001 From: Yves Vandervennet Date: Wed, 16 Oct 2024 10:34:38 -0500 Subject: [PATCH 2/2] boards: lpcxpresso55s69: enable multicore debugging - Refactoring of the cmake code so LinkServer can be invoked with the correct switches. - Documentation update Signed-off-by: Yves Vandervennet --- boards/nxp/lpcxpresso55s69/board.cmake | 14 +++++++++----- boards/nxp/lpcxpresso55s69/doc/index.rst | 7 ++++--- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/boards/nxp/lpcxpresso55s69/board.cmake b/boards/nxp/lpcxpresso55s69/board.cmake index 137b2e614f3aa..554ff716de3d3 100644 --- a/boards/nxp/lpcxpresso55s69/board.cmake +++ b/boards/nxp/lpcxpresso55s69/board.cmake @@ -8,15 +8,19 @@ ## DAP Link implementation in pyocd is underway, ## until then jlink can be used or copy image to storage -if(CONFIG_BOARD_LPCXPRESSO55S69_LPC55S69_CPU0 OR - CONFIG_BOARD_LPCXPRESSO55S69_LPC55S69_CPU0_NS OR - CONFIG_SECOND_CORE_MCUX) +board_runner_args(linkserver "--device=LPC55S69:LPCXpresso55S69") + +if(CONFIG_SECOND_CORE_MCUX) + board_runner_args(linkserver "--core=all") +elseif(CONFIG_BOARD_LPCXPRESSO55S69_LPC55S69_CPU0 OR + CONFIG_BOARD_LPCXPRESSO55S69_LPC55S69_CPU0_NS) board_runner_args(jlink "--device=LPC55S69_M33_0") - board_runner_args(linkserver "--device=LPC55S69:LPCXpresso55S69") board_runner_args(linkserver "--override=/device/memory/0/flash-driver=LPC55xx_S.cfx") board_runner_args(linkserver "--override=/device/memory/0/location=0x10000000") + board_runner_args(linkserver "--core=cm33_core0") elseif(CONFIG_BOARD_LPCXPRESSO55S69_LPC55S69_CPU1) board_runner_args(jlink "--device=LPC55S69_M33_1") + board_runner_args(linkserver "--core=cm33_core1") endif() board_runner_args(pyocd "--target=lpc55s69") @@ -25,6 +29,6 @@ if(CONFIG_BUILD_WITH_TFM) set_property(TARGET runners_yaml_props_target PROPERTY hex_file tfm_merged.hex) endif() +include(${ZEPHYR_BASE}/boards/common/linkserver.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake) -include(${ZEPHYR_BASE}/boards/common/linkserver.board.cmake) diff --git a/boards/nxp/lpcxpresso55s69/doc/index.rst b/boards/nxp/lpcxpresso55s69/doc/index.rst index b4a7328af318a..8e1a41e11fc6b 100644 --- a/boards/nxp/lpcxpresso55s69/doc/index.rst +++ b/boards/nxp/lpcxpresso55s69/doc/index.rst @@ -273,6 +273,7 @@ Build and flash applications as usual (see :ref:`build_an_application` and Configuring a Debug Probe ========================= +LinkServer is the default runner for this board. A debug probe is used for both flashing and debugging the board. This board is configured by default to use the LPC-Link2 CMSIS-DAP Onboard Debug Probe, however the :ref:`pyocd-debug-host-tools` does not yet support this probe so you @@ -316,7 +317,7 @@ Flashing ======== Here is an example for the :zephyr:code-sample:`hello_world` application. This example uses the -:ref:`jlink-debug-host-tools` as default. +:ref:`linkserver-debug-host-tools` as default. .. zephyr-app-commands:: :zephyr-app: samples/hello_world @@ -328,8 +329,8 @@ see the following message in the terminal: .. code-block:: console - ***** Booting Zephyr OS v1.14.0 ***** - Hello World! lpcxpresso55s69 + ***** Booting Zephyr OS v3.7.0 ***** + Hello World! lpcxpresso55s69/lpc55s69/cpu0 Building and flashing secure/non-secure with Arm |reg| TrustZone |reg| ----------------------------------------------------------------------