develop/flash_debug/probes.html · develop/flash_debug/probes.rst 공식 원문 ↗

Zephyr 3.7.0 · Develop · Debug Probes

Debug probe

On-board·external debug probe의 hardware, firmware 변형, host tool 호환성과 update 방법을 설명합니다.

Official pathdevelop/flash_debug/probes.html
Source filedevelop/flash_debug/probes.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

본문 기준: Zephyr 3.7.0 LTS3 · 이후 유지보수 패치는 별도입니다.

Part 1

요약·해설

9종 probe와 5종 host tool의 호환 관계, NXP on-board firmware 전환, OpenSDA bootloader 절차, ST-LINK의 OpenOCD/J-Link 사용과 복원을 다룹니다.

NXP

MCU-Link · LPC-Link2 · OpenSDA

External

J-Link · NXP S32

ST

ST-LINK · OpenOCD · J-Link

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 B1323508C0E2EBAB5C002BC25CC5A3BA2CEF5F321AAB949BFB75CED7161C8E24
.. _debug-probes:

Debug Probes
############

A *debug probe* is special hardware which allows you to control execution of a
Zephyr application running on a separate board. Debug probes usually allow
reading and writing registers and memory, and support breakpoint debugging of
the Zephyr application on your host workstation using tools like GDB. They may
also support other debug software and more advanced features such as
:ref:`tracing program execution <tracing>`. For details on the related host
software supported by Zephyr, see :ref:`flash-debug-host-tools`.

Debug probes are usually connected to your host workstation via USB; they
are sometimes also accessible via an IP network or other means. They usually
connect to the device running Zephyr using the JTAG or SWD protocols. Debug
probes are either separate hardware devices or circuitry integrated into the same
board which runs Zephyr.

Many supported boards in Zephyr include a second microcontroller that serves as
an onboard debug probe, usb-to-serial adapter, and sometimes a drag-and-drop
flash programmer. This eliminates the need to purchase an external debug probe
and provides a variety of debug host tool options.

Several hardware vendors have their own branded onboard debug probe
implementations: NXP boards may use
`OpenSDA <#opensda-onboard-debug-probe>`_,
`LPC-Link2 <#lpc-link2-onboard-debug-probe>`_, or
`MCU-Link <#mcu-link-onboard-debug-probe>`_, probes depending on
the microcontroller the debug probe firmware runs on.
ST boards have the `ST-LINK probe <#stlink-v21-onboard-debug-probe>`_. Each
onboard debug probe microcontroller can support one or more types of firmware
that communicate with their respective debug host tools. For example, an
OpenSDA microcontroller can be programmed with DAPLink firmware to communicate
with pyOCD or OpenOCD debug host tools, or with J-Link firmware to communicate
with J-Link debug host tools.


+------------------------------------------+---------------------------------------------------------------------------------------------------------+
|| *Debug Probes & Host Tools*             |                                               Host Tools                                                |
+| *Compatibility Chart*                   +--------------------+--------------------+---------------------+--------------------+--------------------+
|                                          |  **J-Link Debug**  |    **OpenOCD**     |      **pyOCD**      |   **NXP S32DS**    | **NXP LinkServer** |
+----------------+-------------------------+--------------------+--------------------+---------------------+--------------------+--------------------+
|                | **J-Link External**     |           ✓        |          ✓         |                     |                    |                    |
|                +-------------------------+--------------------+--------------------+---------------------+--------------------+--------------------+
|                | **LPC-Link2 CMSIS-DAP** |                    |                    |                     |                    |         ✓          |
|                +-------------------------+--------------------+--------------------+---------------------+--------------------+--------------------+
|                | **LPC-Link2 J-Link**    |           ✓        |                    |                     |                    |                    |
|                +-------------------------+--------------------+--------------------+---------------------+--------------------+--------------------+
|                | **MCU-Link CMSIS-DAP**  |                    |                    |                     |                    |         ✓          |
|  Debug Probes  +-------------------------+--------------------+--------------------+---------------------+--------------------+--------------------+
|                | **MCU-Link J-Link**     |           ✓        |                    |                     |                    |                    |
|                +-------------------------+--------------------+--------------------+---------------------+--------------------+--------------------+
|                | **NXP S32 Debug Probe** |                    |                    |                     |          ✓         |                    |
|                +-------------------------+--------------------+--------------------+---------------------+--------------------+--------------------+
|                | **OpenSDA DAPLink**     |                    |          ✓         |          ✓          |                    |         ✓          |
|                +-------------------------+--------------------+--------------------+---------------------+--------------------+--------------------+
|                | **OpenSDA J-Link**      |           ✓        |                    |                     |                    |                    |
|                +-------------------------+--------------------+--------------------+---------------------+--------------------+--------------------+
|                | **ST-LINK/V2-1**        |           ✓        |          ✓         | *some STM32 boards* |                    |                    |
+----------------+-------------------------+--------------------+--------------------+---------------------+--------------------+--------------------+


Some supported boards in Zephyr do not include an onboard debug probe and
therefore require an external debug probe. In addition, boards that do include
an onboard debug probe often also have an SWD or JTAG header to enable the use
of an external debug probe instead. One reason this may be useful is that the
onboard debug probe may have limitations, such as lack of support for advanced
debuggers or high-speed tracing. You may need to adjust jumpers to prevent the
onboard debug probe from interfering with the external debug probe.

.. _nxp-onboard-debug-probes:

NXP Onboard Debug Probes
************************

NXP boards may have one of several onboard debug probes. These probes include
the :ref:`mcu-link-onboard-debug-probe`, :ref:`lpc-link2-onboard-debug-probe`
and :ref:`opensda-onboard-debug-probe`. Each of these probes is implemented
as a secondary microcontroller present on the evaluation board. The specific
debug probe type present on a given board can be determined based on the
debug microcontroller SOC:

- LPC55S69: :ref:`mcu-link-onboard-debug-probe`
- LPC4322: :ref:`lpc-link2-onboard-debug-probe`
- MK20: :ref:`opensda-onboard-debug-probe`

For example, the :ref:`frdm_k64f` board has an MK20 debug microcontroller,
so this board uses the :ref:`opensda-onboard-debug-probe`.

.. _mcu-link-onboard-debug-probe:

MCU-Link Onboard Debug Probe
****************************

The MCU-Link onboard debug probe uses an LPC55S69 SOC. This probe supports
the following firmwares:

- :ref:`mcu-link-cmsis-onboard-debug-probe` (default firmware)
- :ref:`mcu-link-jlink-onboard-debug-probe`

This probe is programmed using the MCU-Link host tools, which are installed
with the :ref:`linkserver-debug-host-tools`. NXP recommends using NXP's
`MCUXpresso Installer`_ to install the Linkserver tools.

.. _mcu-link-cmsis-onboard-debug-probe:

MCU-Link CMSIS-DAP Onboard Debug Probe
======================================

This is the default firmware installed on MCU-Link debug probes.  The CMSIS-DAP
debug probes allow debugging from any compatible toolchain, including IAR
EWARM, Keil MDK, NXP’s MCUXpresso IDE and MCUXpresso extension for VS Code. In
addition to debug probe functionality, the MCU-Link probes may also provide:

1. SWO trace end point: this virtual device is used by MCUXpresso to retrieve
   SWO trace data. See the MCUXpresso IDE documentation for more information.
#. Virtual COM (VCOM) port / UART bridge connected to the target processor
#. USB to UART, SPI and/or I2C interfaces (depending on MCU-Link
   type/implementation)
#. Energy measurements of the target MCU

This debug probe is compatible with the following debug host tools:

- :ref:`linkserver-debug-host-tools`

Once the MCU-Link host tools are installed, the following steps are
required to program the CMSIS-DAP firmware:

1. Make sure the MCU-Link utility is present on your host machine. This can
   be done by installing :ref:`linkserver-debug-host-tools`.

#. Put the MCU-Link microcontroller into DFU boot mode by attaching the DFU
   jumper then connecting to the USB debug port on the board.  This jumper may
   also be referred to as the ISP jumper, and will be connected to ``PIO0_5``
   on the LPC55S69.

#. Run the ``program_CMSIS`` script, found in the installed MCU-Link ``scripts``
   folder.

#. Remove the DFU jumper and power cycle the board.

.. _mcu-link-jlink-onboard-debug-probe:

MCU-Link JLink Onboard Debug Probe
==================================

This debug probe firmware provides a JLink compatible debug interface,
as well as a USB-Serial adapter. It is compatible with the following debug host
tools:

- :ref:`jlink-debug-host-tools`

These probes do not have JLink firmware installed by default, and must be
updated. Once the MCU-Link host tools are installed, the following steps are
required to program the JLink firmware:

1. Make sure the MCU-Link utility is present on your host machine. This can
   be done by installing :ref:`linkserver-debug-host-tools`.

#. Put the MCU-Link microcontroller into DFU boot mode by attaching the DFU
   jumper then connecting to the USB debug port on the board.  This jumper may
   also be referred to as the ISP jumper, and will be connected to ``PIO0_5``
   on the LPC55S69.

#. Run the ``program_JLINK`` script, found in the installed MCU-Link ``scripts``
   folder.

#. Remove the DFU jumper and power cycle the board.

.. _lpc-link2-onboard-debug-probe:

LPC-LINK2 Onboard Debug Probe
*****************************

The LPC-LINK2 onboard debug probe uses an LPC4322 SOC. This probe supports
the following firmwares:

- :ref:`lpclink2-cmsis-onboard-debug-probe`
- :ref:`lpclink2-jlink-onboard-debug-probe`
- :ref:`lpclink2-daplink-onboard-debug-probe` (default firmware)

This probe is programmed using the LPCScrypt host tools, which are installed
with the :ref:`linkserver-debug-host-tools`. NXP recommends using NXP's
`MCUXpresso Installer`_ to install the Linkserver tools.

.. _lpclink2-cmsis-onboard-debug-probe:

LPC-LINK2 CMSIS DAP Onboard Debug Probe
=======================================

The CMSIS-DAP debug probes allow debugging from any compatible toolchain,
including IAR EWARM, Keil MDK, as well as NXP’s MCUXpresso IDE and
MCUXpresso extension for VS Code.
As well as providing debug probe functionality, the LPC-Link2 probes also
provide:

1. SWO trace end point: this virtual device is used by MCUXpresso to retrieve
   SWO trace data. See the MCUXpresso IDE documentation for more information.
2. Virtual COM (VCOM) port / UART bridge connected to the target processor
3. LPCSIO bridge that provides communication to I2C and SPI slave devices

This debug probe firmware is compatible with the following debug host tools:

- :ref:`linkserver-debug-host-tools`

The probe may be updated to use CMSIS-DAP firmware with the following steps:

1. Make sure the LPCScrypt utility is present on your host machine. This can
   be done by installing :ref:`linkserver-debug-host-tools`.

#. Put the LPC-Link2 microcontroller into DFU boot mode by attaching the DFU
   jumper, then connecting to the USB debug port on the board. This
   jumper is connected to ``P2_6`` on the LPC4322 SOC.

#. Run the ``program_CMSIS`` script, found in the installed LPCScrypt ``scripts``
   folder.

#. Remove the DFU jumper and power cycle the board.

.. _lpclink2-jlink-onboard-debug-probe:

LPC-Link2 J-Link Onboard Debug Probe
====================================

.. note:: On some boards, the J-Link probe firmware will no longer power the
   board via the USB debug port. On these boards, an alternative method
   of powering the board must be used when this firmware is programmed.

This debug probe firmware provides a JLink compatible debug interface,
as well as a USB-Serial adapter. It is compatible with the following debug host
tools:

- :ref:`jlink-debug-host-tools`

The probe may be updated to use the J-Link firmware with the following steps:

.. note:: Verify the firmware supports your board by visiting `Firmware for LPCXpresso`_

1. Make sure the LPCScrypt utility is present on your host machine. This can
   be done by installing :ref:`linkserver-debug-host-tools`.

#. Put the LPC-Link2 microcontroller into DFU boot mode by attaching the DFU
   jumper, then connecting to the USB debug port on the board. This
   jumper is connected to ``P2_6`` on the LPC4322 SOC.

#. Run the ``program_JLINK`` script, found in the installed LPCScrypt ``scripts``
   folder.

#. Remove the DFU jumper and power cycle the board.

.. _lpclink2-daplink-onboard-debug-probe:

LPC-Link2 DAPLink Onboard Debug Probe
=====================================

The LPC-Link2 DAPLink firmware is the default firmware shipped on LPC-Link2
based boards, but is not the recommended firmware. Users should update to
the :ref:`lpclink2-cmsis-onboard-debug-probe` firmware following the
instructions provided above. For details on programming the DAPLink firmware,
see `NXP AN13206`_.

.. _opensda-onboard-debug-probe:

OpenSDA Onboard Debug Probe
***************************

The OpenSDA onboard debug probe is based on the NXP MK20 SOC. It features
drag and drop programming supports, and supports the following debug firmwares:

- :ref:`opensda-daplink-onboard-debug-probe` (default firmware)
- :ref:`opensda-jlink-onboard-debug-probe`

.. _opensda-daplink-onboard-debug-probe:

OpenSDA DAPLink Onboard Debug Probe
===================================

This debug probe firmware is compatible with the following debug host tools:

- :ref:`pyocd-debug-host-tools`
- :ref:`openocd-debug-host-tools`
- :ref:`linkserver-debug-host-tools`

This probe is realized by programming the OpenSDA microcontroller with DAPLink
OpenSDA firmware. NXP provides `OpenSDA DAPLink Board-Specific Firmwares`_.

Install the debug host tools before you program the firmware.

As with all OpenSDA debug probes, the steps for programming the firmware are:

1. Put the OpenSDA microcontroller into bootloader mode by holding the reset
   button while you power on the board. Note that "bootloader mode" in this
   context applies to the OpenSDA microcontroller itself, not the target
   microcontroller of your Zephyr application.

#. After you power on the board, release the reset button. A USB mass storage
   device called **BOOTLOADER** or **MAINTENANCE** will enumerate. If the
   enumerated device is named **BOOTLOADER**, please first update the bootloader
   to the latest revision by following the instructions for a
   `DAPLink Bootloader Update`_.

#. Copy the OpenSDA firmware binary to the USB mass storage device.

#. Power cycle the board, this time without holding the reset button. You
   should see three USB devices enumerate: a CDC device (serial port), a HID
   device (debug port), and a mass storage device (drag-and-drop flash
   programming).

.. _opensda-jlink-onboard-debug-probe:

OpenSDA J-Link Onboard Debug Probe
==================================

This debug probe is compatible with the following debug host tools:

- :ref:`jlink-debug-host-tools`

This probe is realized by programming the OpenSDA microcontroller with J-Link
OpenSDA firmware. Segger provides `OpenSDA J-Link Generic Firmwares`_ and
`OpenSDA J-Link Board-Specific Firmwares`_, where the latter is generally
recommended when available. Board-specific firmwares are required for i.MX RT
boards to support their external flash memories, whereas generic firmwares are
compatible with all Kinetis boards.

Install the debug host tools before you program the firmware.

As with all OpenSDA debug probes, the steps for programming the firmware are:

1. Put the OpenSDA microcontroller into bootloader mode by holding the reset
   button while you plug a USB into the board's USB debug port. Note that
   "bootloader mode" in this context applies to the OpenSDA microcontroller
   itself, not the target microcontroller of your Zephyr application.

#. After you power on the board, release the reset button. A USB mass storage
   device called **BOOTLOADER** or **MAINTENANCE** will enumerate. If the
   enumerated device is named **BOOTLOADER**, please first update the bootloader
   to the latest revision by following the instructions for a
   `DAPLink Bootloader Update`_.

#. Copy the OpenSDA firmware binary to the USB mass storage device.

#. Power cycle the board, this time without holding the reset button. You
   should see two USB devices enumerate: a CDC device (serial port) and a
   vendor-specific device (debug port).

.. _jlink-external-debug-probe:

J-Link External Debug Probe
***************************

`Segger J-Link`_ is a family of external debug probes, including J-Link EDU,
J-Link PLUS, J-Link ULTRA+, and J-Link PRO, that support a large number of
devices from different hardware architectures and vendors.

This debug probe is compatible with the following debug host tools:

- :ref:`jlink-debug-host-tools`
- :ref:`openocd-debug-host-tools`

Install the debug host tools before you program the firmware.

.. _stlink-v21-onboard-debug-probe:

ST-LINK/V2-1 Onboard Debug Probe
********************************

ST-LINK/V2-1 is a serial and debug adapter built into all Nucleo and Discovery
boards. It provides a bridge between your computer (or other USB host) and the
embedded target processor, which can be used for debugging, flash programming,
and serial communication, all over a simple USB cable.

It is compatible with the following host debug tools:

- :ref:`openocd-debug-host-tools`
- :ref:`jlink-debug-host-tools`

For some STM32 based boards, it is also compatible with:

- :ref:`pyocd-debug-host-tools`

While it works out of the box with OpenOCD, it requires some flashing
to work with J-Link. To do this, SEGGER offers a firmware upgrading the
ST-LINK/V2-1 on board on the Nucleo and Discovery boards. This firmware makes
the ST-LINK/V2-1 compatible with J-LinkOB, allowing users to take advantage of
most J-Link features like the ultra fast flash download and debugging speed or
the free-to-use GDBServer.

More information about upgrading ST-LINK/V2-1 to JLink or restore ST-Link/V2-1
firmware please visit: `Segger over ST-Link`_

Flash and debug with ST-Link
============================

.. tabs::

    .. tab:: Using OpenOCD

        OpenOCD is available by default on ST-Link and configured as the default flash
        and debug tool. Flash and debug can be done as follows:

          .. zephyr-app-commands::
             :zephyr-app: samples/hello_world
             :goals: flash

          .. zephyr-app-commands::
             :zephyr-app: samples/hello_world
             :goals: debug

    .. tab:: _`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 CMake with ``-DBOARD_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.

          .. code-block:: cmake

             set(BOARD_FLASH_RUNNER jlink)

        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:

          .. code-block:: console

             $ telnet localhost 19021
             Trying ::1...
             Trying 127.0.0.1...
             Connected to localhost.
             Escape character is '^]'.
             SEGGER J-Link V6.30f - Real time terminal output
             J-Link STLink V21 compiled Jun 26 2017 10:35:16 V1.0, SN=773895351
             Process: JLinkGDBServerCLExe
             Zephyr Shell, Zephyr version: 1.12.99
             Type 'help' for a list of available commands
             shell>

        If you get no RTT output you might need to disable other consoles which conflict
        with the RTT one if they are enabled by default in the particular sample or
        application you are running, such as disable UART_CONSOLE in menuconfig

Updating or restoring ST-Link firmware
======================================

ST-Link firmware can be updated using `STM32CubeProgrammer Tool`_.
It is usually useful when facing flashing issues, for instance when using
twister's device-testing option.

Once installed, you can update attached board ST-Link firmware with the
following command

  .. code-block:: console

     s java -jar ~/STMicroelectronics/STM32Cube/STM32CubeProgrammer/Drivers/FirmwareUpgrade/STLinkUpgrade.jar -sn <board_uid>

Where board_uid can be obtained using twister's generate-hardware-map
option. For more information about twister and available options, see
:ref:`twister_script`.

.. _nxp-s32-debug-probe:

NXP S32 Debug Probe
*******************

`NXP S32 Debug Probe`_ enables NXP S32 target system debugging via a standard
debug port while connected to a developer's workstation via USB or remotely via
Ethernet.

NXP S32 Debug Probe is designed to work in conjunction with NXP S32 Design Studio
(S32DS) and NXP Automotive microcontrollers and processors. Install the debug
host tools as in indicated in :ref:`nxp-s32-debug-host-tools` before you program
the firmware.

.. _LPCScrypt:
   https://www.nxp.com/lpcscrypt

.. _Firmware for LPCXpresso:
   https://www.segger.com/products/debug-probes/j-link/models/other-j-links/lpcxpresso-on-board/

.. _OpenSDA DAPLink Board-Specific Firmwares:
   https://www.nxp.com/opensda

.. _OpenSDA J-Link Generic Firmwares:
   https://www.segger.com/downloads/jlink/#JLinkOpenSDAGenericFirmwares

.. _OpenSDA J-Link Board-Specific Firmwares:
   https://www.segger.com/downloads/jlink/#JLinkOpenSDABoardSpecificFirmwares

.. _Segger J-Link:
   https://www.segger.com/products/debug-probes/j-link/

.. _Segger over ST-Link:
   https://www.segger.com/products/debug-probes/j-link/models/other-j-links/st-link-on-board/

.. _Segger RTT:
    https://www.segger.com/jlink-rtt.html

.. _STM32CubeProgrammer Tool:
    https://www.st.com/en/development-tools/stm32cubeprog.html

.. _MCUXpresso Installer:
	https://www.nxp.com/lgfiles/updates/mcuxpresso/MCUXpressoInstaller.exe

.. _NXP S32 Debug Probe:
   https://www.nxp.com/design/software/automotive-software-and-tools/s32-debug-probe:S32-DP

.. _NXP AN13206:
   https://www.nxp.com/docs/en/application-note/AN13206.pdf

.. _DAPLink Bootloader Update:
   https://os.mbed.com/blog/entry/DAPLink-bootloader-update/

Part 3

한국어 전문 번역

Debug probe

Debug probe는 별도 board에서 실행되는 Zephyr application의 실행을 제어하는 특수 hardware입니다. 보통 register와 memory를 읽고 쓸 수 있고, host workstation의 GDB 같은 도구로 breakpoint debugging을 지원합니다. 다른 debug software나 program execution tracing 같은 고급 기능도 지원할 수 있습니다. Zephyr가 지원하는 관련 host software는 Flash와 debug host 도구를 참고하십시오.

Debug probe는 보통 USB로 host workstation에 연결하지만 IP network나 다른 방식으로 접근할 때도 있습니다. Zephyr를 실행하는 device에는 대개 JTAG 또는 SWD protocol로 연결합니다. Probe는 별도 hardware device이거나 Zephyr를 실행하는 board에 통합된 circuit일 수 있습니다.

Zephyr가 지원하는 많은 board에는 on-board debug probe, USB-to-serial adapter, 때로는 drag-and-drop flash programmer 역할을 하는 두 번째 microcontroller가 있습니다. External probe를 따로 살 필요가 없고 여러 debug host tool을 선택할 수 있습니다.

여러 vendor가 자체 on-board debug probe를 제공합니다. NXP board는 debug firmware가 실행되는 microcontroller에 따라 OpenSDA, LPC-Link2, MCU-Link를 사용합니다. ST board에는 ST-LINK probe가 있습니다. 각 on-board probe microcontroller는 host tool과 통신하는 firmware type을 하나 이상 지원할 수 있습니다. 예를 들어 OpenSDA에 DAPLink firmware를 program하면 pyOCD·OpenOCD와 통신하고 J-Link firmware를 program하면 J-Link host tool과 통신합니다.

Debug probeJ-Link DebugOpenOCDpyOCDNXP S32DSNXP LinkServer
J-Link External✓✓
LPC-Link2 CMSIS-DAP✓
LPC-Link2 J-Link✓
MCU-Link CMSIS-DAP✓
MCU-Link J-Link✓
NXP S32 Debug Probe✓
OpenSDA DAPLink✓✓✓
OpenSDA J-Link✓
ST-LINK/V2-1✓✓일부 STM32 board

일부 Zephyr board에는 on-board debug probe가 없어 external probe가 필요합니다. On-board probe가 있는 board도 external probe를 위한 SWD·JTAG header를 제공하는 경우가 많습니다. On-board probe가 고급 debugger 또는 high-speed tracing을 지원하지 않는 등 제한이 있을 때 유용합니다. On-board probe가 external probe를 방해하지 않도록 jumper를 조정해야 할 수도 있습니다.

NXP on-board debug probe

NXP board는 MCU-Link, LPC-Link2, OpenSDA 중 하나를 on-board debug probe로 사용할 수 있습니다. 모두 evaluation board의 보조 microcontroller로 구현됩니다. Debug microcontroller SoC로 probe type을 구분할 수 있습니다.

  • LPC55S69: MCU-Link on-board debug probe
  • LPC4322: LPC-Link2 on-board debug probe
  • MK20: OpenSDA on-board debug probe

예를 들어 frdm_k64f board의 debug microcontroller는 MK20이므로 OpenSDA on-board debug probe를 사용합니다.

MCU-Link on-board debug probe

MCU-Link on-board debug probe는 LPC55S69 SoC를 사용하며 다음 firmware를 지원합니다.

  • MCU-Link CMSIS-DAP on-board debug probe(기본 firmware)
  • MCU-Link J-Link on-board debug probe

Probe는 LinkServer debug host 도구와 함께 설치되는 MCU-Link host tool로 program합니다. NXP는 MCUXpresso Installer를 사용해 LinkServer tool을 설치할 것을 권장합니다.

MCU-Link CMSIS-DAP on-board debug probe

MCU-Link debug probe에 기본 설치되는 firmware입니다. CMSIS-DAP probe는 IAR EWARM, Keil MDK, NXP MCUXpresso IDE, VS Code용 MCUXpresso extension 등 호환 toolchain에서 debug할 수 있습니다. Debug probe 기능 외에 다음을 제공할 수 있습니다.

  1. SWO trace endpoint: MCUXpresso가 SWO trace data를 가져오는 virtual device입니다.
  2. Target processor에 연결되는 VCOM(Virtual COM) port/UART bridge
  3. MCU-Link type·구현에 따른 USB-to-UART, SPI, I2C interface
  4. Target MCU energy measurement

호환 debug host tool:

MCU-Link host tool 설치 후 CMSIS-DAP firmware를 program하는 절차:

  1. Host computer에 MCU-Link utility가 있는지 확인합니다. LinkServer debug host tool을 설치하면 됩니다.
  2. DFU jumper를 연결한 뒤 board의 USB debug port에 연결해 MCU-Link microcontroller를 DFU boot mode로 넣습니다. 이 jumper를 ISP jumper라고도 하며 LPC55S69의 PIO0_5에 연결됩니다.
  3. 설치된 MCU-Link scripts folder의 program_CMSIS script를 실행합니다.
  4. DFU jumper를 제거하고 board 전원을 껐다 켭니다.

MCU-Link J-Link on-board debug probe

J-Link compatible debug interface와 USB-Serial adapter를 제공하는 firmware입니다. 호환 debug host tool:

J-Link firmware는 기본 설치되지 않으므로 update해야 합니다. MCU-Link host tool 설치 후 절차:

  1. Host computer에 MCU-Link utility가 있는지 확인합니다. LinkServer debug host tool을 설치하면 됩니다.
  2. DFU jumper를 연결하고 USB debug port에 연결해 MCU-Link microcontroller를 DFU boot mode로 넣습니다. ISP jumper라고도 하며 LPC55S69의 PIO0_5에 연결됩니다.
  3. 설치된 MCU-Link scripts folder의 program_JLINK script를 실행합니다.
  4. DFU jumper를 제거하고 board 전원을 껐다 켭니다.

LPC-Link2 on-board debug probe

LPC-Link2 on-board debug probe는 LPC4322 SoC를 사용하며 다음 firmware를 지원합니다.

  • LPC-Link2 CMSIS-DAP on-board debug probe
  • LPC-Link2 J-Link on-board debug probe
  • LPC-Link2 DAPLink on-board debug probe(기본 firmware)

Probe는 LinkServer debug host 도구와 함께 설치되는 LPCScrypt host tool로 program합니다. NXP는 MCUXpresso Installer로 LinkServer tool을 설치할 것을 권장합니다.

LPC-Link2 CMSIS-DAP on-board debug probe

CMSIS-DAP probe는 IAR EWARM, Keil MDK, NXP MCUXpresso IDE, VS Code용 MCUXpresso extension 등 호환 toolchain에서 debug할 수 있습니다. Debug 기능 외에 다음을 제공합니다.

  1. SWO trace endpoint: MCUXpresso가 SWO trace data를 가져오는 virtual device입니다.
  2. Target processor에 연결되는 VCOM port/UART bridge
  3. I2C·SPI slave device 통신용 LPCSIO bridge

호환 debug host tool:

CMSIS-DAP firmware update 절차:

  1. Host computer에 LPCScrypt utility가 있는지 확인합니다. LinkServer debug host tool을 설치하면 됩니다.
  2. DFU jumper를 연결하고 USB debug port에 연결해 LPC-Link2 microcontroller를 DFU boot mode로 넣습니다. Jumper는 LPC4322 SoC의 P2_6에 연결됩니다.
  3. 설치된 LPCScrypt scripts folder의 program_CMSIS script를 실행합니다.
  4. DFU jumper를 제거하고 board 전원을 껐다 켭니다.

LPC-Link2 J-Link on-board debug probe

J-Link compatible debug interface와 USB-Serial adapter를 제공하는 firmware입니다. 호환 debug host tool:

다음 절차로 J-Link firmware로 update할 수 있습니다.

  1. Host computer에 LPCScrypt utility가 있는지 확인합니다. LinkServer debug host tool을 설치하면 됩니다.
  2. DFU jumper를 연결하고 USB debug port에 연결해 LPC-Link2 microcontroller를 DFU boot mode로 넣습니다. Jumper는 LPC4322 SoC의 P2_6에 연결됩니다.
  3. 설치된 LPCScrypt scripts folder의 program_JLINK script를 실행합니다.
  4. DFU jumper를 제거하고 board 전원을 껐다 켭니다.

LPC-Link2 DAPLink on-board debug probe

LPC-Link2 기반 board에 출하 시 기본 설치되는 firmware지만 권장 firmware는 아닙니다. 위 절차에 따라 LPC-Link2 CMSIS-DAP firmware로 update하는 것이 좋습니다. DAPLink firmware programming은 NXP AN13206을 참고하십시오.

OpenSDA on-board debug probe

OpenSDA on-board debug probe는 NXP MK20 SoC 기반이며 drag-and-drop programming과 다음 debug firmware를 지원합니다.

  • OpenSDA DAPLink on-board debug probe(기본 firmware)
  • OpenSDA J-Link on-board debug probe

OpenSDA DAPLink on-board debug probe

호환 debug host tool:

OpenSDA microcontroller에 DAPLink OpenSDA firmware를 program해 구현합니다. NXP는 OpenSDA DAPLink board별 firmware를 제공합니다. Firmware programming 전에 debug host tool을 설치하십시오.

모든 OpenSDA debug probe의 firmware programming 절차:

  1. Board 전원을 켜는 동안 reset button을 누르고 있어 OpenSDA microcontroller를 bootloader mode로 넣습니다. 여기서 bootloader mode는 Zephyr application의 target microcontroller가 아니라 OpenSDA microcontroller에 적용됩니다.
  2. 전원을 켠 뒤 reset button을 놓습니다. BOOTLOADER 또는 MAINTENANCE라는 USB mass storage device가 나타납니다. 이름이 BOOTLOADER라면 먼저 DAPLink Bootloader Update 절차로 bootloader를 최신 revision으로 갱신합니다.
  3. OpenSDA firmware binary를 USB mass storage device로 복사합니다.
  4. 이번에는 reset button을 누르지 않고 board 전원을 껐다 켭니다. CDC device(serial port), HID device(debug port), mass storage device(drag-and-drop flash programming) 세 개가 나타나야 합니다.

OpenSDA J-Link on-board debug probe

호환 debug host tool:

OpenSDA microcontroller에 J-Link OpenSDA firmware를 program해 구현합니다. Segger는 OpenSDA J-Link generic firmware와 board별 firmware를 제공합니다. 가능하면 board별 firmware를 권장합니다. i.MX RT board는 external flash memory 지원을 위해 board별 firmware가 필요하고 generic firmware는 모든 Kinetis board와 호환됩니다. Firmware programming 전에 debug host tool을 설치하십시오.

모든 OpenSDA debug probe의 firmware programming 절차:

  1. USB cable을 board의 USB debug port에 연결하는 동안 reset button을 눌러 OpenSDA microcontroller를 bootloader mode로 넣습니다. Target microcontroller의 bootloader mode가 아닙니다.
  2. 전원을 켠 뒤 reset button을 놓습니다. BOOTLOADER 또는 MAINTENANCE USB mass storage device가 나타납니다. 이름이 BOOTLOADER라면 DAPLink Bootloader Update로 먼저 최신 revision을 설치합니다.
  3. OpenSDA firmware binary를 USB mass storage device로 복사합니다.
  4. Reset button을 누르지 않고 board 전원을 껐다 켭니다. CDC device(serial port)와 vendor-specific device(debug port) 두 개가 나타나야 합니다.

J-Link external debug probe

Segger J-Link는 J-Link EDU, PLUS, ULTRA+, PRO 등을 포함한 external debug probe 제품군이며 여러 architecture와 vendor의 많은 device를 지원합니다.

호환 debug host tool:

Firmware를 program하기 전에 debug host tool을 설치하십시오.

ST-LINK/V2-1 on-board debug probe

ST-LINK/V2-1은 모든 Nucleo·Discovery board에 내장된 serial·debug adapter입니다. 단일 USB cable로 computer와 embedded target processor를 연결해 debugging, flash programming, serial communication을 수행합니다.

호환 host debug tool:

일부 STM32 board에서는 다음과도 호환됩니다.

OpenOCD는 별도 변경 없이 동작하지만 J-Link로 사용하려면 firmware를 flash해야 합니다. SEGGER는 Nucleo·Discovery board의 ST-LINK/V2-1을 J-LinkOB와 호환되게 하는 upgrade firmware를 제공합니다. 빠른 flash download·debug speed와 무료 GDBServer 등 대부분의 J-Link 기능을 사용할 수 있습니다.

J-Link로 upgrade하거나 ST-LINK/V2-1 firmware를 복원하는 자세한 내용은 Segger over ST-Link를 참고하십시오.

ST-Link로 flash와 debug

OpenOCD 사용: ST-Link에서 기본 제공되고 기본 flash·debug tool로 구성됩니다.

# From the root of the zephyr repository
west build -b None samples/hello_world
west flash
# From the root of the zephyr repository
west build -b None samples/hello_world
west debug

Segger J-Link 사용: ST-Link에 SEGGER firmware를 flash하고 host computer에 J-Link GDB server를 설치한 뒤 사용할 수 있습니다.

-DBOARD_FLASH_RUNNER=jlink를 CMake에 전달해 기본 OpenOCD runner를 J-Link로 바꿉니다. 또는 application CMakeLists.txt에 다음을 추가합니다.

set(BOARD_FLASH_RUNNER jlink)

West에서는 --runner 또는 -r option으로 기본 runner를 바꿉니다.

west flash --runner jlink

jlink로 board debugger에 attach하고 debug console을 엽니다.

west debug --runner jlink

west 문서에서 option을 더 확인할 수 있습니다.

Segger RTT console을 사용하도록 Zephyr application을 구성했다면 telnet을 엽니다.

$ telnet localhost 19021
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
SEGGER J-Link V6.30f - Real time terminal output
J-Link STLink V21 compiled Jun 26 2017 10:35:16 V1.0, SN=773895351
Process: JLinkGDBServerCLExe
Zephyr Shell, Zephyr version: 1.12.99
Type 'help' for a list of available commands
shell>

RTT output이 없으면 sample/application에서 기본 enable된 다른 console이 충돌할 수 있습니다. Menuconfig에서 UART_CONSOLE 등을 disable하십시오.

ST-Link firmware update 또는 복원

STM32CubeProgrammer Tool로 ST-Link firmware를 update할 수 있습니다. Twister device-testing option 사용 시 flash 문제가 생길 때 특히 유용합니다.

설치 후 연결된 board의 ST-Link firmware를 다음 command로 갱신합니다.

s java -jar ~/STMicroelectronics/STM32Cube/STM32CubeProgrammer/Drivers/FirmwareUpgrade/STLinkUpgrade.jar -sn <board_uid>

board_uid는 Twister의 generate-hardware-map option으로 얻을 수 있습니다. 자세한 내용은 Twister를 참고하십시오.

NXP S32 Debug Probe

NXP S32 Debug Probe는 developer workstation에 USB 또는 Ethernet으로 연결한 상태에서 표준 debug port를 통해 NXP S32 target system을 debug합니다.

NXP S32 Design Studio(S32DS) 및 NXP Automotive microcontroller·processor와 함께 사용하도록 설계되었습니다. Firmware를 program하기 전에 NXP S32 debug host tool 설명에 따라 host tool을 설치하십시오.

Source

출처

영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.