Code Monkey home page Code Monkey logo

Comments (8)

frank-w avatar frank-w commented on August 25, 2024

I have not tested pps only added description from forum user to my wiki....

from bpi-router-linux.

gustavobsch avatar gustavobsch commented on August 25, 2024

I tried adding the section below under gpio-keys to the file arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts before compiling. Is this the right way to do it? I couldnt find other dts file in the file system

pps {
pinctrl-names = “default”;
compatible = “pps-gpio”;
gpios = <&pio 15 0>;
status = “okay”;
};

from bpi-router-linux.

frank-w avatar frank-w commented on August 25, 2024

file is right, but you have to do it at top-level, not under gpio-keys and don't forget the driver

from bpi-router-linux.

gustavobsch avatar gustavobsch commented on August 25, 2024

I meant I added below, so it looks like this.


	gpio-keys {
		compatible = "gpio-keys";

		reset-key {
			label = "reset";
			linux,code = <KEY_RESTART>;
			gpios = <&pio 9 GPIO_ACTIVE_LOW>;
		};

		wps-key {
			label = "wps";
			linux,code = <KEY_WPS_BUTTON>;
			gpios = <&pio 10 GPIO_ACTIVE_LOW>;
		};
	};

	pps {
	   pinctrl-names = "default";
	   compatible = "pps-gpio";
	   gpios = <&pio 15 0>;
	   status = "okay";
	}; 

I recompiled with the required modules and it's almost working. Do you know what the issue might be?

dmesg | grep pps
[    0.046661] pps_core: LinuxPPS API ver. 1 registered
[    0.046668] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <[email protected]>
[   17.994579] pps-gpio pps: error -EBUSY: failed to request PPS GPIO
[   18.000797] pps-gpio: probe of pps failed with error -16

dmesg | grep -i gpio
[    0.046507] i2c-gpio i2c-gpio-0: using lines 528 (SDA) and 529 (SCL)
[    0.046618] i2c-gpio i2c-gpio-1: using lines 530 (SDA) and 531 (SCL)
[   17.994579] pps-gpio pps: error -EBUSY: failed to request PPS GPIO
[   18.000797] pps-gpio: probe of pps failed with error -16


from bpi-router-linux.

frank-w avatar frank-w commented on August 25, 2024

why gpio 15? it is not on gpio-header

https://www.fw-web.de/dokuwiki/doku.php?id=en:bpi-r3:gpio

from bpi-router-linux.

gustavobsch avatar gustavobsch commented on August 25, 2024

Thanks, I was using the pin number instead of Mainfunction number, which is 65. Now it seems to work fine!

[    0.046642] pps_core: LinuxPPS API ver. 1 registered
[    0.046648] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <[email protected]>
[   11.334951] pps pps0: new PPS source pps.-1
[   11.339227] pps pps0: Registered IRQ 80 as PPS source

from bpi-router-linux.

gustavobsch avatar gustavobsch commented on August 25, 2024

Any chance you can add GPIO 65 as PPS to the bpir3 device tree? this pin it's perfectly located next to UART2, 3v3 and GND which are used to to connect to the GPS


	gpio-keys {
		compatible = "gpio-keys";

		reset-key {
			label = "reset";
			linux,code = <KEY_RESTART>;
			gpios = <&pio 9 GPIO_ACTIVE_LOW>;
		};

		wps-key {
			label = "wps";
			linux,code = <KEY_WPS_BUTTON>;
			gpios = <&pio 10 GPIO_ACTIVE_LOW>;
		};
	};

	pps {
	   pinctrl-names = "default";
	   compatible = "pps-gpio";
	   gpios = <&pio 65 0>;
	   status = "okay";
	}; 

Testing PPS with a ublox GPS


root@bpi-r3:~# ppstest /dev/pps0
trying PPS source "/dev/pps0"
found PPS source "/dev/pps0"
ok, found 1 source(s), now start fetching data...
source 0 - assert 1681494540.959480083, sequence: 7350545 - clear  0.000000000, sequence: 0
source 0 - assert 1681494541.959483346, sequence: 7350546 - clear  0.000000000, sequence: 0
source 0 - assert 1681494542.959479360, sequence: 7350547 - clear  0.000000000, sequence: 0
source 0 - assert 1681494543.959464814, sequence: 7350548 - clear  0.000000000, sequence: 0

from bpi-router-linux.

frank-w avatar frank-w commented on August 25, 2024

sry, missed this one...very few users use a gps module here, so i would leave this unconfigured, but you can form my repo and add it by yourself ;) but you should use only main-branches, because the rc-branches are rebased from time to time and may create conflicts if you want to update your source from my tree

from bpi-router-linux.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.