Closed p47-6 closed 7 months ago
Did you check dmesg
for the pps
related messages?
How did you configure the raspberry pi kernel driver to use sync-in
?
Here is the dmesg output:
[ 0.083028] pps_core: LinuxPPS API ver. 1 registered
[ 0.083048] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 10.107286] pps_ldisc: PPS line discipline registered
[ 10.108043] pps pps0: new PPS source serial0
[ 10.108078] pps pps0: source "/dev/ttyS0" added
I've acually did nothing special to configure it. It more or less had ptp0 out-of-the-box. While i was researching the topic i've found https://github.com/jclark/rpi-cm4-ptp-guide but to be honest i did not realy understand whats going on. I've just used the testptp commands to doublecheck if something is working and tried to stick to your guide as close as possible.
Both the rpi-cm-ptp-guide and that original product spec basically talk about PTP. I guess there is some missing information about the configuration of PPS kernel module: the PPS signal from the clock hardware has to be connected to some pin of Raspberry PI. For the hardware I tested with, one specifies this GPIO for the kernel modules with bcm2708.pps_gpio_pin=4
and/or dtoverlay=pps-gpio,gpiopin=4
(GPIO 4 in this example). That results in a dmesg
log output new PPS source pps@4.-1
and Registered IRQ 166 as PPS source
which shows that an interrupt driver is allocated by the kernel driver to handle the PPS signal.
I fear that the output you listed uses some (incomplete) defaults, and that there is something missing to configure your hardware. I didn't find any technical description on the company's web-site. Maybe you contact their support and ask how to configure the Raspberry kernel drivers for PPS (not just PTP) for their hardware?
We are missing something here.
That documentation refers to pin 18:
dtoverlay=pps-gpio,gpiopin=18
(is that your hardware?)
That documentation refers to pin 18:
dtoverlay=pps-gpio,gpiopin=18
(is that your hardware?)
I've added
# Enable GPIO pin 18 for PPS (not always necessary, but useful for testing)
dtoverlay=pps-gpio,gpiopin=18
# realtime clock
dtoverlay=i2c-rtc,pcf85063a,i2c_csi_dsi
# fan
#dtoverlay=i2c-fan,emc2301,i2c_csi_dsi
# Make /dev/ttyAMA0 be connected to GPIO header pins 8 and 10
# This always disables Bluetooth
dtoverlay=disable-bt
to the config and now the dmesg output is the following:
$ dmesg |grep pps
[ 0.089020] pps_core: LinuxPPS API ver. 1 registered
[ 0.089040] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 7.552241] pps pps0: new PPS source pps@12.-1
[ 7.552381] pps pps0: Registered IRQ 38 as PPS source
[ 11.251002] pps_ldisc: PPS line discipline registered
[ 11.252736] pps pps1: new PPS source serial0
[ 11.252820] pps pps1: source "/dev/ttyS0" added
The problem is i get on pps0 and pps1 a timeout.
btw.: I totally mixed up ptp and pps in my head. I've also contacted the board vendor a while ago and they just referred to their docs.
I finally found the documentation of your board on the manufacturers site.
From what I understood this board does not support the PPS configuration used in this project. They seem to connect the PPS signal only to the network hardware of the CM4 (the PTP protocol uses specific ethernet hardware to transport the time signal via ethernet, and the CM4 has such a chip). That way the Raspberry PI Linux kernel doesn't have access to the 1PPS signal.
Unfortunately they do not seem to provide a mechanism to route the PPS signal from the M8N GPS chip to the Raspberry PI GPIOs.
Just to clarify again the differences between PTP and PPS linux protocols:
PTP is basically a legacy protocol used in lab or telecom environments that uses specific hardware extensions to ethernet to transmit time signals. Every instance in the PTP network (switches, all network clients) need to support PTP for it to work.
If you do not have PTP network requirements (e.g. you are not in such a lab), then you could still follow the complete rpi-cm4-ptp-guide instructions. This also sets up a chronyd
time server that receives its time-sync information via PTP. You could then simply use that chronyc
to sync time clients in your network completely ignoring the PTP stuff.
You would then not use any information of this project.
Thank you for the clarification.
Hi, i've tried to follow the setup as close as possible with a CM4 but i wanted to use the SYNC_IN pin on the CM4 breakout port since i've got a LEA-M8F Board from Timebeat (https://store.timebeat.app/products/gnss-raspberry-pi-cm4-module?variant=42280855699627).
My problem is that i still get timeouts with
ppstest
on pps0 and i cannot figure out why:With test ptp i do not get a problem:
also if i hook up a logic analyzer on the physical pin i get a clean 1pps signal as soon as the GPS locks.
here some extra info:
any suggestions ?