DS3231 RTC on Raspberry Pi 4 (8GB). New user, going mad.

# freebsd-version ; uname -a
15.0-RELEASE-p9
FreeBSD S3RV3D85D 15.0-RELEASE-p9 FreeBSD 15.0-RELEASE-p9 GENERIC arm64


I'm new to BSD, but I've used linux off and on since ~2003. I'm trying to build a headless NAS with the Pi4, using ZFS, which requires me to get away from Linux, to do it cleanly.

I have the Adafruit PiRTC DS3231 module, which connects to Pi gpio pins 2 and 3, in accordance with the Pi4 datasheet's designation of "alt0". I have tried a number of configurations of settings, and nothing has worked. The module is "seen" by i2c, but not "recognized", I guess.

Two reference points, before I dump what I have:
https://forums.freebsd.org/threads/using-both-i2c_arm-and-i2c_vc-on-rpi4b.83516/
https://forums.freebsd.org/threads/rtc-on-raspberrypi3.63448/

Code:
"/boot/efi/config.txt" 21L, 252B                                                                                                                                                        21,0-1        All
[all]
arm_64bit=1
dtparam=audio=on,i2c_arm=on,spi=on
dtoverlay=mmc
dtoverlay=disable-bt
dtoverlay=disable-wifi
device_tree_address=0x4000
kernel=u-boot.bin

[pi4]
hdmi_safe=1
armstub=armstub8-gic.bin


gpio=2,3=a0
dtoverlay=i2c-rtc,ds3231=on

[all]

I edited the code from the second link (after it didn't work) to match what I thought was correct (i2c0, RPi4. I also tried bcm2711, but that didn't work either). Yes, I compiled it every time, into a dtbo file.
Code:
# cat /boot/efi/overlays/ds3231.dtso
// Definition for RPi4 I2C based Real Time Clock
/dts-v1/;
/plugin/;

/ {
        compatible = "brcm,bcm2708";

        fragment@0 {
                target = <&i2c0>;
                __overlay__ {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        status = "okay";
                                ds3231: ds3231@68 {
                                        compatible = "maxim,ds3231";
                                        reg = <0x68>;
                                        status = "okay";
                        };
                };
        };
        __overrides__ {
                ds3231 = <&ds3231>,"status";
        };
};

Code:
# cat /boot/loader.conf
# Configure USB OTG; see usb_template(4).
hw.usb.template=3
umodem_load="YES"
# Multiple console (serial+efi gop) enabled.
boot_multicons="YES"
boot_serial="YES"
# Disable the beastie menu and color
beastie_disable="YES"
loader_color="NO"

fdt_overlays="ds3231.dtbo"

Code:
# i2c -sv
Hardware may not support START/STOP scanning; trying less-reliable read method.
Scanning I2C devices on /dev/iic0:
68

Code:
# dmesg | grep -i iic
iichb0: <BCM2708/2835 BSC controller> mem 0x7e804000-0x7e804fff irq 27 on simplebus0
iicbus0: <OFW I2C bus> on iichb0
iic0: <I2C generic I/O> on iicbus0


The 68 tells me that it *sees* the module, but the lack of recognition from dmesg tells me it's not talking to it. I'm sure I'm missing something simple. Please help?
 
Back
Top