Regarding TSN PTP Function Configuration

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Regarding TSN PTP Function Configuration

70 Views
hankwang
Contributor V

Hi,

I have a question regarding PTP implementation. We need to read IMU data paired with a gPTP timestamp.

Our hardware pin configuration is as follows:

  • CCM_CLKO1 (AH20)  <- 1588_TRIG

  • CCM_CLKO3 (AK20)  <- IMU Sensor Interrupt

  • CCM_CLKO4 (AJ21)  (IMU PPS) ->  CCM_CLKO1 (1588_TRIG)

Based on this, our understanding of the Pin Mux configuration is:

  • CCM_CLKO4 needs to be configured as ALT1 (1588_PP2)

  • CCM_CLKO3 needs to be configured as ALT1 (1588_TRIG2)

  • CCM_CLKO1 needs to be configured as ALT1 (1588_TRIG1)

 

When an IMU interrupt occurs, the hardware signal triggers the 1588 timestamp mechanism on the i.MX95, allowing the SoC to capture the PTP hardware timestamp at the exact moment of the event.

Upon receiving the IMU interrupt, the application reads the IMU data and retrieves the corresponding PTP timestamp, then combines both into a single data package. Please confirm if our understanding is correct.

Additionally, please help us verify the following two points:

  1. Can the i.MX95 capture the PTP hardware timestamp at the exact time of the IMU interrupt via the aforementioned 1588_TRIG / 1588_PP hardware signals?

  2. Does the Linux / NXP driver provide a corresponding API or /dev/ptpX interface for the application to retrieve this hardware-latched timestamp?

Thank you for your support, and I look forward to your reply

Labels (2)
0 Kudos
Reply
4 Replies

7 Views
pengyong_zhang
NXP Employee
NXP Employee

HI @hankwang 

No, there is no need to be split or routed to both the 1588_TRIG pin and a GPIO pin simultaneously.

The NETC Timer's EXTTS (External Timestamp) input on i.MX95 is itself capable of generating a CPU interrupt when an external pulse is received on the TMR_1588_TRIG pin.

B.R

0 Kudos
Reply

15 Views
hankwang
Contributor V

@pengyong_zhang 

Based on our research, the current practice requires routing the IMU interrupt signal simultaneously to both the SoC's 1588_trigger pin and a SoC GPIO pin. Once the IMU generates a signal, the GPIO pin notifies the application to fetch the data, while the 1588 trigger pin latches the precise timestamp of the interrupt.

The application workflow is as follows:

  1. The IMU generates an interrupt signal.

  2. The application receives the interrupt notification, and the SoC latches the gPTP timestamp at the same time.

  3. The application reads the IMU data and the gPTP timestamp, then packages them into a single data bundle.

We would like to know if the IMU interrupt signal needs to be split and routed separately to both the SoC 1588_trigger pin and the SoC GPIO pin. Is this a common industry practice? 

Does NXP have a similar approach or demo?

0 Kudos
Reply

24 Views
hankwang
Contributor V

Hi @pengyong_zhang Thank you for the update. 

We have encountered an issue regarding interrupt handling. When the SoC pin is in default GPIO mode, the IMU driver receives interrupt notifications without any problem. However, we need to know how to receive interrupt notifications when the pin is switched to ALT1 mode (1588_TRIG).

Our workflow requires waiting for an interrupt from the IMU, and then reading both the IMU data and the gPTP timestamp.

0 Kudos
Reply

35 Views
pengyong_zhang
NXP Employee
NXP Employee

Hi @hankwang 

Q1. No problem.

Q2. By connecting the IMU's INT/DRDY input using 1588_TRIG1/TRIG2 (external trigger input), the NETC Timer will hardware-latch a nanosecond-level PTP timestamp at the exact moment of the interrupt edge (stored in the ETTS FIFO and generating an interrupt). The application can then read this timestamp through the standard EXTTS interface on /dev/ptp0.

>>>

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2406352%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERegarding%20TSN%20PTP%20Function%20Configuration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2406352%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EI%20have%20a%20question%20regarding%20PTP%20implementation.%20We%20need%20to%20read%20IMU%20data%20paired%20with%20a%20gPTP%20timestamp.%3C%2FP%3E%3CP%3E%3CSTRONG%3EOur%20hardware%20pin%20configuration%20is%20as%20follows%3A%3C%2FSTRONG%3E%3C%2FP%3E%3CUL%3E%3CLI%3E%3CP%3ECCM_CLKO1%20(AH20)%26nbsp%3B%20%26lt%3B-%26nbsp%3B1588_TRIG%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3ECCM_CLKO3%20(AK20)%26nbsp%3B%20%26lt%3B-%26nbsp%3BIMU%20Sensor%20Interrupt%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3ECCM_CLKO4%20(AJ21)%26nbsp%3B%20(IMU%20PPS)%20-%26gt%3B%26nbsp%3B%26nbsp%3BCCM_CLKO1%20(1588_TRIG)%3C%2FP%3E%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%3CSTRONG%3EBased%20on%20this%2C%20our%20understanding%20of%20the%20Pin%20Mux%20configuration%20is%3A%3C%2FSTRONG%3E%3C%2FP%3E%3CUL%3E%3CLI%3E%3CP%3ECCM_CLKO4%20needs%20to%20be%20configured%20as%20%3CSTRONG%3EALT1%20(1588_PP2)%3C%2FSTRONG%3E%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3ECCM_CLKO3%20needs%20to%20be%20configured%20as%20%3CSTRONG%3EALT1%20(1588_TRIG2)%3C%2FSTRONG%3E%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3ECCM_CLKO1%20needs%20to%20be%20configured%20as%20%3CSTRONG%3EALT1%20(1588_TRIG1)%3C%2FSTRONG%3E%3C%2FP%3E%3C%2FLI%3E%3C%2FUL%3E%3CBR%20%2F%3E%3CP%3EWhen%20an%20IMU%20interrupt%20occurs%2C%20the%20hardware%20signal%20triggers%20the%201588%20timestamp%20mechanism%20on%20the%20i.MX95%2C%20allowing%20the%20SoC%20to%20capture%20the%20PTP%20hardware%20timestamp%20at%20the%20exact%20moment%20of%20the%20event.%3C%2FP%3E%3CP%3EUpon%20receiving%20the%20IMU%20interrupt%2C%20the%20application%20reads%20the%20IMU%20data%20and%20retrieves%20the%20corresponding%20PTP%20timestamp%2C%20then%20combines%20both%20into%20a%20single%20data%20package.%20Please%20confirm%20if%20our%20understanding%20is%20correct.%3C%2FP%3E%3CP%3E%3CSTRONG%3EAdditionally%2C%20please%20help%20us%20verify%20the%20following%20two%20points%3A%3C%2FSTRONG%3E%3C%2FP%3E%3COL%3E%3CLI%3E%3CP%3ECan%20the%20i.MX95%20capture%20the%20PTP%20hardware%20timestamp%20at%20the%20exact%20time%20of%20the%20IMU%20interrupt%20via%20the%20aforementioned%201588_TRIG%20%2F%201588_PP%20hardware%20signals%3F%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3EDoes%20the%20Linux%20%2F%20NXP%20driver%20provide%20a%20corresponding%20API%20or%20%2Fdev%2FptpX%20interface%20for%20the%20application%20to%20retrieve%20this%20hardware-latched%20timestamp%3F%3C%2FP%3E%3C%2FLI%3E%3C%2FOL%3E%3CP%3EThank%20you%20for%20your%20support%2C%20and%20I%20look%20forward%20to%20your%20reply%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2406352%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3ELinux%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EYocto%20Project%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2406825%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Regarding%20TSN%20PTP%20Function%20Configuration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2406825%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F202673%22%20target%3D%22_blank%22%3E%40pengyong_zhang%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBased%20on%20our%20research%2C%20the%20current%20practice%20requires%20routing%20the%20IMU%20interrupt%20signal%20simultaneously%20to%20both%20the%20SoC's%201588_trigger%20pin%20and%20a%20SoC%20GPIO%20pin.%20Once%20the%20IMU%20generates%20a%20signal%2C%20the%20GPIO%20pin%20notifies%20the%20application%20to%20fetch%20the%20data%2C%20while%20the%201588%20trigger%20pin%20latches%20the%20precise%20timestamp%20of%20the%20interrupt.%3C%2FP%3E%3CP%3EThe%20application%20workflow%20is%20as%20follows%3A%3C%2FP%3E%3COL%3E%3CLI%3E%3CP%3EThe%20IMU%20generates%20an%20interrupt%20signal.%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3EThe%20application%20receives%20the%20interrupt%20notification%2C%20and%20the%20SoC%20latches%20the%20gPTP%20timestamp%20at%20the%20same%20time.%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3EThe%20application%20reads%20the%20IMU%20data%20and%20the%20gPTP%20timestamp%2C%20then%20packages%20them%20into%20a%20single%20data%20bundle.%3C%2FP%3E%3C%2FLI%3E%3C%2FOL%3E%3CP%3EWe%20would%20like%20to%20know%20if%20the%20IMU%20interrupt%20signal%20needs%20to%20be%20split%20and%20routed%20separately%20to%20both%20the%20SoC%201588_trigger%20pin%20and%20the%20SoC%20GPIO%20pin.%20Is%20this%20a%20common%20industry%20practice%3F%26nbsp%3B%3C%2FP%3E%3CP%3EDoes%20NXP%20have%20a%20similar%20approach%20or%20demo%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2406762%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Regarding%20TSN%20PTP%20Function%20Configuration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2406762%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F202673%22%20target%3D%22_blank%22%3E%40pengyong_zhang%3C%2FA%3E%26nbsp%3BThank%20you%20for%20the%20update.%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20have%20encountered%20an%20issue%20regarding%20interrupt%20handling.%20When%20the%20SoC%20pin%20is%20in%20default%20GPIO%20mode%2C%20the%20IMU%20driver%20receives%20interrupt%20notifications%20without%20any%20problem.%20However%2C%20we%20need%20to%20know%20how%20to%20receive%20interrupt%20notifications%20when%20the%20pin%20is%20switched%20to%20ALT1%20mode%20(1588_TRIG).%3C%2FP%3E%3CP%3EOur%20workflow%20requires%20waiting%20for%20an%20interrupt%20from%20the%20IMU%2C%20and%20then%20reading%20both%20the%20IMU%20data%20and%20the%20gPTP%20timestamp.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2406509%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Regarding%20TSN%20PTP%20Function%20Configuration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2406509%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F170944%22%20target%3D%22_blank%22%3E%40hankwang%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EQ1.%20No%20problem.%3C%2FP%3E%0A%3CP%3EQ2.%20By%20connecting%20the%20IMU's%20INT%2FDRDY%20input%20using%201588_TRIG1%2FTRIG2%20(external%20trigger%20input)%2C%20the%20NETC%20Timer%20will%20hardware-latch%20a%20nanosecond-level%20PTP%20timestamp%20at%20the%20exact%20moment%20of%20the%20interrupt%20edge%20(stored%20in%20the%20ETTS%20FIFO%20and%20generating%20an%20interrupt).%20The%20application%20can%20then%20read%20this%20timestamp%20through%20the%20standard%20EXTTS%20interface%20on%20%2Fdev%2Fptp0.%3C%2FP%3E%0A%3CP%3E%26gt%3B%26gt%3B%26gt%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E