DS3231

From Tinker Board Wiki
Revision as of 06:42, 24 June 2019 by WikiSysop (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

1. Please use the latest V2.0.7 image

2. set the dts overlay file
add the below line into /boot/hw_intf.conf

intf:dtoverlay=ds1307

NOTE : The patch is enable the DS3231 module at I2C 1, so please enable I2C 1 interface at hw_intf.conf file which is under your sdcard.


3. modify some configure files as below:

$ sudo vi /etc/default/hwclock
HCTOSYS_DEVICE=rtc1

 
$ sudo vi /lib/udev/rules.d/85-hwclock.rules
KERNEL=="rtc1", RUN+="/lib/udev/hwclock-set $root/$name"
 

$ sudo vi /lib/udev/rules.d/50-udev-default.rules
SUBSYSTEM=="rtc", KERNEL=="rtc1", SYMLINK+="rtc", OPTIONS+="link_priority=-100"
 

// Comment out
$ sudo vi /lib/udev/hwclock-set
#if [ -e /run/systemd/system ] ; then
#    exit 0
#fi

4. time sync and reboot.

// Switch to root
$ sudo su

// Check Current RTC time.
$ hwclock --rtc=/dev/rtc1 --get
$ timedatectl set-ntp false

// Update RTC time : --systohc
$ hwclock --rtc=/dev/rtc1 -w

// Check Current RTC time again.
$ hwclock --rtc=/dev/rtc1 --get

// Reboot
$ sudo reboot

5. Pictures
B5A29567.PNG
20190109 092611.jpg

6. Attachment
Media:Rtc-ds1307.7z