Skip to content

Instantly share code, notes, and snippets.

@Elwell
Created August 23, 2025 09:38
Show Gist options
  • Select an option

  • Save Elwell/ff65ab4b8ab405dbfc18a76b26f81053 to your computer and use it in GitHub Desktop.

Select an option

Save Elwell/ff65ab4b8ab405dbfc18a76b26f81053 to your computer and use it in GitHub Desktop.
PPS overlay for a Beaglebone Black with a 6.15 kernel on debian trixie

Notes

This took much longer to do than I expected. There seems to be a LOT of old information (hey, the BBB came out in April 2013), and examples seemed to include lots of 'fragment' sections that weren't in newer overlays. I was originally going to do a single overlay that monitored some other GPIOs raised by my RFZERO board, however for now I just include uart1 (to pick up the serial from GPS) and this overlay to configure the BBB as an NTP server.

I'll put a few more words on my blog once I've finished tweaking chrony / gpsd configs

Compiling

Because of the #include formatted lines, you'll need to pre-process this with cpp. I was unaware that the sources are already in /opt/source so I downloaded the overlays from GitHub and added mine.

cd BeagleBoard-DeviceTrees/
cpp -nostdinc -I include -I arch  -undef -x assembler-with-cpp ../PPS-00A0.dts > PPS-00A0.dtso
dtc -@ -O dtb -o PPS-00A0.dtbo PPS-00A0.dtso
cp PPS-00A0.dtbo /boot/dtbs/$(uname -r)/overlays/

And then add the overlay to your uEnv.txt

uname_r=6.15.10-bone26
enable_uboot_overlays=1
uboot_overlay_addr0=BB-UART1-00A0.dtbo
uboot_overlay_addr1=PPS-00A0.dtbo
disable_uboot_overlay_video=1
disable_uboot_overlay_audio=1
disable_uboot_overlay_wireless=1
uboot_overlay_pru=AM335X-PRU-UIO-00A0.dtbo
console=ttyS0,115200n8
cmdline=fsck.repair=yes earlycon coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100
// SPDX-License-Identifier: GPL-2.0-only
/*
* Overlay to accept a PPS input from GPS device on P9_12.
* Andrew Elwell <[email protected]>, Aug 2025
* Thanks to pointers on Discord and BB Forums
*/
/dts-v1/;
/plugin/;
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/am33xx.h>
#include <dt-bindings/interrupt-controller/irq.h>
/*
* Helper to show loaded overlays under: /proc/device-tree/chosen/overlays/
*/
&{/chosen} {
overlays {
PPS-00A0.bb.org-overlays = __TIMESTAMP__;
};
};
&ocp {
P9_12_pinmux { status = "disabled"; }; /* pps */
};
&am33xx_pinmux {
bb_pps_gpio_pins: pinmux_pps_gpio_pins {
pinctrl-single,pins = <
AM33XX_PADCONF(AM335X_PIN_GPMC_BEN1, PIN_INPUT_PULLDOWN, MUX_MODE7) /* P9_12 pps_gpio */
>;
};
};
&{/} {
pps {
status = "okay";
compatible = "pps-gpio";
pinctrl-names = "default";
pinctrl-0 = <&bb_pps_gpio_pins>;
gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>;
};
};
@hairlesshobo
Copy link

Hey, you have no idea how awesome the timing on this was for me. I started researching using my BBB as a stratum 1 time server and gpsd server like a week ago. JUST got my gps module with PPS output in today and stumbled on this that you posted only a couple days ago. Thrilled to let you know that it worked perfectly for me, even on Bookworm and already got it up and running.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment