samples/subsys/dap/README.html · samples/subsys/dap/README.rst 공식 원문 ↗

Zephyr 3.7.0 · Samples · Debug · CMSIS-DAP

DAP sample application

Zephyr board를 HIC debug adapter로 만들어 별도 Cortex-M target을 SWD로 제어합니다.

Official pathsamples/subsys/dap/README.html
Source filesamples/subsys/dap/README.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

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

Part 1

요약·해설

SWDIO·SWDCLK·nRESET·noe wiring, VID/PID 변경과 pyOCD session을 보존합니다.

Protocol

CMSIS-DAP · SWDP

Transport

USB Bulk

Client

pyOCD

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 BE22FEA38CA0FA32EA2D22C3628B095473EC2B6A8FEDCA9762B7D58DD94F6FB4
.. _dap-sample:

DAP Sample Application
######################

Overview
********

This sample app demonstrates use of a SWDP interface driver and CMSIS DAP
controller through USB Bulk interface.

Requirements
************

This sample supports multiple hardware configurations:

The simplest configuration would be to connect `SWDIO` to `dio`, `SWDCLK` to `clk`
and optionally `nRESET` to `reset`.  The optional `noe` pin is used to enable the port,
e.g. if the SWD connections are multiplexed.

Building and Running
********************

In order for our debug adapter to be recognized by pyOCD we need to change
Zephyr's VID/PID to IDs known to pyOCD, this is up to the user.
The following commands build and flash DAP sample.

.. zephyr-app-commands::
   :zephyr-app: samples/subsys/dap
   :board: nrf52840dk_nrf52840
   :goals: flash
   :compact:

Connect HIC to the target and try some pyOCD commands, for example:

.. code-block:: console

   pyocd commander -t nrf52840

   0029527 W Board ID FE5D is not recognized [mbed_board]
   Connected to NRF52840 [Sleeping]: FE5D244DFE1F33DB
   pyocd> read32 0x20004f18 32
   20004f18:  20001160 2000244c 00000000 0000e407    | ..` .$L........|
   20004f28:  ffffffff ffffffff 00000000 aaaaaaaa    |................|
   pyocd> halt
   Successfully halted device
   pyocd> reg
   general registers:
         lr: 0x00009cdd                   r7: 0x00000000 (0)
         pc: 0x000033ca                   r8: 0x00000000 (0)
         r0: 0x00000000 (0)               r9: 0x00000000 (0)
         r1: 0x20002854 (536881236)      r10: 0x00000000 (0)
         r2: 0x20000be4 (536873956)      r11: 0x00000000 (0)
         r3: 0x00000000 (0)              r12: 0x00000000 (0)
         r4: 0x200017e8 (536877032)       sp: 0x20002898
         r5: 0x20001867 (536877159)     xpsr: 0x61000000 (1627389952)
         r6: 0x00000000 (0)

Part 3

한국어 전문 번역

개요

USB Bulk interface를 통해 SWDP interface driver와 CMSIS-DAP controller를 사용하는 debug adapter sample입니다. Zephyr board를 host interface controller(HIC)로 만들고, HIC가 별도 target의 SWD port를 제어하도록 합니다.

요구 사항

여러 hardware configuration을 지원합니다. 가장 단순한 연결은 HIC의 dio에 target SWDIO, clk에 SWDCLK를 연결하고 필요하면 reset에 nRESET을 연결하는 것입니다.

Optional noe pin은 port enable에 사용합니다. 예를 들어 SWD connection이 다른 function과 multiplex되어 있을 때 이 pin으로 SWD path를 활성화할 수 있습니다.

빌드 및 실행

PyOCD가 debug adapter를 인식하려면 Zephyr의 USB VID/PID를 pyOCD가 알고 있는 ID로 사용자가 변경해야 합니다. 다음 command는 nRF52840 DK용 DAP sample을 build하고 flash합니다.

west build -b nrf52840dk_nrf52840 samples/subsys/dap
west flash

HIC를 target에 연결한 뒤 pyOCD commander를 실행합니다. 아래 예는 nRF52840 target에 접속해 address 0x20004f18에서 32-bit word 32개를 읽고, core를 halt한 뒤 general register를 출력합니다.

pyocd commander -t nrf52840

0029527 W Board ID FE5D is not recognized [mbed_board]
Connected to NRF52840 [Sleeping]: FE5D244DFE1F33DB
pyocd> read32 0x20004f18 32
20004f18:  20001160 2000244c 00000000 0000e407    | ..` .$L........|
20004f28:  ffffffff ffffffff 00000000 aaaaaaaa    |................|
pyocd> halt
Successfully halted device
pyocd> reg
general registers:
      lr: 0x00009cdd                   r7: 0x00000000 (0)
      pc: 0x000033ca                   r8: 0x00000000 (0)
      r0: 0x00000000 (0)               r9: 0x00000000 (0)
      r1: 0x20002854 (536881236)      r10: 0x00000000 (0)
      r2: 0x20000be4 (536873956)      r11: 0x00000000 (0)
      r3: 0x00000000 (0)              r12: 0x00000000 (0)
      r4: 0x200017e8 (536877032)       sp: 0x20002898
      r5: 0x20001867 (536877159)     xpsr: 0x61000000 (1627389952)
      r6: 0x00000000 (0)

Board ID warning이 있어도 이어지는 Connected to NRF52840가 connection 성립을 보여 줍니다. read32, halt, reg 결과의 실제 address·register value는 target firmware와 실행 상태에 따라 달라집니다.

Source

출처

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