Part 1
요약·해설
각 tool의 설치 위치, 지원 probe, west command와 runner option, flash partition, RTOS awareness를 비교하며 실제 command와 Devicetree 예제를 보존합니다.
SAM-BA · BOSSAC
J-Link · OpenOCD · pyOCD
LinkServer · TRACE32 · S32
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
E209548F865F462F2F980B7A22D9F04592CB59E3E8DA3490275553E6875ED5B7
.. _flash-debug-host-tools:
Flash & Debug Host Tools
########################
This guide describes the software tools you can run on your host workstation to
flash and debug Zephyr applications.
Zephyr's west tool has built-in support for all of these in its ``flash``,
``debug``, ``debugserver``, and ``attach`` commands, provided your board
hardware supports them and your Zephyr board directory's :file:`board.cmake`
file declares that support properly. See :ref:`west-build-flash-debug` for
more information on these commands.
.. _atmel_sam_ba_bootloader:
SAM Boot Assistant (SAM-BA)
***************************
Atmel SAM Boot Assistant (Atmel SAM-BA) allows In-System Programming (ISP)
from USB or UART host without any external programming interface. Zephyr
allows users to develop and program boards with SAM-BA support using
:ref:`west <west-flashing>`. Zephyr supports devices with/without ROM
bootloader and both extensions from Arduino and Adafruit. Full support was
introduced in Zephyr SDK 0.12.0.
The typical command to flash the board is:
.. code-block:: console
west flash [ -r bossac ] [ -p /dev/ttyX ]
Flash configuration for devices:
.. tabs::
.. tab:: With ROM bootloader
These devices don't need any special configuration. After building your
application, just run ``west flash`` to flash the board.
.. tab:: Without ROM bootloader
For these devices, the user should:
1. Define flash partitions required to accommodate the bootloader and
application image; see :ref:`flash_map_api` for details.
2. Have board :file:`.defconfig` file with the
:kconfig:option:`CONFIG_USE_DT_CODE_PARTITION` Kconfig option set to ``y`` to
instruct the build system to use these partitions for code relocation.
This option can also be set in ``prj.conf`` or any other Kconfig fragment.
3. Build and flash the SAM-BA bootloader on the device.
.. tab:: With compatible SAM-BA bootloader
For these devices, the user should:
1. Define flash partitions required to accommodate the bootloader and
application image; see :ref:`flash_map_api` for details.
2. Have board :file:`.defconfig` file with the
:kconfig:option:`CONFIG_BOOTLOADER_BOSSA` Kconfig option set to ``y``. This will
automatically select the :kconfig:option:`CONFIG_USE_DT_CODE_PARTITION` Kconfig
option which instruct the build system to use these partitions for code
relocation. The board :file:`.defconfig` file should have
:kconfig:option:`CONFIG_BOOTLOADER_BOSSA_ARDUINO` ,
:kconfig:option:`CONFIG_BOOTLOADER_BOSSA_ADAFRUIT_UF2` or the
:kconfig:option:`CONFIG_BOOTLOADER_BOSSA_LEGACY` Kconfig option set to ``y``
to select the right compatible SAM-BA bootloader mode.
These options can also be set in ``prj.conf`` or any other Kconfig fragment.
3. Build and flash the SAM-BA bootloader on the device.
.. note::
The :kconfig:option:`CONFIG_BOOTLOADER_BOSSA_LEGACY` Kconfig option should be used
as last resource. Try configure first with Devices without ROM bootloader.
Typical flash layout and configuration
--------------------------------------
For bootloaders that reside on flash, the devicetree partition layout is
mandatory. For devices that have a ROM bootloader, they are mandatory when
the application uses a storage or other non-application partition. In this
special case, the boot partition should be omitted and code_partition should
start from offset 0. It is necessary to define the partitions with sizes that
avoid overlaps, always.
A typical flash layout for devices without a ROM bootloader is:
.. code-block:: devicetree
/ {
chosen {
zephyr,code-partition = &code_partition;
};
};
&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
boot_partition: partition@0 {
label = "sam-ba";
reg = <0x00000000 0x2000>;
read-only;
};
code_partition: partition@2000 {
label = "code";
reg = <0x2000 0x3a000>;
read-only;
};
/*
* The final 16 KiB is reserved for the application.
* Storage partition will be used by FCB/LittleFS/NVS
* if enabled.
*/
storage_partition: partition@3c000 {
label = "storage";
reg = <0x0003c000 0x00004000>;
};
};
};
A typical flash layout for devices with a ROM bootloader and storage
partition is:
.. code-block:: devicetree
/ {
chosen {
zephyr,code-partition = &code_partition;
};
};
&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
code_partition: partition@0 {
label = "code";
reg = <0x0 0xF0000>;
read-only;
};
/*
* The final 64 KiB is reserved for the application.
* Storage partition will be used by FCB/LittleFS/NVS
* if enabled.
*/
storage_partition: partition@F0000 {
label = "storage";
reg = <0x000F0000 0x00100000>;
};
};
};
Enabling SAM-BA runner
----------------------
In order to instruct Zephyr west tool to use the SAM-BA bootloader the
:file:`board.cmake` file must have
``include(${ZEPHYR_BASE}/boards/common/bossac.board.cmake)`` entry. Note that
Zephyr tool accept more entries to define multiple runners. By default, the
first one will be selected when using ``west flash`` command. The remaining
options are available passing the runner option, for instance
``west flash -r bossac``.
More implementation details can be found in the :ref:`boards` documentation.
As a quick reference, see these three board documentation pages:
- :ref:`sam4e_xpro` (ROM bootloader)
- :ref:`adafruit_feather_m0_basic_proto` (Adafruit UF2 bootloader)
- :ref:`arduino_nano_33_iot` (Arduino bootloader)
- :ref:`arduino_nano_33_ble` (Arduino legacy bootloader)
Enabling BOSSAC on Windows Native [Experimental]
------------------------------------------------
Zephyr SDK´s bossac is currently supported on Linux and macOS only. Windows support
can be achieved by using the bossac version from `BOSSA official releases`_.
After installing using default options, the :file:`bossac.exe` must be added to
Windows PATH. A specific bossac executable can be used by passing the
``--bossac`` option, as follows:
.. code-block:: console
west flash -r bossac --bossac="C:\Program Files (x86)\BOSSA\bossac.exe" --bossac-port="COMx"
.. note::
WSL is not currently supported.
.. _linkserver-debug-host-tools:
LinkServer Debug Host Tools
****************************
Linkserver is a utility for launching and managing GDB servers for NXP debug probes,
which also provides a command-line target flash programming capabilities.
Linkserver can be used with the `NXP MCUXpresso for Visual Studio Code`_ implementation,
with custom debug configurations based on GNU tools or as part of a headless solution
for continuous integration and test. LinkServer can be used with MCU-Link, LPC-Link2,
LPC11U35-based and OpenSDA based standalone or on-board debug probes from NXP.
NXP recommends installing LinkServer by using NXP's `MCUXpresso Installer`_.
This method will also install the tools supporting the debug probes below,
including NXP's MCU-Link and LPCScrypt tools.
LinkServer is compatible with the following debug probes:
- :ref:`lpclink2-cmsis-onboard-debug-probe`
- :ref:`mcu-link-cmsis-onboard-debug-probe`
- :ref:`opensda-daplink-onboard-debug-probe`
To use LinkServer with West commands, the install folder should be added to the
:envvar:`PATH` :ref:`environment variable <env_vars>`. The default installation
path to add is:
.. tabs::
.. group-tab:: Linux
.. code-block:: console
/usr/local/LinkServer
.. group-tab:: Windows
.. code-block:: console
c:\nxp\LinkServer_<version>
Supported west commands:
1. flash
#. debug
#. debugserver
#. attach
Notes:
1. Probes can be listed with LinkServer:
.. code-block:: console
LinkServer probes
2. With multiple debug probes attached to the host, use the
LinkServer west runner ``--probe`` option to pass the probe index.
.. code-block:: console
west flash --runner=linkserver --probe=3
3. Device-specific settings can be overridden with the west runner for LinkServer with
the option '--override'. May be used multiple times. The format is dictated
by LinkServer, e.g.:
.. code-block:: console
west flash --runner=linkserver --override /device/memory/5/flash-driver=MIMXRT500_SFDP_MXIC_OSPI_S.cfx
4. LinkServer does not install an implicit breakpoint at the reset handler. If
you would like to single step from the start of their application, you
will need to add a breakpoint at ``main`` or the reset handler manually.
.. _jlink-debug-host-tools:
J-Link Debug Host Tools
***********************
Segger provides a suite of debug host tools for Linux, macOS, and Windows
operating systems:
- J-Link GDB Server: GDB remote debugging
- J-Link Commander: Command-line control and flash programming
- RTT Viewer: RTT terminal input and output
- SystemView: Real-time event visualization and recording
These debug host tools are compatible with the following debug probes:
- :ref:`lpclink2-jlink-onboard-debug-probe`
- :ref:`opensda-jlink-onboard-debug-probe`
- :ref:`mcu-link-jlink-onboard-debug-probe`
- :ref:`jlink-external-debug-probe`
- :ref:`stlink-v21-onboard-debug-probe`
Check if your SoC is listed in `J-Link Supported Devices`_.
Download and install the `J-Link Software and Documentation Pack`_ to get the
J-Link GDB Server and Commander, and to install the associated USB device
drivers. RTT Viewer and SystemView can be downloaded separately, but are not
required.
Note that the J-Link GDB server does not yet support Zephyr RTOS-awareness.
.. _openocd-debug-host-tools:
OpenOCD Debug Host Tools
************************
OpenOCD is a community open source project that provides GDB remote debugging
and flash programming support for a wide range of SoCs. A fork that adds Zephyr
RTOS-awareness is included in the Zephyr SDK; otherwise see `Getting OpenOCD`_
for options to download OpenOCD from official repositories.
These debug host tools are compatible with the following debug probes:
- :ref:`opensda-daplink-onboard-debug-probe`
- :ref:`jlink-external-debug-probe`
- :ref:`stlink-v21-onboard-debug-probe`
Check if your SoC is listed in `OpenOCD Supported Devices`_.
.. note:: On Linux, openocd is available though the `Zephyr SDK
<https://github.com/zephyrproject-rtos/sdk-ng/releases>`_.
Windows users should use the following steps to install
openocd:
- Download openocd for Windows from here: `OpenOCD Windows`_
- Copy bin and share dirs to ``C:\Program Files\OpenOCD\``
- Add ``C:\Program Files\OpenOCD\bin`` to 'PATH' environment variable
.. _pyocd-debug-host-tools:
pyOCD Debug Host Tools
**********************
pyOCD is an open source project from Arm that provides GDB remote debugging and
flash programming support for Arm Cortex-M SoCs. It is distributed on PyPi and
installed when you complete the :ref:`gs_python_deps` step in the Getting
Started Guide. pyOCD includes support for Zephyr RTOS-awareness.
These debug host tools are compatible with the following debug probes:
- :ref:`lpclink2-cmsis-onboard-debug-probe`
- :ref:`mcu-link-cmsis-onboard-debug-probe`
- :ref:`opensda-daplink-onboard-debug-probe`
- :ref:`stlink-v21-onboard-debug-probe`
Check if your SoC is listed in `pyOCD Supported Devices`_.
.. _lauterbach-trace32-debug-host-tools:
Lauterbach TRACE32 Debug Host Tools
***********************************
`Lauterbach TRACE32`_ is a product line of microprocessor development tools,
debuggers and real-time tracer with support for JTAG, SWD, NEXUS or ETM over
multiple core architectures, including Arm Cortex-A/-R/-M, RISC-V, Xtensa, etc.
Zephyr allows users to develop and program boards with Lauterbach TRACE32
support using :ref:`west <west-flashing>`.
The runner consists of a wrapper around TRACE32 software, and allows a Zephyr
board to execute a custom start-up script (Practice Script) for the different
commands supported, including the ability to pass extra arguments from CMake.
Is up to the board using this runner to define the actions performed on each
command.
Install Lauterbach TRACE32 Software
-----------------------------------
Download Lauterbach TRACE32 software from the `Lauterbach TRACE32 download website`_
(registration required) and follow the installation steps described in
`Lauterbach TRACE32 Installation Guide`_.
Flashing and Debugging
----------------------
Set the :ref:`environment variable <env_vars>` :envvar:`T32_DIR` to the TRACE32
system directory. Then execute ``west flash`` or ``west debug`` commands to
flash or debug the Zephyr application as detailed in :ref:`west-build-flash-debug`.
The ``debug`` command launches TRACE32 GUI to allow debug the Zephyr
application, while the ``flash`` command hides the GUI and perform all
operations in the background.
By default, the ``t32`` runner will launch TRACE32 using the default
configuration file named ``config.t32`` located in the TRACE32 system
directory. To use a different configuration file, supply the argument
``--config CONFIG`` to the runner, for example:
.. code-block:: console
west flash --config myconfig.t32
For more options, run ``west flash --context -r t32`` to print the usage.
Zephyr RTOS Awareness
---------------------
To enable Zephyr RTOS awareness follow the steps described in
`Lauterbach TRACE32 Zephyr OS Awareness Manual`_.
.. _nxp-s32-debug-host-tools:
NXP S32 Debug Probe Host Tools
******************************
:ref:`nxp-s32-debug-probe` is designed to work in conjunction with
`NXP S32 Design Studio for S32 Platform`_.
Download (registration required) NXP S32 Design Studio for S32 Platform and
follow the `S32 Design Studio for S32 Platform Installation User Guide`_ to get
the necessary debug host tools and associated USB device drivers.
Note that Zephyr RTOS-awareness support for the NXP S32 GDB server depends on
the target device. Consult the product release notes for more information.
Supported west commands:
1. debug
#. debugserver
#. attach
Basic usage
-----------
Before starting, add NXP S32 Design Studio installation directory to the system
:ref:`PATH environment variable <env_vars>`. Alternatively, it can be passed to
the runner on each invocation via ``--s32ds-path`` as shown below:
.. tabs::
.. group-tab:: Linux
.. code-block:: console
west debug --s32ds-path=/opt/NXP/S32DS.3.5
.. group-tab:: Windows
.. code-block:: console
west debug --s32ds-path=C:\NXP\S32DS.3.5
If multiple S32 debug probes are connected to the host via USB, the runner will
ask the user to select one via command line prompt before continuing. The
connection string for the probe can be also specified when invoking the runner
via ``--dev-id=<connection-string>``. Consult NXP S32 debug probe user manual
for details on how to construct the connection string. For example, if using a
probe with serial ID ``00:04:9f:00:ca:fe``:
.. code-block:: console
west debug --dev-id='s32dbg:00:04:9f:00:ca:fe'
It is possible to pass extra options to the debug host tools via ``--tool-opt``.
When executing ``debug`` or ``attach`` commands, the tool options will be passed
to the GDB client only. When executing ``debugserver``, the tool options will be
passed to the GDB server. For example, to load a Zephyr application to SRAM and
afterwards detach the debug session:
.. code-block:: console
west debug --tool-opt='--batch'
.. _J-Link Software and Documentation Pack:
https://www.segger.com/downloads/jlink/#J-LinkSoftwareAndDocumentationPack
.. _J-Link Supported Devices:
https://www.segger.com/downloads/supported-devices.php
.. _Getting OpenOCD:
https://openocd.org/pages/getting-openocd.html
.. _OpenOCD Supported Devices:
https://github.com/zephyrproject-rtos/openocd/tree/latest/tcl/target
.. _pyOCD Supported Devices:
https://github.com/pyocd/pyOCD/tree/main/pyocd/target/builtin
.. _OpenOCD Windows:
http://gnutoolchains.com/arm-eabi/openocd/
.. _Lauterbach TRACE32:
https://www.lauterbach.com/
.. _Lauterbach TRACE32 download website:
http://www.lauterbach.com/download_trace32.html
.. _Lauterbach TRACE32 Installation Guide:
https://www2.lauterbach.com/pdf/installation.pdf
.. _Lauterbach TRACE32 Zephyr OS Awareness Manual:
https://www2.lauterbach.com/pdf/rtos_zephyr.pdf
.. _BOSSA official releases:
https://github.com/shumatech/BOSSA/releases
.. _NXP MCUXpresso for Visual Studio Code:
https://www.nxp.com/design/software/development-software/mcuxpresso-software-and-tools-/mcuxpresso-for-visual-studio-code:MCUXPRESSO-VSC
.. _MCUXpresso Installer:
https://github.com/nxp-mcuxpresso/vscode-for-mcux/wiki/Dependency-Installation
.. _NXP S32 Design Studio for S32 Platform:
https://www.nxp.com/design/software/development-software/s32-design-studio-ide/s32-design-studio-for-s32-platform:S32DS-S32PLATFORM
.. _S32 Design Studio for S32 Platform Installation User Guide:
https://www.nxp.com/webapp/Download?colCode=S32DSIG
Part 3
한국어 전문 번역
Flash와 debug host 도구
이 guide는 host workstation에서 실행해 Zephyr application을 flash하고 debug할 수 있는 software tool을 설명합니다.
Board hardware가 해당 도구를 지원하고 Zephyr board directory의 board.cmake가 지원을 올바르게 선언했다면, Zephyr의 west는 flash, debug, debugserver, attach command에서 이 도구들을 기본 지원합니다. 자세한 내용은 west build·flash·debug를 참고하십시오.
SAM Boot Assistant(SAM-BA)
Atmel SAM Boot Assistant(Atmel SAM-BA)는 외부 programming interface 없이 USB 또는 UART host에서 ISP(In-System Programming)를 수행합니다. Zephyr 사용자는 west로 SAM-BA 지원 board를 개발하고 program할 수 있습니다. Zephyr는 ROM bootloader가 있는 device와 없는 device, Arduino·Adafruit 확장을 모두 지원하며 Zephyr SDK 0.12.0에서 완전한 지원이 도입되었습니다.
일반적인 board flash command:
west flash [ -r bossac ] [ -p /dev/ttyX ]Device 유형에 따른 flash 구성:
일반적인 flash layout과 구성
ROM bootloader가 있는 device: 특별한 구성이 필요 없습니다. Application을 build한 뒤 west flash를 실행해 board를 flash합니다.
ROM bootloader가 없는 device: 다음을 수행합니다.
- Bootloader와 application image를 수용하는 flash partition을 정의합니다. 자세한 내용은 Flash map API를 참고하십시오.
- Board
.defconfig에서CONFIG_USE_DT_CODE_PARTITION=y로 설정해 build system이 code relocation에 partition을 사용하도록 합니다.prj.conf또는 다른 Kconfig fragment에도 설정할 수 있습니다. - SAM-BA bootloader를 build해 device에 flash합니다.
Compatible SAM-BA bootloader가 있는 device: 다음을 수행합니다.
- Bootloader와 application image를 수용하는 flash partition을 정의합니다. 자세한 내용은 Flash map API를 참고하십시오.
- Board
.defconfig에서CONFIG_BOOTLOADER_BOSSA=y로 설정합니다. 그러면 code relocation에 partition을 사용하게 하는CONFIG_USE_DT_CODE_PARTITION이 자동 선택됩니다. 알맞은 SAM-BA mode를 고르려면CONFIG_BOOTLOADER_BOSSA_ARDUINO,CONFIG_BOOTLOADER_BOSSA_ADAFRUIT_UF2,CONFIG_BOOTLOADER_BOSSA_LEGACY중 하나도y로 설정합니다. 이 option들은prj.conf또는 다른 Kconfig fragment에도 설정할 수 있습니다. - SAM-BA bootloader를 build해 device에 flash합니다.
Flash에 위치하는 bootloader에는 Devicetree partition layout이 필수입니다. ROM bootloader가 있는 device도 application이 storage 또는 다른 비-application partition을 사용하면 layout이 필요합니다. 이 경우 boot partition을 생략하고 code_partition을 offset 0에서 시작해야 합니다. Partition 크기는 항상 서로 겹치지 않게 정의해야 합니다.
ROM bootloader가 없는 device의 일반적인 flash layout:
/ {
chosen {
zephyr,code-partition = &code_partition;
};
};
&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
boot_partition: partition@0 {
label = "sam-ba";
reg = <0x00000000 0x2000>;
read-only;
};
code_partition: partition@2000 {
label = "code";
reg = <0x2000 0x3a000>;
read-only;
};
/*
* The final 16 KiB is reserved for the application.
* Storage partition will be used by FCB/LittleFS/NVS
* if enabled.
*/
storage_partition: partition@3c000 {
label = "storage";
reg = <0x0003c000 0x00004000>;
};
};
};ROM bootloader와 storage partition이 있는 device의 일반적인 flash layout:
/ {
chosen {
zephyr,code-partition = &code_partition;
};
};
&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
code_partition: partition@0 {
label = "code";
reg = <0x0 0xF0000>;
read-only;
};
/*
* The final 64 KiB is reserved for the application.
* Storage partition will be used by FCB/LittleFS/NVS
* if enabled.
*/
storage_partition: partition@F0000 {
label = "storage";
reg = <0x000F0000 0x00100000>;
};
};
};SAM-BA runner enable
Zephyr west가 SAM-BA bootloader를 사용하게 하려면 board.cmake에 include(${ZEPHYR_BASE}/boards/common/bossac.board.cmake)가 있어야 합니다. Zephyr는 runner를 여러 개 정의하는 entry도 허용합니다. west flash에서는 기본적으로 첫 runner를 선택하며 나머지는 west flash -r bossac처럼 runner option으로 선택합니다.
Board 문서에서 구현 세부 사항을 확인할 수 있습니다. 빠른 reference가 되는 board 문서:
- sam4e_xpro: ROM bootloader
- adafruit_feather_m0_basic_proto: Adafruit UF2 bootloader
- arduino_nano_33_iot: Arduino bootloader
- arduino_nano_33_ble: Arduino legacy bootloader
Windows native에서 BOSSAC enable [Experimental]
Zephyr SDK의 bossac는 현재 Linux와 macOS에서만 지원합니다. Windows에서는 BOSSA 공식 release의 bossac를 사용할 수 있습니다. 기본 option으로 설치한 뒤 bossac.exe를 Windows PATH에 추가합니다. 특정 executable을 쓰려면 다음처럼 --bossac option을 전달합니다.
west flash -r bossac --bossac="C:\Program Files (x86)\BOSSA\bossac.exe" --bossac-port="COMx"LinkServer debug host 도구
LinkServer는 NXP debug probe용 GDB server를 시작하고 관리하며 command line에서 target flash programming도 수행하는 utility입니다. NXP MCUXpresso for Visual Studio Code, GNU tool 기반 custom debug configuration, CI·test용 headless solution과 함께 사용할 수 있습니다. MCU-Link, LPC-Link2, LPC11U35 기반 및 OpenSDA 기반의 standalone·on-board NXP debug probe를 지원합니다.
NXP는 MCUXpresso Installer로 LinkServer를 설치할 것을 권장합니다. 이 방법은 NXP MCU-Link와 LPCScrypt를 포함해 아래 debug probe 지원 도구도 설치합니다.
호환 debug probe:
West command에서 LinkServer를 사용하려면 설치 folder를 PATH 환경 변수에 추가합니다. 기본 설치 path:
Linux:
/usr/local/LinkServerWindows:
c:\nxp\LinkServer_<version>지원 west command:
flashdebugdebugserverattach
사용 시 참고 사항:
- LinkServer로 probe 목록을 확인할 수 있습니다.
LinkServer probes - Host에 여러 debug probe가 연결되어 있으면 LinkServer west runner의
--probeoption으로 probe index를 전달합니다.west flash --runner=linkserver --probe=3 - LinkServer west runner의
--override로 device별 setting을 덮어쓸 수 있으며 여러 번 사용할 수 있습니다. Format은 LinkServer가 정합니다.west flash --runner=linkserver --override /device/memory/5/flash-driver=MIMXRT500_SFDP_MXIC_OSPI_S.cfx - LinkServer는 reset handler에 암묵적 breakpoint를 설치하지 않습니다. Application 시작부터 single-step하려면
main또는 reset handler에 breakpoint를 직접 추가해야 합니다.
J-Link debug host 도구
Segger는 Linux, macOS, Windows용 debug host tool suite를 제공합니다.
- J-Link GDB Server: GDB remote debugging
- J-Link Commander: Command-line control과 flash programming
- RTT Viewer: RTT terminal input·output
- SystemView: Real-time event visualization·recording
호환 debug probe:
- LPC-Link2 J-Link on-board probe
- OpenSDA J-Link on-board probe
- MCU-Link J-Link on-board probe
- J-Link external probe
- ST-LINK/V2-1 on-board probe
사용 SoC가 J-Link Supported Devices에 있는지 확인하십시오.
J-Link Software and Documentation Pack을 내려받아 설치하면 J-Link GDB Server·Commander와 관련 USB device driver가 설치됩니다. RTT Viewer와 SystemView는 별도로 받을 수 있지만 필수는 아닙니다.
J-Link GDB server는 아직 Zephyr RTOS awareness를 지원하지 않습니다.
OpenOCD debug host 도구
OpenOCD는 다양한 SoC의 GDB remote debugging과 flash programming을 지원하는 community open-source project입니다. Zephyr RTOS awareness를 추가한 fork가 Zephyr SDK에 포함됩니다. 그 밖의 설치 방법은 Getting OpenOCD를 참고하십시오.
호환 debug probe:
사용 SoC가 OpenOCD Supported Devices에 있는지 확인하십시오.
pyOCD debug host 도구
pyOCD는 Arm Cortex-M SoC의 GDB remote debugging과 flash programming을 지원하는 Arm의 open-source project입니다. PyPI로 배포되며 시작 안내서의 Python dependency 설치 단계를 완료하면 설치됩니다. pyOCD는 Zephyr RTOS awareness를 지원합니다.
호환 debug probe:
- LPC-Link2 CMSIS-DAP on-board probe
- MCU-Link CMSIS-DAP on-board probe
- OpenSDA DAPLink on-board probe
- ST-LINK/V2-1 on-board probe
사용 SoC가 pyOCD Supported Devices에 있는지 확인하십시오.
Lauterbach TRACE32 debug host 도구
Lauterbach TRACE32는 Arm Cortex-A/-R/-M, RISC-V, Xtensa 등 여러 core architecture에서 JTAG, SWD, NEXUS, ETM을 지원하는 microprocessor 개발 도구·debugger·real-time tracer 제품군입니다. Zephyr 사용자는 west로 TRACE32 지원 board를 개발하고 program할 수 있습니다.
Runner는 TRACE32 software를 감싸는 wrapper이며, Zephyr board가 지원 command별 custom startup script(Practice Script)를 실행하고 CMake에서 추가 argument를 전달할 수 있게 합니다. 각 command가 수행할 동작은 runner를 사용하는 board가 정의해야 합니다.
Lauterbach TRACE32 software 설치
Lauterbach TRACE32 download website(등록 필요)에서 software를 내려받고 TRACE32 Installation Guide의 설치 단계를 따릅니다.
Flashing과 debugging
T32_DIR 환경 변수를 TRACE32 system directory로 설정합니다. 그다음 west flash 또는 west debug로 Zephyr application을 flash·debug합니다. debug는 TRACE32 GUI를 열고 flash는 GUI를 숨긴 채 모든 operation을 background에서 수행합니다.
t32 runner는 기본적으로 TRACE32 system directory의 config.t32를 사용합니다. 다른 configuration file은 --config CONFIG로 지정합니다.
west flash --config myconfig.t32추가 option은 west flash --context -r t32로 usage를 확인하십시오.
Zephyr RTOS awareness
Lauterbach TRACE32 Zephyr OS Awareness Manual 절차에 따라 Zephyr RTOS awareness를 enable합니다.
NXP S32 Debug Probe host 도구
NXP S32 Debug Probe는 NXP S32 Design Studio for S32 Platform과 함께 사용하도록 설계되었습니다.
NXP S32 Design Studio for S32 Platform을 내려받고(등록 필요) Installation User Guide를 따라 필요한 debug host tool과 USB device driver를 설치합니다.
NXP S32 GDB server의 Zephyr RTOS awareness 지원 여부는 target device에 따라 다릅니다. 자세한 내용은 제품 release note를 확인하십시오.
지원 west command:
debugdebugserverattach
기본 사용법
시작하기 전에 NXP S32 Design Studio 설치 directory를 system PATH 환경 변수에 추가합니다. 또는 각 runner 호출에서 --s32ds-path로 전달할 수 있습니다.
Linux:
west debug --s32ds-path=/opt/NXP/S32DS.3.5Windows:
west debug --s32ds-path=C:\NXP\S32DS.3.5USB로 여러 S32 debug probe가 host에 연결되어 있으면 runner는 계속하기 전에 command-line prompt로 하나를 선택하게 합니다. --dev-id=<connection-string>으로 probe connection string을 지정할 수도 있습니다. Connection string 구성은 NXP S32 debug probe user manual을 참고하십시오. Serial ID가 00:04:9f:00:ca:fe인 예:
west debug --dev-id='s32dbg:00:04:9f:00:ca:fe'--tool-opt로 debug host tool에 추가 option을 전달할 수 있습니다. debug 또는 attach에서는 GDB client에만 전달되고 debugserver에서는 GDB server에 전달됩니다. Zephyr application을 SRAM에 load한 뒤 debug session을 detach하는 예:
west debug --tool-opt='--batch'
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.