This ethernet TSN example illustrates the usage of gPTP IEEE 802.1AS stack with CPSW peripheral, in gPTP End-Point time_receiver mode (i.e. slave mode). However, the application used here supports all the below modes:
In this example, connected Host PC is configured to force gPTP grand master role, so that the DUT becomes time_receiver (i.e. gPTP slave) mode. Yang based configuration is also supported. Currently File System is not supported, will be added in future releases.
In this example, We use two Rx and two Tx DMA channel, one Rx and one Tx channel specific to gPTP traffic. Along with PTP traffic, application also handles non-PTP traffic in a separate RTOS task and DMA Channel. Received non-PTP packets are sent back by the application, by interchanging source and destination MAC address.
See also :Ethernet TSN and gPTP Stack - API and Integration Guide
| Parameter | Value |
|---|---|
| CPU + OS | r5fss0-0_freertos |
| Toolchain | ti-arm-clang |
| Boards | am261x-lp, am261x-som |
| Example folder | source/networking/enet/core/examples/tsn/gptp_cpsw_app |
For support on am261x-lp, please refer Ethernet Add-on Boards
To change packet pool configuration from syscfg, please refer to Ethernet Packet Pool Allocation Guidelines
linuxptp priority1 in ~/gptp_config.cfg file to 100, to enforce it to gPTP masterneighborPropDelayThresh in ptp_config.cfg as below-priority1 in ~/gptp_config.cfg file can be changed to make the Linux PC master or slave. Lower the number higher the priority to become master.PPS output is a square wave signal generated by the device. It is used for comparison between the TT (master) and TR( slave) nodes when they are time synchronized. On the device, PPS is generated on the SYNC_OUT signal pin from CPTS (Common Platform Time Synchronization) of CPSW.
Out of box configuration for PPS signal output of this example is as follow:
| EVM | Mapped Signal Name | SOC Pin Name | PPS frequency | Output |
|---|---|---|---|---|
| am64x-EVM | PRG0_PRU0_GPO17 | U1 | 3.814 KHz | Pin B8 on J2 (i.e PIN8 on J2B) connector |
| am243x-EVM | PRG0_PRU0_GPO17 | U1 | 3.814 KHz | Pin B8 on J2 (i.e PIN8 on J2B) connector |
| am243x-LP | MMC1_DAT2 | K20 | 3.814 KHz | Pin3 on J6 connector |
| am263x-CC | SFDM0_CLK1 | A16 | 3.814 KHz | Pin1 on J9 connector |
| am263x-LP | SFDM0_CLK1 | A16 | 3.814 KHz | Pin4 on J8 connector |
| am263px-CC | SFDM0_CLK1 | A16 | 3.814 KHz | Pin1 on J18 connector |
| am263px-LP | SFDM0_CLK1 | A16 | 3.814 KHz | Pin4 on J8 connector |
| am261x-LP | GPIO124 | A19 | 3.814 KHz | Pin9 on J6 connector |
PPS signal output with Board modification of this example is as follow:
| EVM | Mapped Signal Name | SOC Pin Name | PPS frequency | Output | Board modification |
|---|---|---|---|---|---|
| am261x-SOM | GPIO124 | A16 | 3.814 KHz | 24th pin on J20(101 pin) in Hsec Dock | Remove R215 and populate R214 |
To set/modify configuration of PPS signal , you may follow the below steps:
EVM and PC has to be connected directly as shown below using CAT6 or CAT5 cable. If there is ethernet switch placed in between, make sure the switch is gPTP capable.
PORT1 instead of PORT0 on EVM can be used as well.
Ethernet And Networking | Ethernet TSN CPSW gPTP Bridge Example | Ethernet TSN CPSW gPTP TimeReceiver (gPTP Slave) Example | Ethernet TSN CPSW gPTP TimeTransmitter (gPTP Master) Example | Ethernet TSN and gPTP Stack - API and Integration Guide