bellow the conclusion of 4 days of investigations and it works
create dts file in tmp directory
root@bananapim5:/home/gerard# cat meson-sm1-bananapi-m5-i2c0.dts
/dts-v1/;
/plugin/;
/ {
compatible = "amlogic,meson-sm1";
fragment@0 {
target-path = "/soc/bus@ffd00000/i2c@1d000";
__overlay__ {
status = "okay";
clock-frequency = <100000>;
pinctrl-names = "default";
pinctrl-0 = <&i2c2_pins>;
};
};
fragment@1 {
target-path = "/soc/bus@ff600000/bus@34400/pinctrl@40";
__overlay__ {
i2c2_pins: i2c2_pins {
mux {
groups = "i2c2_sda_x", "i2c2_sck_x";
function = "i2c2";
bias-disable;
drive-strength-microamp = <3000>;
};
};
};
};
fragment@2 {
target-path = "/soc/bus@ffd00000/i2c@1d000";
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
rtc@68 {
compatible = "maxim,ds3231";
reg = <0x68>;
};
};
};
};
compile the dts on a tmp directory
root@bananapim5:/home/gerard# dtc -@ -I dts -O dtb -o meson-sm1-bananapi-m5-i2c0.dtbo meson-sm1-bananapi-m5-i2c0.dts
Copy the output to the /boot environnement
root@bananapim5:/home/gerard# cp meson-sm1-bananapi-m5-i2c0.dtbo /boot/dtb-6.18.15-current-meson64/amlogic/overlay/meson-sm1-bananapi-m5-i2c0.dtbo
modify the boot file /boot/armbianEnv.txt to setup the overlay
root@bananapim5:/home/gerard# cat /boot/armbianEnv.txt
verbosity=1
console=both
overlay_prefix=meson
fdtfile=amlogic/meson-sm1-bananapi-m5.dtb
rootdev=UUID=d5516764-cadb-4a54-9453-6c500b56656c
rootfstype=btrfs
overlays=sm1-bananapi-m5-i2c0
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u
root@bananapim5:/home/gerard#
then a bad surprise the utility hwclock was not in the distro
get the package util-linux-extra_2.39.3-9ubuntu6.3_arm64.deb and install it
root@bananapim5:/home/gerard# wget http://launchpadlibrarian.net/801453777/util-linux-extra_2.39.3-9ubuntu6.3_arm64.deb
--2026-04-03 10:46:26-- http://launchpadlibrarian.net/801453777/util-linux-extra_2.39.3-9ubuntu6.3_arm64.deb
Resolving launchpadlibrarian.net (launchpadlibrarian.net)... 2620:2d:4000:1009::3b8, 2620:2d:4000:1009::13e, 185.125.189.229, ...
Connecting to launchpadlibrarian.net (launchpadlibrarian.net)|2620:2d:4000:1009::3b8|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 122602 (120K) [application/x-debian-package]
Saving to: ‘util-linux-extra_2.39.3-9ubuntu6.3_arm64.deb’
util-linux-extra_2.39.3-9ubuntu6.3_arm64.deb 100%[=========================================================================================================================================>] 119.73K --.-KB/s in 0.05s
2026-04-03 10:46:26 (2.42 MB/s) - ‘util-linux-extra_2.39.3-9ubuntu6.3_arm64.deb’ saved [122602/122602]
root@bananapim5:/home/gerard# dpkg -i util-linux-extra_2.39.3-9ubuntu6.3_arm64.deb
Selecting previously unselected package util-linux-extra.
(Reading database ... 25343 files and directories currently installed.)
Preparing to unpack util-linux-extra_2.39.3-9ubuntu6.3_arm64.deb ...
Unpacking util-linux-extra (2.39.3-9ubuntu6.3) ...
Setting up util-linux-extra (2.39.3-9ubuntu6.3) ...
Processing triggers for man-db (2.12.0-4build2) ...
root@bananapim5:/home/gerard#
you can reboot the module for rtc is download automaticly no need load any module
boot and hwclock command to test with the version and build used on my bpi m5
v26.2.1 for Banana Pi M5 running Armbian Linux 6.18.15-current-meson64
Packages: Ubuntu stable (noble)
IPv4: (LAN) 192.168.1.243
IPv6: xxxxxxx
Performance:
Load: 19% Uptime: 1m
Memory usage: 7% of 3.67G
CPU temp: 41°C Usage of /: 5% of 14G
Tips:
Flash Armbian from macOS, Windows, and Linux https://tinyurl.com/mryujx5u
Commands:
Configuration: armbian-config
Monitoring : htop
Last login: Fri Apr 3 09:54:29 2026 from 192.168.1.101
root@bananapim5:~# hwclock -r -f /dev/rtc1
2026-04-03 11:15:15.211101+02:00
root@bananapim5:~#
root@bananapim5:~#
Story not finished
I try to integrate rtc1 as a fallback to ntp and chrony
unfortunatly i was not able to install chrony on this distro (the last one avalaible for m5) so I try
apt update and
apt upgrade
surprise upgrade downgrade from 6.18.15 to 6.18.10 the system but install util-linux-extra and allow chrony installation
After that I create the necessary service to boot with rtc1 then start chrony and update system clock with ntp or rtc1 depending of availablility of internet
root@bananapim5:/etc/systemd/system# cat sync-* ds3231-rtc.service
[Unit]
Description=Synchronize RTC1 with system or NTP fallback
After=chronyd.service
[Service]
Type=oneshot
ExecStart=/usr/rtc/sync-rtc1.sh
[Unit]
Description=Run RTC1 sync every hour
[Timer]
OnBootSec=5min
OnUnitActiveSec=5min
Unit=sync-rtc1.service
[Install]
WantedBy=timers.target
[Unit]
Description=Synchronize system time from DS3231 RTC
DefaultDependencies=no
Before=sysinit.target
[Service]
Type=oneshot
ExecStart=/sbin/hwclock -s -f /dev/rtc1
RemainAfterExit=yes
[Install]
WantedBy=sysinit.target
root@bananapim5:/etc/systemd/system# cat /usr/rtc/sync-rtc1.sh
#!/bin/bash
# sync-rtc1.sh
# Synchronisation RTC1 <-> système avec logging
# Vérifie si Chrony a des sources NTP actives
NTP_OK=$(chronyc tracking | grep 'Reference ID' | grep -v '0.0.0.0')
if [ -n "$NTP_OK" ]; then
# Chrony OK, mettre RTC1 à jour depuis l’heure système
hwclock -w -f /dev/rtc1
logger -t sync-rtc1 "NTP actif : mise à jour RTC1 depuis l'heure système"
else
# NTP indisponible, remettre l’heure système depuis RTC1
hwclock -s -f /dev/rtc1
logger -t sync-rtc1 "NTP indisponible : mise à jour de l'heure système depuis RTC1"
fi
root@bananapim5:/etc/systemd/system#
end of story.
log of the result
2026-04-03T13:24:30.009238+02:00 bananapim5 sync-rtc1: NTP indisponible : mise à jour de l'heure système depuis RTC1
2026-04-03T13:24:30.013803+02:00 bananapim5 systemd[1]: sync-rtc1.service: Deactivated successfully.
2026-04-03T13:24:30.014705+02:00 bananapim5 systemd[1]: Finished sync-rtc1.service - Synchronize RTC1 with system or NTP fallback.
2026-04-03T13:29:35.005855+02:00 bananapim5 systemd[1]: Starting sync-rtc1.service - Synchronize RTC1 with system or NTP fallback...
2026-04-03T13:29:36.001355+02:00 bananapim5 systemd-resolved[1433]: Clock change detected. Flushing caches.
2026-04-03T13:29:36.010529+02:00 bananapim5 sync-rtc1: NTP indisponible : mise à jour de l'heure système depuis RTC1
2026-04-03T13:29:36.016160+02:00 bananapim5 systemd[1]: sync-rtc1.service: Deactivated successfully.
2026-04-03T13:29:36.016473+02:00 bananapim5 systemd[1]: Finished sync-rtc1.service - Synchronize RTC1 with system or NTP fallback.
2026-04-03T13:30:01.478054+02:00 bananapim5 CRON[2521]: (root) CMD (/usr/lib/armbian/armbian-truncate-logs)
2026-04-03T13:34:44.331407+02:00 bananapim5 systemd[1]: Starting sync-rtc1.service - Synchronize RTC1 with system or NTP fallback...
2026-04-03T13:34:45.001445+02:00 bananapim5 systemd-resolved[1433]: Clock change detected. Flushing caches.
2026-04-03T13:34:45.010331+02:00 bananapim5 sync-rtc1: NTP indisponible : mise à jour de l'heure système depuis RTC1
2026-04-03T13:34:45.015243+02:00 bananapim5 systemd[1]: sync-rtc1.service: Deactivated successfully.
2026-04-03T13:34:45.016212+02:00 bananapim5 systemd[1]: Finished sync-rtc1.service - Synchronize RTC1 with system or NTP fallback.
2026-04-03T13:36:55.097288+02:00 bananapim5 chronyd[1725]: chronyd exiting
2026-04-03T13:36:55.098535+02:00 bananapim5 systemd[1]: Stopping chrony.service - chrony, an NTP client/server...
2026-04-03T13:36:55.106444+02:00 bananapim5 systemd[1]: chrony.service: Deactivated successfully.
2026-04-03T13:36:55.107444+02:00 bananapim5 systemd[1]: Stopped chrony.service - chrony, an NTP client/server.
2026-04-03T13:36:55.130493+02:00 bananapim5 systemd[1]: Starting chrony.service - chrony, an NTP client/server...
2026-04-03T13:36:55.296466+02:00 bananapim5 chronyd[2559]: chronyd version 4.5 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +NTS +SECHASH +IPV6 -DEBUG)
2026-04-03T13:36:55.297080+02:00 bananapim5 chronyd[2559]: Loaded 0 symmetric keys
2026-04-03T13:36:55.298281+02:00 bananapim5 chronyd[2559]: Frequency -22.284 +/- 4.769 ppm read from /var/lib/chrony/chrony.drift
2026-04-03T13:36:55.298541+02:00 bananapim5 chronyd[2559]: Using right/UTC timezone to obtain leap second data
2026-04-03T13:36:55.302159+02:00 bananapim5 chronyd[2559]: Loaded seccomp filter (level 1)
2026-04-03T13:36:55.308879+02:00 bananapim5 systemd[1]: Started chrony.service - chrony, an NTP client/server.
2026-04-03T13:37:00.601703+02:00 bananapim5 chronyd[2559]: Selected source 2620:2d:4000:1::41 (ntp.ubuntu.com)
2026-04-03T13:37:00.602025+02:00 bananapim5 chronyd[2559]: System clock TAI offset set to 37 seconds
2026-04-03T13:37:01.826456+02:00 bananapim5 chronyd[2559]: Selected source 2001:41d0:2:c837::123 (2.ubuntu.pool.ntp.org)
2026-04-03T13:40:11.651555+02:00 bananapim5 systemd[1]: Starting sync-rtc1.service - Synchronize RTC1 with system or NTP fallback...
2026-04-03T13:40:12.008233+02:00 bananapim5 sync-rtc1: NTP actif : mise à jour RTC1 depuis l'heure système
2026-04-03T13:40:12.011630+02:00 bananapim5 systemd[1]: sync-rtc1.service: Deactivated successfully.
2026-04-03T13:40:12.012299+02:00 bananapim5 systemd[1]: Finished sync-rtc1.service - Synchronize RTC1 with system or NTP fallback.
2026-04-03T13:45:01.529270+02:00 bananapim5 CRON[2593]: (root) CMD (/usr/lib/armbian/armbian-truncate-logs)
2026-04-03T13:45:12.987841+02:00 bananapim5 systemd[1]: Starting sync-rtc1.service - Synchronize RTC1 with system or NTP fallback...
2026-04-03T13:45:14.008414+02:00 bananapim5 sync-rtc1: NTP actif : mise à jour RTC1 depuis l'heure système
2026-04-03T13:45:14.012561+02:00 bananapim5 systemd[1]: sync-rtc1.service: Deactivated successfully.
2026-04-03T13:45:14.012904+02:00 bananapim5 systemd[1]: Finished sync-rtc1.service - Synchronize RTC1 with system or NTP fallback.
2026-04-03T13:45:14.013548+02:00 bananapim5 systemd[1]: sync-rtc1.service: Consumed 1.028s CPU time.
2026-04-03T13:45:37.968500+02:00 bananapim5 chronyd[2559]: Selected source 2620:2d:4000:1::40 (ntp.ubuntu.com)
root@bananapim5:/etc/systemd/system#