Versal AI Edge Series VEK280 - PS GEM gPTP Enablement

Versal AI Edge Series VEK280 - PS GEM gPTP Enablement

This document provides step-by-step guide to enable and test IEEE 802.1AS (gPTP) and IEEE 1588 v2 (PTP) Ethernet protocols on PS GEM of VEK280 Rev B3 board using a 2023.2 PetaLinux BSP.

Table of Contents

Introduction

The Generalized Precision Time Protocol (gPTP) is an IEEE 802.1AS standard that specifies the protocol and procedures used to ensure that the synchronization requirements are met for time-sensitive applications. Precision Time Protocol (PTP) is a timing-over-packet protocol defined in the IEEE 1588v2 standard. In this document gPTP and PTP will be enabled and tested on PS GEM0 of a Versal AI Edge series board, the VEK280 Rev B3.

Prerequisites 

Hardware

  • VEK280 Rev B3 board and Power adapter

  • Linux Host Machine with Intel i210 NIC card

  • USB Type-C cable for UART connection

  • SD card (16GB or more)

  • RJ45 Ethernet cable

  • Terminal emulator Tera Term (Refer to UG1036 regarding Tera Term installation)

Software

  • Download the gPTP.conf file from https://github.com/richardcochran/linuxptp/blob/master/configs/gPTP.cfg. This is required for gPTP testing.

  • Download PTP daemon from linuxptp and compile it to generate ptp4l binary v.3.1.1 OR install the linuxptp package version 3.1.1 using commands supported by the host machine operating system. For example, on an Ubuntu host machine, use the command “sudo apt-get install linuxptp”

Setup Tested

  • VEK280 Rev B3 board ↔︎ Linux host machine with Intel i210 card that supports IEEE1588 PTP

Building PetaLinux Image

Create VEK280 2023.2 PetaLinux Project

  1. Open the Linux terminal and source the settings of the PetaLinux toolchain. Assuming 2023.2 PetaLinux tool chain is installed in the /opt directory, run the below command

    source /opt/petalinux/settings.sh
  2. Browse to the PetaLinux Downloads page and download the 2023.2 VEK280 PetaLinux BSP.

    image-20240207-154125.png

    URL to download the VEK280 BSP → https://www.xilinx.com/member/forms/download/xef.html?filename=xilinx-vek280-v2023.2-10140544.bsp

  3. Copy the downloaded BSP to the current Linux terminal.

  4. Run below command to create VEK280 PetaLinux project

    petalinux-create -t project -s xilinx-vek280-v2023.2-10140544.bsp

In PetaLinux BSP configuration, set the INITRD image as petalinux-image-minimal

  1. Run the below command to open the PetaLinux configuration wizard

    cd xilinx-vek280-2023.2/ petalinux-config
  2. Browse to the path “→ Image Packaging Configuration → INITRAMFS/INITRD Image name →” and change the name from petalinux-initramfs-image to petalinux-image-minimal as shown in the below screenshot

    image-20240207-155001.png
  3. Save and exit from the PetaLinux configuration wizard.

Enable linuxptp package in root file system

  1. Run the below command to open the PetaLinux root filesystem wizard

    petalinux-config -c rootfs
  2. Browse to the path “→ Filesystem Packages → base → linuxptp” and enable linuxptp to be built as a kernel module as shown in the below screen capture

    image-20240207-160307.png
  3. Save and exit from the configuration wizard

Build PetaLinux BSP, create boot images and copy them to SD card

  1. Build VEK280 PetaLinux BSP

petalinux-build
  1. Create BOOT.BIN image

cd images/linux/ petalinux-package --boot --plm --psmfw --u-boot --dtb
  1. Copy the bootable images BOOT.BIN, image.ub, and boot.scr files to SD card.

Booting VEK280 board with PetaLinux Image

image-20240208-064115.png
VEK280 Rev B3 Board
  1. Place the SD card with bootable images in the SD card slot of the VEK280 Rev B3 board.

  2. Set the VEK280 board in SD boot mode. The SW1 switch has four switches. Set them in 0xE(1110) form.

  3. Connect the PS GEM Ethernet port of the VEK280 board with the ‘Intel NIC i210 card’ Ethernet port of Linux Host machine via RJ45 Ethernet cable.

  4. Connect a USB Type-C cable to the VEK280 board UART port and its other end (Type-A) to your laptop for serial console logs. Open the Tera Term terminal emulator and set the UART settings as below

  • Baud Rate: 115200

  • Data: 8 bit

  • Parity: None

  • Stop: 1 bit

  • Flow Control: None

  1. Connect the 12V power supply to the VEK280 board. Turn ON power switch. The system boots and the log messages can be seen on the Tera Term console connected to VEK280 boards UART port.

  2. Enter “petalinux” as the login userid and a password of your choice. Retype the same password for future use.

image-20240208-063928.png

Testing Ethernet Protocols (gPTP and PTP) on VEK280 PS GEM

Ethernet Setup

  1. Boot the Linux host machine with an Intel i210 card. Identify which Ethernet interface of the i210 card is connected to the VEK280 board by disconnecting and re-connecting the Ethernet connection. The Ethernet interface which changes its state from “UP BROADCAST MULTICAST” to “UP BROADCAST RUNNING” is the interface connected to the VEK280 board. For example, let’s say the identified interface name is ens4f3 and its IP address is 192.168.4.13.

  2. On the VEK280 target, check for the PS GEM Ethernet interface. Let’s say eth0 is the Ethernet interface. Set its IP address to 192.168.4.100 to be in the LAN with the Linux host machine Ethernet interface IP address that was identified in step1.  

On the VEK280 board, switch to super user mode before bringing up the Ethernet interface, or else the command fails with the message “Operation not permitted”.

image-20240208-070157.png
Set the Ethernet IP address of the VEK280 board
  1. Run a PING test between the VEK280 board and Linux Host machine to confirm that they are in LAN connection. A successful Ping test is shown in the below screen capture

    image-20240208-070446.png
    Ping test result

IEEE 1588 V2 (PTP) Ethernet Protocol Testing

Before testing PTP, make sure the same version of ptp4l is running on the VEK280 and Host machine.

Use the “ptpv4l -v” command to check the version number of the ptp4l package on the VEK280 and Host machine as shown in the below screenshots.

image-20240208-072540.png
ptp4l version on VEK280 board is 3.1.1
image-20240208-072554.png
ptp4l version on Host machine is 3.1.1

Usecase1 - VEK280 as PTP grand master and host machine as PTP slave

Run the below command on the VEK280. Expected logs are shown in the below screen capture.

ptp4l -i eth0 -m
image-20240208-080403.png

Run the below command on the host machine. Expected logs are shown in the below screen capture.

sudo ./ptp4l -i ens4f3 -s -m
image-20240208-080454.png
From the above log observe that the port state has changed from UNCALIBRATED to SLAVE and the lock state has changed from s0 (unlocked) to s2 (locked) indicating that the Slave (Host) clock has synchronized with the PTP Master (VEK280) clock. Master offset (offset between the PTP master and slave clock) has stabilized to less than 10 nano seconds.

Usecase2 - VEK280 as PTP slave & host machine as PTP grand master

Run below command on host machine. Expected logs are shown in the below screen capture.

sudo ./ptp4l -i ens4f3 -m
image-20240208-081007.png

Run the below command on the VEK280. Expected logs are shown in the below screen capture.

ptp4l -i eth0 -s -m
image-20240208-081231.png
From the above log observe that the port state has changed from UNCALIBRATED to SLAVE and the Lock state has changed from s0 (unlocked) to s2 (locked) indicating that the Slave (VEK280) clock synchronized with the PTP Master (Host) clock. Master offset (offset between PTP master and slave clock) has stabilized to less than 10 nano seconds.

IEEE 802.1AS (gPTP) Ethernet Protocol Testing

Before testing PTP, make sure that the same version of ptp4l is running on the VEK280 and Host machine.

Usecase1 - VEK280 as gPTP grand master & host machine as slave

Copy gPTP.cfg (See Pre-requisite->Software section) to the current location on the VEK280 board.

Run the below command on the VEK280. Expected logs are shown in the below screen capture.

ptp4l -i eth0 -m -f gPTP.cfg
image-20240208-081347.png

Run the below command on the host machine. Expected logs are shown in the below screen capture.

sudo ./ptp4l -i ens4f3 -s -m -f gPTP.cfg
image-20240208-081419.png
From above log observe that the port state has changed from UNCALIBRATED to SLAVE, and that the rms (root mean square of the offset between the PTP master and slave clock) has stabilized to less than 10 nano seconds, indicating that the Slave (Host) clock has synchronized with the PTP Master (VEK280) clock.

Usecase2 - VEK280 as gPTP slave and host machine as grand master

Run below command on host machine. Expected logs are shown in the below screen capture.

sudo ./ptp4l -i ens4f3 -m -f gPTP.cfg
image-20240208-081500.png

Run the below command on the VEK280. Expected logs are shown in the below screen capture.

ptp4l -i eth0 -s -m -f gPTP.cfg
image-20240208-081530.png
From the above log observe that the port state changed from UNCALIBRATED to SLAVE, and that the rms (root mean square of the offset between PTP master and slave clock) has stabilized to less than 10 nano seconds, indicating that the Slave (VEK280) clock synchronized with the PTP Master (Host) clock.

Summary

We enabled and tested IEEE 802.1AS gPTP and IEEE 1588 PTPv2 Ethernet protocols on a Versal Edge series VEK280 Rev B3 board with a Link partner which supports PTP.

Abbreviations

gPTP - Generalized Precision Time Protocol

PTPv2 - Precision Time Protocol

IEEE 802.1AS - IEEE Standard for Local and Metropolitan Area Networks, Timing and Synchronization for Time-Sensitive Applications

IEEE 1588 - IEEE Standard for a Precision Clock Synchronization Protocol for Networked Measurement and Control Systems

Related Links

© Copyright 2019 - 2022 Xilinx Inc. Privacy Policy