Discussion:
rpi4: linux-image-6.1.0-18-arm64 kernel does not detect ds1307 rtc
(too old to reply)
Uwe Kleine-König
2024-06-27 17:40:01 UTC
Permalink
Hello Tuxo,
My ds1307 rtc module plugged into my Raspberry Pi 4B (4GB) model is not
getting recognized by the the Bookworm arm64 kernel.
Which pins do you use to connect to the RTC?
In Raspian and Ubuntu the driver is built as a module with
CONFIG_RTC_DRV_DS1307=m and loading happens with
dtoverlay=i2c-rtc,ds3231 in config.txt.
Can you provide the overlay-file you're using in raspian?
Debian does compile it into vmlinuz with CONFIG_RTC_DRV_DS1307=y but the
hardware detection fails with no mentioning of rtc in dmesg.
i2c_dev and i2c_bcm2835 are loaded, but i2cdetect -y 1 does not detect
the rtc on the bus.
Note the bus number might be different when using different kernels.
Is this a bug or where there no plans to add this to the rpi4 feature set?
do you irc? This communication form is (IMHO) better suited for such
debugging. I'm in #debian-raspberrypi on OFTC.

Best regards
Uwe
Uwe Kleine-König
2024-07-02 21:40:01 UTC
Permalink
Hello,

we met via irc, here comes just the summary to maybe benefit others with
similar problems.
Post by Uwe Kleine-König
My ds1307 rtc module plugged into my Raspberry Pi 4B (4GB) model is
not getting recognized by the the Bookworm arm64 kernel.
Which pins do you use to connect to the RTC?
In Raspian and Ubuntu the driver is built as a module with
CONFIG_RTC_DRV_DS1307=m and loading happens with
dtoverlay=i2c-rtc,ds3231 in config.txt.
Can you provide the overlay-file you're using in raspian?
Debian does compile it into vmlinuz with CONFIG_RTC_DRV_DS1307=y but
the hardware detection fails with no mentioning of rtc in dmesg.
i2c_dev and i2c_bcm2835 are loaded, but i2cdetect -y 1 does not detect
the rtc on the bus.
Note the bus number might be different when using different kernels.
i2cdetect 1 didn't list the RTC, because in Debian the right bus number
is 3. i2cdetect 3 listed the RTC.
Post by Uwe Kleine-König
Is this a bug or where there no plans to add this to the rpi4 feature set?
The source for the dtbo looks as follows:


/dts-v1/;
/plugin/;

/ {
compatible = "brcm,bcm2835";
};

&i2c1 {
#address-cells = <0x01>;
#size-cells = <0x00>;

***@68 {
compatible = "maxim,ds3231";
reg = <0x68>;
};
};

That one can be compiled using

dtc -I dts -O dtb i2c-ds3231-i2c0.dts > i2c-ds3231-i2c0.dtb0

. The resulting file must then be placed in /boot/firmware/overlays and
mentioned in config.txt using

overlay=i2c-ds3231-i2c0.dtb0

(ideally using /etc/default/raspi-firmware-custom because config.txt is
autogenerated and overwritten during the next kernel update).

Best regards
Uwe

Loading...