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.

CCS/AM3358: PTP 1PPS question

Part Number: AM3358

Tool/software: Code Composer Studio

We would like to use the PTP 1 PPS output to synchronize with a master. In the Linux Processor SDK documentation I came across this note:

 Known Issue: On AM335x/AM437x, the current PPS implementation has the possibility of failing to correctly synchronize PPS output to a master (only the PPS output is affected, the PTP functionality still succeeds). This appears as the slave PPS being offset from the master PPS signal on an order of 40-100ms either on starting PPS or after running for an extended period of time. As a workaround, if PPS output is observed to be offset, then to temporarily stabilize PPS output for measurement, bring down and then bring back up the ethernet interface in use to reset PTP/PPS (e.g. ifconfig eth1 down/ifconfig eth1 up). If the PPS output is successful, then the output is valid and can be used to measure jitter.

I also see that there has been some recent changes to the PTP PPS source code in the Git repository. Do those source code changes possibly address the above issue? If not, is there a way with software only to recognize if the PPS is synchronized to a master and determine if the Ethernet interface needs to be brought down and back up?

  • Hello Jim,

    What version of Processor SDK are you using?

    Are you planning to use the PRU Ethernet port for PTP traffic / PPS output, or CPSW port?

    To clarify, this is what the documentation is talking about. Let me know if you were hoping to do something else:

    clock master --------------> PPS output
        |
        |
       PTP
        |
        |
    AM335x PRU Ethernet -------> PPS output (might be misaligned from master PPS)
    clock slave

    Regards,

    Nick

  • Hi Nick,

    I have not tried a particular version Processor SDK yet. I am investigating various application processors that we might use for PTP synchronization. The AM335x looks like it could be an option for us. I do see now that we could use either the CPSW port or the PRU for PTP PPS. Using the PRU appears to have lower jitter but it won't work for our needs if it is not consistently synchronized to the master. I was hoping that the PRU PPS inconsistencies might be corrected in a software update but perhaps they cannot be with the AM335x?

    Regards,

    Jim

  • Hello Jim,

    As of SDK 6.0, TI only officially supports PPS output on AM335x using the PRU. The PPS offset issue still exists in SDK 6.0. We will get back to you with potential options in a couple of days. 

    * Do you have a timeline for when your project would need working software?

    * Is your team comfortable with modifying kernel drivers?

    Regards,

    Nick

  • Hi Nick,

    Thanks for checking into the PPS offset. Our time frame is flexible. 6 months might be a good target. We have limited experience with kernel drivers so I'm hesitant to say that we are comfortable modifying them but I can say we are willing to try.

    Regards,

    Jim

  • Hello Jim,

    Got it.

    Could you tell us more about your use case for PPS? e.g., will it only be used during testing for validation of PTP performance, or is the PPS output going to be used in the production system to drive another part?

    Regards,

    Nick

  • Hi Nick,

    We need to use the PPS output for production to obtain a common data sampling clock. The plan is to use the PPS to interface with a jitter cleaner/clock conversion ic to obtain the desired frequency derived from the PPS signal. The goal is to have a common sampling frequency between a master and our equipment as a 1588 slave.

    Regards,

    Jim

  • Hello Jim,

    Ok, here are our options:

    1. PPS output from PRU-ICSS. I hope that the PPS offset issue is addressed by the December 2019 SDK release, but I cannot promise it will be fixed by then.
    2. PPS output from CPTS: This feature is technically not supported at this point in time. However, I created a "rough draft" kernel hack that ported the AM57xx CPTS PPS support down to AM335x. Over a 10 day period, the 1588 slave's PPS signal was observed to stay within +/- 500ns of the master's PPS signal. I hope to get this officially supported at some point, but I do not have a timeline.

    If you are interested in trying out the PPS output from the CPTS, I can attach a patch with my kernel hack and instructions for running a demo.

    Regards,

    Nick

  • Hi Nick,

    Yes, I am interested in trying out the PPS output from the CPTS. I have the Processor Linux SDK setup (ti-processor-sdk-Linux-am335x-evm-06.00.00.07) on a Linux host and have successfully ran make all. Please attach the patch and demo instructions.

    Thanks!

    Jim

  • Hello Jim,

    I am sorry for the long response here. I wrote the patch for SDK 5.3, so I'm checking that it still can apply to SDK 6.0 and then I'll attach the patch and instructions.

    Regards,

    Nick

  • No problem. Thanks for the update.

    Jim

  • Hello Jim,

    quick update. The cpts driver got reorganized between SDK 5.3 / Linux 4.14 and SDK 6.0 / Linux 4.19, so I had to manually re-add a lot of the patch code. I've got the driver building, I'll run a quick test to make sure I'm actually seeing PPS output and I'll post the SDK 6.0 patch in a day or so!

    Regards,

    Nick

  • Hello Jim,

    I want to apologize for how long it is taking me to get through this. A tornado hit my lab 8 days ago, and I still do not have access to the hardware I was using to run tests. It might be more than a week before I'm even allowed to retrieve my boards to resume tests.

    Regards,

    Nick

  • Hi Nick,

    No worries. There is no urgency on my end. Hopefully no one was hurt.

    Regards,

    Jim 

  • Hello Jim,

    Thankfully most employees were at home. I have not heard of any injuries.

    I am finally back in the lab. Since this is not urgent for you, I am setting myself a calendar reminder to come back to this project on Nov 18 so I can catch up on other tasks. I am following up with the software team to see if the PRU Ethernet PPS bug fix can be expected in our December release, or if it will be later.

    Please ping me if there are any timeframe/urgency changes on your side, or if you have any follow-up questions!

    Regards,

    Nick

  • Hello Jim,

    Updates:

    There will not be any PPS driver updates for AM335x in the December release. I also cannot guarantee a specific timeline for driver updates. However, I have been talking with the developer a bit about driver design, so I hope that we can get either PRU Ethernet PPS or CPSW PPS working and supported in a TI driver for AM335x sometime in 2020.

    I'll spend another couple hours to see if I can get the SDK 6.0 version of my CPTS hack working. I'll give another update sometime soon.

    Regards,

    Nick

  • Haven't had time to dig into this yet. Shooting to look at it early next week.

    Regards,

    Nick