How to enable PPS on i.MX8-QXP-C0?

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

How to enable PPS on i.MX8-QXP-C0?

197 Views
killedByBugs
Contributor III

Hi,

 

I would like to enable PPS output on my i.MX8-QXP-C0 board, and then I would like to read the output on my oscilloscope. I think I need to enable it on some files of the drivers. Can you please let me know what files and where in the file I should edit?

( I found on file "imx8qxp_mek.c" from the work dir of Yocto. However, I don't know where I should edit.)

 

Thank you in advance.

Tags (3)
0 Kudos
3 Replies

172 Views
Alejandro_Salas
NXP TechSupport
NXP TechSupport

Hello @killedByBugs 

 

This post can be useful. There is described how you can enable PPS in linux.

 

I hope this can helps.

 

Best regards.

 

Salas.

0 Kudos

67 Views
killedByBugs
Contributor III

Hi Alejandro,

 

I have fixed the following error

fec 5b040000.ethernet: Start time must larger than current time!
-sh: echo: write error: Invalid argument

by changing the second parameter to a number lager than 'current time'.

echo "0 999 0 1 1" > /sys/class/ptp/ptp0/period 

 

Then, I find the output on my oscilloscope(please see the following image). However, the output waveform is not a square wave. Should I edit some code of the driver or device tree file to get a square wave?

PPS_out.png

I also tried:

In the 'work dir' of Yocto, I edit 'fec_ptp.c' in directory '/armv8a-mx8-poky-linux/linux-imx-headers/6.1-r0/git/drivers/net/ethernet/freescale/'. However, when I 'bitbake' again, it seems Yocto doesn't build anything with that file. This editing neither solves my problem. Any suggestion?

 

Thank you in advance,

0 Kudos

105 Views
killedByBugs
Contributor III

Hi Alejandro,

 

I have tried the method on the page you gave me by following steps:

1. run ptp4l:

ptp4l -l 6 -m -i eth0 -p /dev/ptp0 &

2. enable PPS:

echo 1 > /sys/class/ptp/ptp0/pps_enable

3.  change the duty cycle of the PPS clock for a close to 50% ratio

echo "0 0 0 1 1" > /sys/class/ptp/ptp0/period 

However, in step 3, I have got an error:

fec 5b040000.ethernet: Start time must larger than current time!
-sh: echo: write error: Invalid argument

Do you have any solution to solve this problem? Can you also please explain why this problem happended?

 

Thank you in advance

 

0 Kudos