This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM6548: ICSSG Ethernet Timestamp Synchronization

Part Number: AM6548

I have a question about synchronizing the timestamps between ICSSG slice 0 and slice 1. My end goal here is synchronized packet capture between slices and hopefully PRU instances. I am running the icssg-prueth firmware in all PRU instances and running linux SDK 8.2. I've made some small modifications to the prueth linux drivers to ignore the TX side and autoforward the packet as well as preamble from RX0 to TX1 and RX1 to TX0. With this configuration the PRU is acting as a passthrough for the network with minimal latency. It seems to work fine, and I can sniff packets using tcpdump or any libpcap based program.

Linux of course still treats this as two network devices. I would like to capture packets of both of these interfaces into a single file, thus capturing the bidirectional traffic on the network. I've written a small libpcap based program that creates two separate threads for packet capture, one for each PRU slice. So a thread for RX0 and a thread of RX1. Upon termination of the program, it merges the capture files. I can then go look at them in wireshark on my host PC. The issue that pops out though is the timestamps on the packets. It would seem there isn't synchronization between timestamps of the RX0 and RX1 packets. I am sniffing a deterministic network where packets will go from RX0 -> TX1 -> outside device -> RX1 -> TX0. I observe that there is sometimes discrepancies with the timing of the resulting capture file with it not following this structure. When they are off, it is in the realm of a ~0-5us difference.

So it would seem that the timestamps from PRU slice 0 and PRU slice 1 weren't synchronized. Looking through the drivers at a quick surface level it would look like they are using the IEP counter to do the timestamps. Is that correct? If so, is there a way to ensure that PRU0 and PRU1 are utilizing the same IEP counter so ensure the timestamps between the two are in sync? I tried adding into the initialization section in the drivers to write to the "PRU_ICSSGx_PR1_CFG_SLV" register to enable "IEP1 master counter slave enable" to make sure IEP0 and IEP1 were the same. But that didn't seem to make a difference. Any ideas how I can ensure synchronization between timestamps?

To add to this, it is entirely possible it is my program's fault as well. I guess I am really looking to see how the timestamps of PRU0 and PRU1 are created, and if they differ at all between PRU0 and PRU1.