Tarmo:

I’ve been following this with some interest and finally got around to trying it 
on my BBB running the 2020-04-06 release.  

I have an external DS3231 connected to I2C2. I’ve got it working and mounted as 
RTC1, but the magic of swapping the DS3231 for the AM335x-s is not happening 
for me.

I have confirmed the DS3231 is RTC1 by the simple method of asking for the time 
with the I2C jumpers disconnected, which results in an error.  Reconnecting the 
jumpers restores operation of RTC1.  RTC0 works whether the jumpers are 
connected or not.  

I added the dtb_overlay command to /boot/uEnv.txt and restarted.  I don’t have 
an rc.local file, so I ran echo ds3231 0x68 > 
/sys/class/i2c-adapter/i2c-2/new_device from the command line after rebooting.  

What is needed so that the device tree swaps the two clocks, making the 
external DS3231 RTC0, as indicated in the thread below?  Is this something in 
the alpha image?

Thx,
-Steve


> On Sep 1, 2020, at 4:16 AM, Tarmo Kuuse <tarmo.ku...@gmail.com> 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 the Google Groups 
> "BeagleBoard" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to beagleboard+unsubscr...@googlegroups.com.
> 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 beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/53F92013-C18B-417D-B4D2-857583B1E9C6%40gmail.com.

Reply via email to