Hi,
I am a bit confused. Please correct me if I am wrong. I have removed the
internet connection, power to the board and battery from the external RTC
DS3231 module too.

Its ok, the device tree swaps rtc0 and rtc1 but the system time is not
updated with external RTC time after boot.
Powering up the board without internet connection and external RTC resetted
to default time.

debian@beaglebone:~$ timedatectl

               Local time: Tue 2020-09-01 10:32:27 UTC

           Universal time: Tue 2020-09-01 10:32:27 UTC

                 *RTC time: Sat 2000-01-01 00:15:42*

                Time zone: Etc/UTC (UTC, +0000)

System clock synchronized: no

              NTP service: active

          RTC in local TZ: no


Reconnecting internet connection.

debian@beaglebone:~$ timedatectl

               Local time: Tue 2020-09-01 10:47:37 UTC

           Universal time: Tue 2020-09-01 10:47:37 UTC

                 *RTC time: Tue 2020-09-01 10:47:37*

                Time zone: Etc/UTC (UTC, +0000)

System clock synchronized: yes

              NTP service: active

          RTC in local TZ: no


debian@beaglebone:~$ hwclock -r -f /dev/rtc1

2000-01-01 00:17:30.204350+00:00


debian@beaglebone:~$ sudo hwclock -r -f /dev/rtc0

2020-09-01 10:48:49.965


Regards,

NK


On Tue, Sep 1, 2020 at 1:48 PM Tarmo Kuuse <[email protected]> wrote:

> Hi Niresh,
>
> On 01.09.20 07:43, Niresh wrote:
> > I've tested BB-I2C2-RTC-DS3231.dtbo in the new image 4.19.94-ti-r42,
> > they mount rtc1 in /dev but system time is not updated with rtc1.
> > Attached dmesg with and without DS3231 overlay in uEnv.txt .
> > Following message with DS3231 overlay enabled.
> >
> > root@beaglebone:/dev# hwclock -r -f /dev/rtc1
> > 2000-01-01 00:49:21.771707+00:00
>
> That's OK. The device tree swaps rtc0 and rtc1. Now your DS3231 is
> /dev/rtc0 - which is what you need.
>
> The AM335x-s RTC is /dev/rtc1 - it goes back to year 2000 on every boot.
> You don't need it.
>
> > root@beaglebone:/dev# timedatectl
> > Local time: Tue 2020-09-01 04:34:29 UTC
> > Universal time: Tue 2020-09-01 04:34:29 UTC
> > RTC time: Tue 2020-09-01 04:34:29
> > Time zone: Etc/UTC (UTC, +0000)
> > System clock synchronized: no
> > NTP service: active
> > RTC in local TZ: no
>
> Seems to be correct. "RTC time" is your DS3231.
>
> > debian@beaglebone:/dev$ dmesg | grep rtc
> > [    1.280996] rtc-ds1307 2-0068: registered as rtc0
> > [    1.283636] omap_rtc 44e3e000.rtc: already running
> > [    1.284312] omap_rtc 44e3e000.rtc: registered as rtc1
> > [    1.574739] [drm] Cannot find any crtc or sizes
> > [    1.604280] rtc-ds1307 2-0068: setting system clock to 2020-09-01
> > 04:30:36 UTC (1598934636)
>
> That's your DS3231 being assigned /dev/rtc0 by the kernel and the system
> time correctly set from it. Looks good.
>
> The last step is to enable NTP synchronization:
>
> $ sudo timedatectl set-ntp true
>
> Then you're done. When network comes online, systemd-timesyncd will
> synchronize both your DS3231 and the system time from NTP. Feel free to
> fine-tune ("man timedatectl" and man "timesyncd.conf").
>
> --
> Kind regards,
> Tarmo
>
> --
> For more options, visit http://beagleboard.org/discuss
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "BeagleBoard" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/beagleboard/m4hZYsA-d8M/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/beagleboard/a8f8f997-41a5-8032-4c21-e8cc425b49ae%40gmail.com
> .
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CAF7-PaR0e9-fpxaYryjTcFbwv7Fxpo%2BCmbrhsPayLCQVzhAzMQ%40mail.gmail.com.

Reply via email to