Hello,
I am trying to use an Adafruit GPS Module with a BeagleBone AI64 (BBAI64) to synchronize the system time. For the GPS Module to work an uart connection and one additional GPIO is required.
I need help by creating a device tree overlay to use a gpio as a PPS source. I have tried to create an example for BBAI64 from a working BeagleBone Black (BBB) Device Tree Overlay. I dont need help with the userspace software configuration for gpsd or chrony.
I have the uart running by adding the uart overlay for it in /boot/firmware/extlinux/extlinux.conf
Content of /boot/firmware/extlinux/extlinux.conf:
label Linux eMMC
kernel /Image
append root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait net.ifnames=0 quiet
fdtdir /
fdtoverlays /overlays/BONE-UART1.dtbo #/overlays/BBAI64-P9_18-GPS-PPS.dtbo
initrd /initrd.img
I have tried to create another overlay for the PPS support but when I am adding it, I am always unable to boot.
To be frank, I am quite new to the Device Tree and Overlays in General.
Using the Connector Tables I have tried to alter the following working example for an BBB into an example for the BBAI64.
EXPAND working example for BBB
/*
*
* Virtual cape for UART1 on connector pins P9.24 P9.26 w/PPS on P9.12
*
* Based on this thread:
* https://forum.beagleboard.org/t/beaglebone-black-gps-pps-and-chrony-for-time-sync/897/17
*/
/dts-v1/;
/plugin/;
#include <dt-bindings/board/am335x-bbw-bbb-base.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/am33xx.h>
/{
compatible = "ti,beaglebone-black";
part-nmumber = "BB-UART-GPS";
version = "00A0";
exclusive-use = "P9.12", "P9.24", "P9.26", "uart1";
fragment@0 {
target=<&ocp>;
__overlay__ {
P9_12_pinmux{status="disabled";};
P9_24_pinmux{status="disabled";};
P9_26_pinmux{status="disabled";};
};
};
fragment@1 {
target = <&am33xx_pinmux>;
__overlay__ {
bb_uart1_pins: pinmux_bb_uart1_pins {
pinctrl-single,pins = <
BONE_P9_24 (PIN_OUTPUT | MUX_MODE0) /* uart1_txd.uart1_txd */
BONE_P9_26 (PIN_INPUT | MUX_MODE0) /* uart1_rxd.uart1_rxd */
>;
};
bb_gps_pps_pins: pinmux_bb_gps_pps_pins {
pinctrl-single,pins = <
BONE_P9_12 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpio1_28 */
>;
};
};
};
fragment@2 {
target = <&uart1>;
__overlay__ {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&bb_uart1_pins>;
};
};
fragment@3 {
target-path = "/";
__overlay__ {
gps_pps {
status = "okay";
compatible = "pps-gpio";
pinctrl-names = "default";
pinctrl-0 = <&bb_gps_pps_pins>;
gpios = <&gpio1 28 0>;
};
};
};
};
The example includes lines for uart and pps. Since UART1 is already usable with the provided overlays, I have tried to remove everything but configuration for PPS:
REMARK: I cant boot when adding this overlay to extlinux.conf. So please dont add the following overlay in the current state unless you know how to remove it again.
I am trying to get the PPS working on P9_18. Any other free gpio would be suitable aswell for me.
EXPAND faulty example for BBAI64
/*
* Based on this thread:
* https://forum.beagleboard.org/t/beaglebone-black-gps-pps-and-chrony-for-time-sync/897/17
*/
/dts-v1/;
/plugin/;
#include <dt-bindings/board/k3-j721e-bone-pins.h> /*<- #include <dt-bindings/board/am335x-bbw-bbb-base.h>*/
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/k3.h> /*<- #include <dt-bindings/pinctrl/am33xx.h> */
/{
compatible = "beagle,j721e-beagleboneai64", "ti,j721e";
model = "BeagleBoard.org BeagleBone AI-64";
part-nmumber = "BB-UART-GPS";
version = "00A0";
exclusive-use = "P9.18";
fragment@0 {
target=<&ocp>;
__overlay__ {
P9_18_pinmux{status="disabled";};
};
};
fragment@1 {
target = <&main_pmx0>;
__overlay__ {
bb_gps_pps_pins: pinmux_bb_gps_pps_pins {
pinctrl-single,pins = <
J721S2_IOPAD(0x0A4, PIN_INPUT_PULLDOWN, 7) /* P9.18 GPIO0_40 */
>;
};
};
};
fragment@2 {
target-path = "/";
__overlay__ {
gps_pps {
status = "okay";
compatible = "pps-gpio";
pinctrl-names = "default";
pinctrl-0 = <&bb_gps_pps_pins>;
gpios = <&gpio0 40 0>; //refer https://docs.beagleboard.org/latest/boards/beaglebone/ai-64/ch07.html p9.18 row gpio
};
};
};
};
I have tried to exchange the BBB specific values with the values for BBAI64. e.g:
am33xx_pinmux -> main_pmx0
P9.12 -> P9.18
compatible = "ti,beaglebone-black"; -> compatible = "beagle,j721e-beagleboneai64", "ti,j721e";
BONE_P9_12 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpio1_28 */ -> J721S2_IOPAD(0x0A4, PIN_INPUT_PULLDOWN, 7) /* P9.18 GPIO0_40 */
gpios = <&gpio1 28 0>; -> gpios = <&gpio0 40 0>;
In order to build and install the files I have used the following commands:
git clone https://github.com/beagleboard/BeagleBoard-DeviceTrees/tree/v5.10.x-ti-arm64
cd BeagleBoard-DeviceTrees
# change to specific kernel version and architecture (can be acquired with uname -a)
git checkout v5.10.x-ti-arm64
cd src/arm64/overlays/
#create the new overlay. e.g.: vim BBAI64-P9_18-GPS-PPS.dts
#insert code into the new overlay
cd ../../../
make clean
make
sudo make install
In order to activate the overlay I have changed the contents of /boot/firmware/extlinux/extlinux.conf to:
label Linux eMMC
kernel /Image
append root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait net.ifnames=0 quiet
fdtdir /
fdtoverlays /overlays/BONE-UART1.dtbo /overlays/BBAI64-P9_18-GPS-PPS.dtbo
initrd /initrd.img
Currently running Kernel: 5.10.162-ti-arm64-r96