samples/net/ptp/README.html · samples/net/ptp/README.rst 공식 원문 ↗

Zephyr 3.7.0 · Samples · Networking · Time synchronization

PTP

native_sim 또는 지원 STM32 Nucleo board에서 PTP message와 event를 logging으로 관찰합니다.

Official pathsamples/net/ptp/README.html
Source filesamples/net/ptp/README.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

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

Part 1

요약·해설

Ethernet timestamp 요구조건, debug log 설정과 linuxptp·ptp4l·native_sim 실행 절차를 보존합니다.

Protocol

PTP

Daemon

linuxptp · ptp4l

Requirement

Ethernet timestamping

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 6E93B24EA2A3A39E2E287BC49B86DA2E552353142CA8E286B165B716FBA79484
.. zephyr:code-sample:: ptp
   :name: PTP
   :relevant-api: ptp ptp_time ptp_clock

   Enable PTP support and monitor messages and events via logging.

Overview
********

The PTP sample application for Zephyr will enable PTP support.

The source code for this sample application can be found at:
:zephyr_file:`samples/net/ptp`.

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

For generic host connectivity, that can be used for debugging purposes, see
:ref:`networking_with_native_sim` for details.

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

A good way to run this sample is to run this PTP application inside
native_sim board as described in :ref:`networking_with_native_sim` or with
embedded device like Nucleo-H743-ZI, Nucleo-H745ZI-Q, Nucleo-F767ZI or
Nucleo-H563ZI. Note that PTP is only supported for
boards that have an Ethernet port and which has support for collecting
timestamps for sent and received Ethernet frames.

Follow these steps to build the PTP sample application:

.. zephyr-app-commands::
   :zephyr-app: samples/net/ptp
   :board: <board to use>
   :goals: build
   :compact:

Setting up Linux Host
=====================

By default PTP in Zephyr will not print any PTP debug messages to console.
One can enable debug prints by setting
:kconfig:option:`CONFIG_PTP_LOG_LEVEL_DBG` in the config file.

Get linuxptp project sources

.. code-block:: console

    git clone git://git.code.sf.net/p/linuxptp/code

Compile the ``ptp4l`` daemon and start it like this:

.. code-block:: console

    sudo ./ptp4l -4 -f -i zeth -m -q -l 6 -S

Compile Zephyr application.

.. zephyr-app-commands::
   :zephyr-app: samples/net/ptp
   :board: native_sim
   :goals: build
   :compact:

When the Zephyr image is build, you can start it like this:

.. code-block:: console

    build/zephyr/zephyr.exe -attach_uart

Part 3

한국어 전문 번역

개요

Zephyr용 PTP sample application은 Precision Time Protocol 지원을 활성화합니다.

이 sample application의 source code는 samples/net/ptp에 있습니다.

요구 사항

Debug 목적으로 사용할 수 있는 일반 host 연결 방법은 native_sim board networking 문서를 참조하십시오.

빌드 및 실행

이 sample을 실행하는 좋은 방법은 native_sim board networking 문서에 설명된 native_sim board 안에서 PTP application을 실행하는 것입니다. Embedded device로는 Nucleo-H743-ZI, Nucleo-H745ZI-Q, Nucleo-F767ZI 또는 Nucleo-H563ZI를 사용할 수 있습니다.

PTP는 Ethernet port가 있고 송수신 Ethernet frame의 timestamp를 수집할 수 있는 board에서만 지원된다는 점에 주의하십시오.

PTP sample application은 다음 단계로 build합니다.

west build -b <board to use> samples/net/ptp

Linux Host 설정

기본적으로 Zephyr의 PTP는 console에 PTP debug message를 출력하지 않습니다. Config file에서 CONFIG_PTP_LOG_LEVEL_DBG를 설정하면 debug print를 활성화할 수 있습니다.

먼저 linuxptp project source를 가져옵니다.

git clone git://git.code.sf.net/p/linuxptp/code

ptp4l daemon을 compile한 뒤 다음처럼 시작합니다. 이 명령은 IPv4 mode로 zeth interface를 사용하고 message를 출력하며 software timestamping을 선택합니다.

sudo ./ptp4l -4 -f -i zeth -m -q -l 6 -S

그 다음 Zephyr application을 native_sim board용으로 compile합니다.

west build -b native_sim samples/net/ptp

Zephyr image build가 끝나면 UART attachment option과 함께 다음처럼 시작할 수 있습니다.

build/zephyr/zephyr.exe -attach_uart

Source

출처

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