From c41320eb82a210e054dc731e122f1fba1850b14d Mon Sep 17 00:00:00 2001 From: Georgij Cernysiov Date: Thu, 11 Apr 2019 18:30:24 +0200 Subject: [PATCH] doc: guides: debugging: probes: correct J-Link usage Corrects information regarding J-Link usage with ST-Link. Signed-off-by: Georgij Cernysiov --- doc/guides/debugging/probes.rst | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/doc/guides/debugging/probes.rst b/doc/guides/debugging/probes.rst index d605bad00a1..4e3c8db0083 100644 --- a/doc/guides/debugging/probes.rst +++ b/doc/guides/debugging/probes.rst @@ -188,22 +188,28 @@ Using Segger J-Link Once STLink is flashed with SEGGER FW and J-Link GDB server is installed on your host computer, you can flash and debug as follows: -Use the CMake ``flash`` target with the argument ``STLINK_FW=jlink`` to -build your Zephyr application. +Use CMake with ``-DZEPHYR_BOARD_FLASH_RUNNER=jlink`` to change the default OpenOCD +runner to J-Link. Alternatively, you might add the following line to your +application ``CMakeList.txt`` file. - .. zephyr-app-commands:: - :zephyr-app: samples/hello_world - :gen-args: -DSTLINK_FW=jlink - :goals: flash + .. code-block:: cmake -Use the CMake ``debug`` target with the argument ``STLINK_FW=jlink`` to build -your Zephyr application, invoke the J-Link GDB server, attach a GDB client, and -program your Zephyr application to flash. It will leave you at a GDB prompt. + set(ZEPHYR_BOARD_FLASH_RUNNER jlink) - .. zephyr-app-commands:: - :zephyr-app: samples/hello_world - :gen-args: -DSTLINK_FW=jlink - :goals: debug +If you use West (Zephyr’s meta-tool) you can modify the default runner using +the ``--runner`` (or ``-r``) option. + + .. code-block:: console + + west flash --runner jlink + +To attach a debugger to your board and open up a debug console with ``jlink``. + + .. code-block:: console + + west debug --runner jlink + +For more information about West and available options, see :ref:`west`. If you configured your Zephyr application to use `Segger RTT`_ console instead, open telnet: