Jump to content

PPS on NanoPi Neo3 (RK3328) - can't get it to work


vmiceli
Go to solution Solved by Igor,

Recommended Posts

Hello folks,

 

I have been banging my head on this for a few days now and after many searches what should work it is not working :-(

I'm setting up an NTP server on a NanoPi Neo3 board (RK3328) running Armbian and I'm stuck on getting the PPS to work. I have a GPS connected issuing the PPS signal on pin 16 but I don't seem to be able to make it visible to the NanoPi.

 

Here are the usual reports to show what OS I'm running.

"cat /etc/armbian-release"

 

# PLEASE DO NOT EDIT THIS FILE
BOARD=nanopineo3
BOARD_NAME="NanoPi Neo 3"
BOARDFAMILY=rockchip64
BUILD_REPOSITORY_URL=git@github.com:armbian/build.git
BUILD_REPOSITORY_COMMIT=e846ef656-dirty
DISTRIBUTION_CODENAME=buster
DISTRIBUTION_STATUS=supported
VERSION=21.02.3
LINUXFAMILY=rockchip64
BRANCH=current
ARCH=arm64
IMAGE_TYPE=stable
BOARD_TYPE=conf

 

"uname -a"

Linux DietPiNTP 5.10.21-rockchip64 #21.02.3 SMP PREEMPT Mon Mar 8 01:05:08 UTC 2021 aarch64 GNU/Linux

 

Some Kernel info regarding PPS using "gzip -d < /proc/config.gz | egrep -i pps"

CONFIG_PPS=y
# CONFIG_PPS_DEBUG is not set
# PPS clients support
# CONFIG_PPS_CLIENT_KTIMER is not set
CONFIG_PPS_CLIENT_LDISC=m
CONFIG_PPS_CLIENT_GPIO=m
# PPS generators support

 

 

What should work to enable PPS on Armbian is to add the bottom two lines below into /boot/armbianEnv.txt

verbosity=4
bootlogo=false
overlay_prefix=rockchip
fdtfile=rockchip/rk3328-nanopi-r2-rev00.dtb
rootdev=UUID=7f26bae3-11cc-4a08-bcc6-df7f80c7d91b
rootfstype=ext4
console=none
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u
docker_optimizations=off
overlays=pps-gpio
param_pps_pin=101

 

I have serious doubts on the pin naming convention but from the board manufacturer I picked pin 16 named GPIO3_A5/UART1_RTSN with a Linux pin number of 101. So I just used 101 in the param_pps_pin line.

 

This is however not working, I would expect a line in dmesg after reboot stating that a particular pin has been associated to the kernel pps driver, but nothing of that shows up. Even if the pin name is wrong I should see the error message of that association failing I think. All I get is the standard two lines below:

root@DietPiNTP:/boot# dmesg | grep pps
[    1.269816] pps_core: LinuxPPS API ver. 1 registered
[    1.269828] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>

 

Just as reference here are the details of the pps-gpio driver

root@DietPiNTP:/boot# modinfo pps_gpio
filename:       /lib/modules/5.10.21-rockchip64/kernel/drivers/pps/clients/pps-gpio.ko
version:        1.2.0
license:        GPL
description:    Use GPIO pin as PPS source
author:         James Nuss <jamesnuss@nanometrics.ca>
author:         Ricardo Martins <rasm@fe.up.pt>
srcversion:     DC2C20835E78E639C78ED8B
alias:          of:N*T*Cpps-gpioC*
alias:          of:N*T*Cpps-gpio
depends:
intree:         Y
name:           pps_gpio
vermagic:       5.10.21-rockchip64 SMP preempt mod_unload aarch64
sig_id:         PKCS#7
signer:         Build time autogenerated kernel key
sig_key:        6E:AA:FB:15:C6:2A:4C:E0:0C:E1:53:9F:10:36:C1:FF:68:CC:6E:CC
sig_hashalgo:   sha1
signature:      B8:CB:6F:BC:D7:D0:5B:1D:80:29:46:EF:1E:BC:58:69:8C:61:01:FF:
...

 

 

I hope you made it to the end of this long post :-) Is there any feedback or comment that can help me get on the right track?

 

Thanks a million!!!

 

Enzo

 

Edited by vmiceli
Added some more detail
Link to comment
Share on other sites

I got the PPS kernel driver to load. I did that by recompiling the Kernel applying a patch to rk3328-nanopi-neo3-rev02.dts.

 

The patch adds

--- rk3328-nanopi-neo3-rev02.dts	2021-03-27 00:06:41.000000000 +0000
+++ New_rk3328-nanopi-neo3-rev02.dts	2021-03-26 20:53:07.000000000 +0000
@@ -30,6 +30,13 @@
 			debounce-interval = <100>;
 		};
 	};
+	
+	pps {
+		gpios = <&gpio3 RK_PA5 GPIO_ACTIVE_LOW>;
+
+		compatible = "pps-gpio";
+
+	};
 
 	i2s-sound {
 		compatible = "simple-audio-card";

 

In this way I can assign a specfic GPIO as PPS input. In this case is GPIO3_A5/UART1_RTSN (Linux pin 101).

 

By doing that I get:

vmiceli@nanopineo3:~$ dmesg | grep pps
[    0.463517] pps_core: LinuxPPS API ver. 1 registered
[    0.463528] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[   14.338971] pps pps0: new PPS source pps.-1
[   14.339177] pps pps0: Registered IRQ 60 as PPS source

 

That sees like a great success so far, I finally have the kernel create a /dev/pps0 device and assign an IRQ.

However when I go test it with ppstest I get a connection timeout, so something is still not right. 

 

vmiceli@nanopineo3:~$ sudo ppstest /dev/pps0
trying PPS source "/dev/pps0"
found PPS source "/dev/pps0"
ok, found 1 source(s), now start fetching data...
time_pps_fetch() error -1 (Connection timed out)
time_pps_fetch() error -1 (Connection timed out)
time_pps_fetch() error -1 (Connection timed out)

 

The system sees the pin going hi/low as I can run 

watch -n 1.1 sudo cat /sys/kernel/debug/gpio

 

and the gpio pin assigned to pps goes from hi to low as expected.

Any ideas?!?

 

Thanks!

 

Enzo

 

Link to comment
Share on other sites

  • Solution
On 3/23/2021 at 2:32 PM, vmiceli said:

I'm setting up an NTP server on a NanoPi Neo3 board (RK3328) running Armbian

 

On 3/23/2021 at 2:32 PM, vmiceli said:

root@DietPiNTP

 

We don't support 3rd party (commercial) projects you are using, sorry. This forum is dedicated to https://docs.armbian.com/User-Guide_Getting-Started/#how-to-check-download-authenticity under those terms https://github.com/armbian/build#support I am sure this doesn't matter to you, but it does to us. We already can't allocate enough resources to support our users, while we never had intention to support others or under some general terms.

 

On 3/23/2021 at 2:32 PM, vmiceli said:

Here are the usual reports to show what OS I'm running.


It seems you are not (very long) a part of this community, otherwise you would know this forum is not a technical support service and we have a tool for reporting troubles. When you get rid of Dietpi overlay, start here https://www.armbian.com/bugs If this is a feature you are asking for https://forum.armbian.com/forum/38-feature-requests/ waiting time is measured in years.

Link to comment
Share on other sites

  • Igor locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines