The latest development version of this page may be more current than this released 4.0.0 version.

PTP

Browse source code on GitHub

Overview

The PTP sample application for Zephyr will enable PTP support.

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

Requirements

For generic host connectivity, that can be used for debugging purposes, see Networking with native_sim board 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 Networking with native_sim board 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:

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

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 CONFIG_PTP_LOG_LEVEL_DBG in the config file.

Get linuxptp project sources

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

Compile the ptp4l daemon and start it like this:

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

Compile Zephyr application.

west build -b native_sim samples/net/ptp

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

build/zephyr/zephyr.exe -attach_uart

See also

PTP support