0
  • 聊天消息
  • 系統(tǒng)消息
  • 評(píng)論與回復(fù)
登錄后你可以
  • 下載海量資料
  • 學(xué)習(xí)在線課程
  • 觀看技術(shù)視頻
  • 寫文章/發(fā)帖/加入社區(qū)
會(huì)員中心
創(chuàng)作中心

完善資料讓更多小伙伴認(rèn)識(shí)你,還能領(lǐng)取20積分哦,立即完善>

3天內(nèi)不再提示

如何在zcu106之間運(yùn)行1588?

YCqV_FPGA_EETre ? 來源:博客園 ? 作者:付漢杰 ? 2021-05-13 14:22 ? 次閱讀

MPSoC的MAC支持1588。在Linux Kernel的配置項(xiàng)中使能CONFIG_MACB_USE_HWSTAMP,并在Linux rootfs添加Linux ptp/ethtool,就可以運(yùn)行1588的軟件命令ptp4l。

PetaLinux下,配置Linux rootfs命令是petalinux-config -c rootfs。1588在Linux用戶態(tài)的應(yīng)用程序軟件包是Linuxptp,可執(zhí)行文件是ptp4l。

1在zcu106之間運(yùn)行1588

下面的命令,在zcu106之間運(yùn)行1588。運(yùn)行順序是先在第一塊單板(master)啟動(dòng)1588 master;再在第二塊單板(slave)上啟動(dòng)1588 slave;接下來在第一塊單板(master)終止1588 master,模擬1588 master故障;最后再在第一塊單板(master)啟動(dòng)1588 master。

1.1. master

1588 master的命令是ptp4l -i eth0 -m。運(yùn)行記錄如下:

root@zcu106_vcu_trd:~# # master

root@zcu106_vcu_trd:~# uname -a

Linux zcu106_vcu_trd 5.4.0-xilinx-v2020.2 #1 SMP Wed Feb 24 1051 UTC 2021 aarch64 GNU/Linux

root@zcu106_vcu_trd:~# ifconfig eth0

eth0 Link encap:Ethernet HWaddr 0035D2:38

inet addr:10.164.16.102 Bcast:10.164.16.255 Mask:255.255.255.0

inet6 addr: fe80:35ffd238/64 Scope:Link

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:381 errors:0 dropped:0 overruns:0 frame:0

TX packets:438 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:37123 (36.2 KiB) TX bytes:49863 (48.6 KiB)

Interrupt:31

root@zcu106_vcu_trd:~# ptp4l -i eth0 -m

ptp4l[577.050]: selected /dev/ptp0 as PTP clock

ptp4l[577.051]: port 1: INITIALIZING to LISTENING on INIT_COMPLETE

ptp4l[577.051]: port 0: INITIALIZING to LISTENING on INIT_COMPLETE

ptp4l[583.599]: port 1: LISTENING to MASTER on ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES

ptp4l[583.599]: selected local clock 000a35.fffe.04d238 as best master

ptp4l[583.600]: assuming the grand master role

^C

root@zcu106_vcu_trd:~# ptp4l -i eth0 -m

ptp4l[637.574]: selected /dev/ptp0 as PTP clock

ptp4l[637.575]: port 1: INITIALIZING to LISTENING on INIT_COMPLETE

ptp4l[637.575]: port 0: INITIALIZING to LISTENING on INIT_COMPLETE

ptp4l[644.708]: port 1: LISTENING to MASTER on ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES

ptp4l[644.708]: selected local clock 000a35.fffe.04d238 as best master

ptp4l[644.708]: assuming the grand master role

^Croot@zcu106_vcu_trd:~#

上面的1588 master,先啟動(dòng),再停止,再啟動(dòng)。

1.2. slave

1588 slave的命令是ptp4l -i eth0 -s -m。運(yùn)行記錄如下:

root@zcu106_vcu_trd:~# # slave

root@zcu106_vcu_trd:~# uname -a

Linux zcu106_vcu_trd 5.4.0-xilinx-v2020.2 #1 SMP Wed Feb 24 1051 UTC 2021 aarch64 GNU/Linux

root@zcu106_vcu_trd:~# ifconfig eth0

eth0 Link encap:Ethernet HWaddr 06E571:88

inet addr:10.164.16.8 Bcast:10.164.16.255 Mask:255.255.255.0

inet6 addr: fe80:e5ff7188/64 Scope:Link

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:880 errors:0 dropped:26 overruns:0 frame:0

TX packets:484 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:62884 (61.4 KiB) TX bytes:51650 (50.4 KiB)

Interrupt:31

root@zcu106_vcu_trd:~# ptp4l -i eth0 -s -m

ptp4l[577.398]: selected /dev/ptp0 as PTP clock

ptp4l[577.399]: port 1: INITIALIZING to LISTENING on INIT_COMPLETE

ptp4l[577.399]: port 0: INITIALIZING to LISTENING on INIT_COMPLETE

ptp4l[577.755]: port 1: new foreign master 000a35.fffe.04d238-1

ptp4l[581.755]: selected best master clock 000a35.fffe.04d238

ptp4l[581.755]: port 1: LISTENING to UNCALIBRATED on RS_SLAVE

ptp4l[583.754]: master offset -701 s0 freq +4079 path delay 2992

ptp4l[584.754]: master offset -957 s2 freq +3823 path delay 3037

ptp4l[584.754]: port 1: UNCALIBRATED to SLAVE on MASTER_CLOCK_SELECTED

ptp4l[585.754]: master offset -727 s2 freq +3096 path delay 3037

ptp4l[586.754]: master offset 430 s2 freq +4035 path delay 3035

ptp4l[587.754]: master offset 437 s2 freq +4171 path delay 3034

ptp4l[588.754]: master offset 351 s2 freq +4216 path delay 3035

ptp4l[589.754]: master offset 222 s2 freq +4192 path delay 3035

ptp4l[590.754]: master offset -108 s2 freq +3929 path delay 3047

ptp4l[605.754]: master offset 229 s2 freq +4239 path delay 3019

ptp4l[606.754]: master offset 18 s2 freq +4096 path delay 3035

ptp4l[607.754]: master offset -156 s2 freq +3928 path delay 3035

ptp4l[615.730]: port 1: SLAVE to LISTENING on ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES

ptp4l[615.731]: selected local clock 0651e5.fffe.c27188 as best master

ptp4l[621.758]: selected local clock 0651e5.fffe.c27188 as best master

ptp4l[629.169]: selected local clock 0651e5.fffe.c27188 as best master

ptp4l[635.881]: selected local clock 0651e5.fffe.c27188 as best master

ptp4l[638.863]: selected best master clock 000a35.fffe.04d238

ptp4l[638.863]: port 1: LISTENING to UNCALIBRATED on RS_SLAVE

ptp4l[640.862]: master offset 4627 s2 freq +8664 path delay 2932

ptp4l[640.862]: port 1: UNCALIBRATED to SLAVE on MASTER_CLOCK_SELECTED

ptp4l[641.862]: master offset -22 s2 freq +5403 path delay 2978

ptp4l[642.862]: master offset -2147 s2 freq +3271 path delay 3580

ptp4l[643.862]: master offset -868 s2 freq +3906 path delay 3279

ptp4l[644.862]: master offset -644 s2 freq +3870 path delay 3019

ptp4l[645.862]: master offset -402 s2 freq +3919 path delay 2978

ptp4l[646.863]: master offset -103 s2 freq +4097 path delay 2978

ptp4l[647.863]: master offset -157 s2 freq +4012 path delay 3001

ptp4l[648.863]: master offset -350 s2 freq +3772 path delay 3042

ptp4l[649.863]: master offset 126 s2 freq +4143 path delay 3021

ptp4l[650.863]: master offset 40 s2 freq +4095 path delay 3021

在1588 slave的打印中可以看到,slave先選擇外部時(shí)鐘master 000a35.fffe.04d238。當(dāng)外部master退出后,再選擇了本地時(shí)鐘,0651e5.fffe.c27188。當(dāng)外部master正常后,又選擇了外部時(shí)鐘master 000a35.fffe.04d238。

時(shí)鐘的標(biāo)識(shí),是網(wǎng)卡的MAC地址。

master offset表示主從端時(shí)間差,單位是ns。s0,s1,s2 : 表示1588的不同狀態(tài),s0表示未鎖定,s1表示正在同步,s2表示鎖定。

2PC機(jī)上運(yùn)行1588

也可以在PC機(jī)上運(yùn)行1588。首先在master和slave的PC機(jī)安裝1588的Linux用戶態(tài)應(yīng)用程序,Linuxptp。

hankf@XSZGS4:~$ sudo apt install linuxptp

Reading package lists.。. Done

Building dependency tree

Reading state information.。. Done

The following packages were automatically installed and are no longer required:

libfwup1 libllvm9 linux-hwe-5.4-headers-5.4.0-51 linux-hwe-5.4-headers-5.4.0-52 linux-hwe-5.4-headers-5.4.0-53 linux-hwe-5.4-headers-5.4.0-56 linux-hwe-5.4-headers-5.4.0-58

linux-hwe-5.4-headers-5.4.0-59 linux-hwe-5.4-headers-5.4.0-60 linux-hwe-5.4-headers-5.4.0-62 linux-hwe-5.4-headers-5.4.0-65 linux-hwe-5.4-headers-5.4.0-66 linux-hwe-5.4-headers-5.4.0-67

Use ‘sudo apt autoremove’ to remove them.

The following NEW packages will be installed:

linuxptp

0 upgraded, 1 newly installed, 0 to remove and 18 not upgraded.

Need to get 112 kB of archives.

After this operation, 418 kB of additional disk space will be used.

Get:1 http://hk.archive.ubuntu.com/ubuntu bionic/universe amd64 linuxptp amd64 1.8-1 [112 kB]

Fetched 112 kB in 3s (33.0 kB/s)

Selecting previously unselected package linuxptp.

(Reading database 。.. 477696 files and directories currently installed.)

Preparing to unpack 。../linuxptp_1.8-1_amd64.deb 。..

Unpacking linuxptp (1.8-1) 。..

Setting up linuxptp (1.8-1) 。..

Processing triggers for man-db (2.8.3-2ubuntu0.1) 。..

2.1. master

然后運(yùn)行1588 master。

hankf@XSZGS4:~$ sudo ptp4l -i ens12f2 -m

[sudo] password for hankf:

ptp4l[4247020.499]: selected /dev/ptp4 as PTP clock

ptp4l[4247020.500]: driver changed our HWTSTAMP options

ptp4l[4247020.500]: tx_type 1 not 1

ptp4l[4247020.500]: rx_filter 1 not 12

ptp4l[4247020.500]: port 1: INITIALIZING to LISTENING on INITIALIZE

ptp4l[4247020.500]: port 0: INITIALIZING to LISTENING on INITIALIZE

ptp4l[4247020.501]: port 1: link up

ptp4l[4247028.079]: port 1: LISTENING to MASTER on ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES

ptp4l[4247028.079]: selected best master clock 6c92bf.fffe.ccc500

ptp4l[4247028.079]: assuming the grand master role

^C

hankf@XSZGS4:~$

2.2. Slave

運(yùn)行1588 Slave。

xilinx@xszgs2:~$ ifconfig eno3

eno3: flags=4163mtu 1500

inet 10.164.177.202 netmask 255.255.255.0 broadcast 10.164.177.255

inet6 fe80:dc30b101 prefixlen 64 scopeid 0x20

ether d0660d:e9 txqueuelen 1000 (Ethernet)

RX packets 39897217 bytes 48144750947 (48.1 GB)

RX errors 107 dropped 6 overruns 107 frame 0

TX packets 14982002 bytes 4367094180 (4.3 GB)

TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

device interrupt 42 memory 0x9e800000-9effffff

xilinx@xszgs2:~$ ptp4l -i eno3 -s -m

ptp4l[3650610.080]: selected /dev/ptp2 as PTP clock

ptp4l[3650610.081]: Failed to open /dev/ptp2: Permission denied

failed to create a clock

xilinx@xszgs2:~$ sudo ptp4l -i eno3 -s -m

ptp4l[3650613.052]: selected /dev/ptp2 as PTP clock

ptp4l[3650613.071]: port 1: INITIALIZING to LISTENING on INITIALIZE

ptp4l[3650613.071]: port 0: INITIALIZING to LISTENING on INITIALIZE

ptp4l[3650613.072]: port 1: link up

ptp4l[3650614.597]: port 1: new foreign master 6c92bf.fffe.ccc500-1

ptp4l[3650618.597]: selected best master clock 6c92bf.fffe.ccc500

ptp4l[3650618.597]: port 1: LISTENING to UNCALIBRATED on RS_SLAVE

ptp4l[3650620.597]: master offset -496821638515 s0 freq +0 path delay 25928

ptp4l[3650621.597]: master offset -496821663985 s1 freq -25469 path delay 22934

ptp4l[3650622.597]: master offset -3011 s2 freq -28480 path delay 22934

ptp4l[3650622.599]: port 1: UNCALIBRATED to SLAVE on MASTER_CLOCK_SELECTED

ptp4l[3650623.596]: master offset 6729 s2 freq -19643 path delay 13071

ptp4l[3650624.596]: master offset -2000 s2 freq -26353 path delay 13071

ptp4l[3650625.596]: master offset -4376 s2 freq -29329 path delay 13297

ptp4l[3650626.596]: master offset -3468 s2 freq -29734 path delay 13071

ptp4l[3650627.596]: master offset -2191 s2 freq -29498 path delay 13071

ptp4l[3650628.596]: master offset -994 s2 freq -28958 path delay 12936

ptp4l[3650629.596]: master offset -435 s2 freq -28697 path delay 12874

ptp4l[3650630.596]: master offset -380 s2 freq -28773 path delay 12874

ptp4l[3650631.596]: master offset -176 s2 freq -28683 path delay 12874

ptp4l[3650632.596]: master offset 161 s2 freq -28398 path delay 12874

在1588 slave的打印中可以看到,PC機(jī)上slave報(bào)告的master offset和path delay,都遠(yuǎn)遠(yuǎn)大于在zcu106之間運(yùn)行1588的數(shù)據(jù)。

原文標(biāo)題:【工程師分享】測(cè)試MPSoC GEM 的1588功能

文章出處:【微信公眾號(hào):FPGA開發(fā)圈】歡迎添加關(guān)注!文章轉(zhuǎn)載請(qǐng)注明出處。

責(zé)任編輯:haq

聲明:本文內(nèi)容及配圖由入駐作者撰寫或者入駐合作網(wǎng)站授權(quán)轉(zhuǎn)載。文章觀點(diǎn)僅代表作者本人,不代表電子發(fā)燒友網(wǎng)立場(chǎng)。文章及其配圖僅供工程師學(xué)習(xí)之用,如有內(nèi)容侵權(quán)或者其他違規(guī)問題,請(qǐng)聯(lián)系本站處理。 舉報(bào)投訴
  • Linux
    +關(guān)注

    關(guān)注

    87

    文章

    11304

    瀏覽量

    209521
  • Mac
    Mac
    +關(guān)注

    關(guān)注

    0

    文章

    1106

    瀏覽量

    51479
  • MPSoC
    +關(guān)注

    關(guān)注

    0

    文章

    198

    瀏覽量

    24283

原文標(biāo)題:【工程師分享】測(cè)試MPSoC GEM 的1588功能

文章出處:【微信號(hào):FPGA-EETrend,微信公眾號(hào):FPGA開發(fā)圈】歡迎添加關(guān)注!文章轉(zhuǎn)載請(qǐng)注明出處。

收藏 人收藏

    評(píng)論

    相關(guān)推薦

    請(qǐng)問ADC12DJ3200EVM可以搭配Xilinx ZCU111開發(fā)板使用嗎?

    ADC12DJ3200EVM可以搭配Xilinx ZCU111開發(fā)板使用嗎?
    發(fā)表于 11-27 07:20

    LMK05318是否可以對(duì)Switch輸出的1588 clock進(jìn)行同步鎖頻、鎖相?

    我們現(xiàn)在想做一個(gè)相對(duì)簡化的1588同步方案,打算使用TI的LMK05318這個(gè)方案,有以下幾個(gè)問題需要咨詢 下圖是我們方案的框圖,我們的目的是使這樣的N個(gè)設(shè)備通過1588同步起來 我個(gè)人的理解
    發(fā)表于 11-08 10:50

    在KeyStone器件實(shí)現(xiàn)IEEE1588時(shí)鐘方案

    電子發(fā)燒友網(wǎng)站提供《在KeyStone器件實(shí)現(xiàn)IEEE1588時(shí)鐘方案.pdf》資料免費(fèi)下載
    發(fā)表于 09-26 09:10 ?0次下載
    在KeyStone器件實(shí)現(xiàn)IEEE<b class='flag-5'>1588</b>時(shí)鐘方案

    Multi-Scaler IP的Linux示例以及Debug(上)

    本篇文章介紹了在 ZCU106 上創(chuàng)建 Video Multi-Scaler IP 的 AMD Vivado? Design Tool 和 Petalinux 工程;在 ZCU106 上 Run 生成的 Image,并測(cè)試生成的圖像文件,以及常見問題的 Debug。
    的頭像 發(fā)表于 09-18 10:03 ?393次閱讀
    Multi-Scaler IP的Linux示例以及Debug(上)

    何在兩種類型的SOT663封裝之間進(jìn)行協(xié)同布局

    電子發(fā)燒友網(wǎng)站提供《如何在兩種類型的SOT663封裝之間進(jìn)行協(xié)同布局.pdf》資料免費(fèi)下載
    發(fā)表于 09-11 11:35 ?0次下載
    如<b class='flag-5'>何在</b>兩種類型的SOT663封裝<b class='flag-5'>之間</b>進(jìn)行協(xié)同布局

    ZCU106評(píng)估板用戶指南

    電子發(fā)燒友網(wǎng)站提供《ZCU106評(píng)估板用戶指南.pdf》資料免費(fèi)下載
    發(fā)表于 09-10 10:17 ?1次下載

    何在SOT-563封裝和SOT-236封裝之間實(shí)現(xiàn)共同布局

    電子發(fā)燒友網(wǎng)站提供《如何在SOT-563封裝和SOT-236封裝之間實(shí)現(xiàn)共同布局.pdf》資料免費(fèi)下載
    發(fā)表于 09-04 10:32 ?0次下載
    如<b class='flag-5'>何在</b>SOT-563封裝和SOT-236封裝<b class='flag-5'>之間</b>實(shí)現(xiàn)共同布局

    STM32F107的1588協(xié)議如何使用外部時(shí)鐘做為基準(zhǔn)?

    想使用外部的GPS秒脈沖給MASTER做為基準(zhǔn)時(shí)鐘,然后通過1588協(xié)議讓其他SLAVE同步.我下載了官網(wǎng)例程,但不知道怎么把GPS的秒脈沖和1588的時(shí)鐘關(guān)聯(lián)起來.使用ETH_PTPTime_SetTime在秒脈沖中斷中每秒設(shè)置一次時(shí)間?感覺不太對(duì).
    發(fā)表于 04-25 07:04

    STM32H743間隔幾秒讀寫TF卡,長時(shí)間運(yùn)行后不定時(shí)卡死的原因?怎么處理?

    STM32H743,采用輪詢讀寫SD卡的方式,用的是freertos操作系統(tǒng),長時(shí)間運(yùn)行,間隔幾秒讀寫一次TF卡會(huì)卡死在HAL_StatusTypeDef HAL_SD_WriteBlocks
    發(fā)表于 04-03 07:39

    何在運(yùn)行時(shí)更改輸入和輸出之間的GPIO配置?

    正在探索如何在運(yùn)行時(shí)更改輸入和輸出之間的 GPIO 配置。 我無法計(jì)算TESTBOARD_150PC_OUT緩沖區(qū)的效果:CY_GPIO_DM_PULLUP_IN_OFF
    發(fā)表于 03-05 06:20

    vivado2017中找不到ZCU102對(duì)應(yīng)的板卡,求解決和分享,應(yīng)該如何解決

    vivado2017中找不到ZCU102對(duì)應(yīng)的板卡,求解決和分享,應(yīng)該如何解決
    發(fā)表于 02-29 17:31

    何在PSoC62 Evaluation kit開發(fā)板上運(yùn)行RT-Thread呢?

    本文主要介紹如何在PSoC62 Evaluation kit開發(fā)板上運(yùn)行RT-Thread,如何連接CYW43012 WiFi藍(lán)牙模組,以及如何進(jìn)行WiFi聯(lián)網(wǎng)、網(wǎng)絡(luò)延遲、網(wǎng)絡(luò)帶寬測(cè)試。
    的頭像 發(fā)表于 02-27 10:49 ?1025次閱讀
    如<b class='flag-5'>何在</b>PSoC62 Evaluation kit開發(fā)板上<b class='flag-5'>運(yùn)行</b>RT-Thread呢?

    STM32 IEEE1588時(shí)間同步

    有誰在STM32上實(shí)現(xiàn)過IEEE1588精確時(shí)間同步的嗎?
    發(fā)表于 02-23 16:22

    在長時(shí)間運(yùn)行期間控制器如何適應(yīng)PMSM的電機(jī)參數(shù)變化?

    你好,我正在為PMSM設(shè)計(jì)控制器,我有一個(gè)問題,在長時(shí)間運(yùn)行期間,控制器如何適應(yīng)PMSM的電機(jī)參數(shù)變化?
    發(fā)表于 01-22 06:35

    zcu102和zcu104有什么區(qū)別

    ZCU102與ZCU104是賽靈思(Xilinx)推出的兩款高性能嵌入式開發(fā)平臺(tái),用于開發(fā)和驗(yàn)證高性能應(yīng)用程序。雖然它們都具備卓越的性能和功能,但在一些方面存在一些差異。下面將詳細(xì)介紹ZCU
    的頭像 發(fā)表于 01-04 10:54 ?3561次閱讀