Building ntp on the zynq - ComPair/ComPair-tracker-FPGA GitHub Wiki

Building NTP on the zynq

1. Get the NTP source on the zynq:

git clone https://github.com/ntp-project/ntp.git
scp -r ntp root@silayer:~/local/src

2. Run build scripts

ssh to silayer, cd into the ntp source directory, then run:

./bootstrap
./configure

3. Remove lynx command

In Makefile.am, look for the recipe that uses the lynx command. Replace the command to use touch to create the file that lynx would have downloaded

4. make && make install

To be clear:

make && make install

5. scp the ntp.conf file over

scp ComPair-tracker-FPGA/src/petalinux/users/lucas/etc/ntp.conf root@silayer:/etc/

Now, ssh to silayer, and edit /etc/ntp.conf to use your control computer's IP (edit line 20)

6. Get the date close

You have to get the time close to the real time using things like the following before running ntpd

date --set 21:05:00
date --set 2020-03-23

7. Run ntpd on the gse/daq computer

Do whatever you need to do to get ntpd running on your computer, the one that the zynq will connect to

8. Run ntpd on the zynq

Simply run ntpd. You can check /var/log/messages to see that things are running, or run ntpq -p to see that you actually are connected, and what the current offset is.

9. Setting up the init script

This step will enable ntpd to be run automatically on startup. First, copy the init script over:

scp ComPair-tracker-FPGA/src/petalinux/users/lucas/etc/init.d/ntp root@silayer:/etc/init.d

Then, ssh to the zynq and make symbolic links in rc[2345].d directories. For example, run the following:

for level in $(seq 2 5); do
    ln -s /etc/init.d/ntp /etc/rc${level}.d/S99ntp
done