Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Feb 2022 20:19:25 +0800
From:      Archimedes Gaviola <archimedes.gaviola@gmail.com>
To:        "Daniel O'Connor" <darius@dons.net.au>
Cc:        freebsd-arm@freebsd.org
Subject:   Re: DS3231 RTC module not detected
Message-ID:  <CAJFbk7GRjq-MheWRhVN1TkLOkAiYx5_NH6K%2B3umN0SMjExyB8Q@mail.gmail.com>
In-Reply-To: <2DF482A7-FEFC-4833-A16B-A7A01B8713DD@dons.net.au>
References:  <CAJFbk7EtkjnFBJgr-L3faxaQ2saNgEQ%2BLRPWbRySpwY8wJRh=Q@mail.gmail.com> <F2EFEDCC-1E00-4221-8AF9-3744A7AC359C@dons.net.au> <CAJFbk7Ed2R8M2xAkJQAjiivZie=8Ca_Rt50YEG4P3yWzQLQhrg@mail.gmail.com> <2DF482A7-FEFC-4833-A16B-A7A01B8713DD@dons.net.au>

next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000a8b40205d85e03ff
Content-Type: text/plain; charset="UTF-8"

On Sat, Feb 19, 2022 at 6:52 AM Daniel O'Connor <darius@dons.net.au> wrote:

>
>
> > On 19 Feb 2022, at 00:52, Archimedes Gaviola <
> archimedes.gaviola@gmail.com> wrote:
> > Thanks for the info! I followed similar with your DS1307 RTC by creating
> a ds3231.dtso file and then compiling it with dtc to generate a
> ds3231.dtbo. The result is it is detected as MAX77620 RTC on 0xd0 address
> but when I run an i2c scan, the address detected is 68. Does this should
> match?
>
> Mine was detected similarly:
> iic0: <I2C generic I/O> on iicbus0
> rtc0: <MAX77620 RTC> at addr 0xd0 on iicbus0
> usbus0: 5.0Gbps Super Speed USB v3.0
> rtc0: registered as a time-of-day clock, resolution 1.000000s
>
> I am not sure why it shows up like that but it does seem to work.
>
> > With this setup I could update the date and time now by initiating an
> ntpdate to match our time plus invoking tzsetup command for my timezone
> which is doing well without any issue. Now, the moment I shutdown the
> system and plug back the power cable (with disconnected Ethernet cable just
> to make sure NTP servers are not called for updates upon restart) the time
> remains as it was before shutting down and then upon bootup system clock
> continues. I am expecting that it should be real time even if the RPi4
> system is shutdown or detached from power due to the battery that will
> sustain the continuity of the clock. I'm sure that I'm having good DS3231
> modules as I also tested my existing and another new spare and it is tested
> with OpenBSD too. Below are the system info. Is there anything I've missed?
> FreeBSD 13.0-RELEASE have the same outcome and behavior.
>
> That is strange, I tested powering mine off and it kept time but I am not
> 100% sure it was advancing correctly - I didn't take a precise note of when
> I powered it off etc..
>
> Unfortunately it's not physically with me so I can't test it right now.
>
> I do note this sysctl:
> machdep.rtc_save_period: Save system time to RTC with this period (in
> seconds)
>
> Which suggests to me that the clock could be up to 30 minutes off if the
> power is removed (I believe it gets flushed out on a clean shutdown
> though). Perhaps that is the problem?
>

Thanks for your feedback Daniel! With the exact DS3231 driver all the
concerns I've mentioned were answered. Once it is set manually via date or
ntpdate, the clock will now continue even if your system is shutdown (with
unplug power cable) or even detaching the module from the RPi4 system for
some time and then attaching it back will now be "real-time".

You can bring your DS1307 with the exact driver as well. Thanks a lot for
your help, it is well appreciated.

Archimedes

--000000000000a8b40205d85e03ff
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Sat, Feb 19, 2022 at 6:52 AM Danie=
l O&#39;Connor &lt;<a href=3D"mailto:darius@dons.net.au">darius@dons.net.au=
</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:=
0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">=
<br>
<br>
&gt; On 19 Feb 2022, at 00:52, Archimedes Gaviola &lt;<a href=3D"mailto:arc=
himedes.gaviola@gmail.com" target=3D"_blank">archimedes.gaviola@gmail.com</=
a>&gt; wrote:<br>
&gt; Thanks for the info! I followed similar with your DS1307 RTC by creati=
ng a ds3231.dtso file and then compiling it with dtc to generate a ds3231.d=
tbo. The result is it is detected as MAX77620 RTC on 0xd0 address but when =
I run an i2c scan, the address detected is 68. Does this should match?<br>
<br>
Mine was detected similarly:<br>
iic0: &lt;I2C generic I/O&gt; on iicbus0<br>
rtc0: &lt;MAX77620 RTC&gt; at addr 0xd0 on iicbus0<br>
usbus0: 5.0Gbps Super Speed USB v3.0<br>
rtc0: registered as a time-of-day clock, resolution 1.000000s<br>
<br>
I am not sure why it shows up like that but it does seem to work.<br>
<br>
&gt; With this setup I could update the date and time now by initiating an =
ntpdate to match our time plus invoking tzsetup command for my timezone whi=
ch is doing well without any issue. Now, the moment I shutdown the system a=
nd plug back the power cable (with disconnected Ethernet cable just to make=
 sure NTP servers are not called for updates upon restart) the time remains=
 as it was before shutting down and then upon bootup system clock continues=
. I am expecting that it should be real time even if the RPi4 system is shu=
tdown or detached from power due to the battery that will sustain the conti=
nuity of the clock. I&#39;m sure that I&#39;m having good DS3231 modules as=
 I also tested my existing and another new spare and it is tested with Open=
BSD too. Below are the system info. Is there anything I&#39;ve missed? Free=
BSD 13.0-RELEASE have the same outcome and behavior.<br>
<br>
That is strange, I tested powering mine off and it kept time but I am not 1=
00% sure it was advancing correctly - I didn&#39;t take a precise note of w=
hen I powered it off etc..<br>
<br>
Unfortunately it&#39;s not physically with me so I can&#39;t test it right =
now.<br>
<br>
I do note this sysctl:<br>
machdep.rtc_save_period: Save system time to RTC with this period (in secon=
ds)<br>
<br>
Which suggests to me that the clock could be up to 30 minutes off if the po=
wer is removed (I believe it gets flushed out on a clean shutdown though). =
Perhaps that is the problem?<br></blockquote><div><br></div>Thanks for your=
 feedback Daniel! With the exact DS3231 driver all the concerns I&#39;ve me=
ntioned were answered. Once it is set manually via date or ntpdate, the clo=
ck will now continue even if your system is shutdown (with unplug power cab=
le) or even detaching the module from the RPi4 system for some time and the=
n attaching it back will now be &quot;real-time&quot;.</div><div class=3D"g=
mail_quote"><br></div><div class=3D"gmail_quote">You can bring your DS1307 =
with the exact driver as well. Thanks a lot for your help, it is well appre=
ciated.</div><div class=3D"gmail_quote">=C2=A0<br></div><div class=3D"gmail=
_quote">Archimedes<br></div></div>

--000000000000a8b40205d85e03ff--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJFbk7GRjq-MheWRhVN1TkLOkAiYx5_NH6K%2B3umN0SMjExyB8Q>