This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to use DS3231 RTC
#1
TinkerOS_Android V13.13.0.74

Release Notes
4. Support DS3231 RTC module.

The  DS3231 module is connected to the port I2C_1, when I write in terminal :
"1|root@rk3288:/ # hwclock -r -f /dev/rtc1"
I see the time and date
"Tue Jan  4 23:54:11 2000  0.000000 seconds"

When I write in terminal :
"1|root@rk3288:/ # hwclock -w -f /dev/rtc1"
hwclock: failed: No such file or directory

How to useDS3231 RTC as hardware clock instead rtc0?
Reply
#2
(05-11-2018, 08:22 PM)vintm Wrote: TinkerOS_Android V13.13.0.74

Release Notes
4. Support DS3231 RTC module.

The  DS3231 module is connected to the port I2C_1, when I write in terminal :
"1|root@rk3288:/ # hwclock -r -f /dev/rtc1"
I see the time and date
"Tue Jan  4 23:54:11 2000  0.000000 seconds"

When I write in terminal :
"1|root@rk3288:/ # hwclock -w -f /dev/rtc1"
hwclock: failed: No such file or directory

How to useDS3231 RTC as hardware clock instead rtc0?

Hi, 
Please try this patch, this patch will remove the original rtc0 device so the DS3231 will become the rtc0.
https://bitbucket.org/TinkerBoard_Android/rk-kernel/commits/404ffdd1c2bc4dd9fb474233efb1a352300c5a63?at=sbc/tinkerboard/asus/Android-6.0.1
Reply
#3
Jamess, thanks for the answer.
I have two questions:
1 Why the command "hwclock -w -f /dev/rtc1" is not executed;
2 What should I do to apply this patch
Sorry for my English
Reply
#4
(05-14-2018, 08:13 PM)vintm Wrote: Jamess, thanks for the answer.
I have two questions:
1 Why the command "hwclock -w -f /dev/rtc1" is not executed;
2 What should I do to apply this patch
Sorry for my English

1. The android framework will use the /dev/rtc0 to sync the time, maybe it is overridden by the android framework. (I am not sure, just guess)
2. you can reference the below link for rebuild kernel
    https://tinkerboarding.co.uk/wiki/index.php?title=Software#Android_6.0.1_kernel
    Before building image, please remember apply the patch. Since the patch modify only one line, you can modify the change manually.
    Edit the drivers/rtc/Makefile and comment this line: obj-$(CONFIG_RK808_RTC)  += rtc-rk808.o
Reply
#5
(05-15-2018, 01:10 AM)jamess Wrote:
(05-14-2018, 08:13 PM)vintm Wrote: Jamess, thanks for the answer.
I have two questions:
1 Why the command "hwclock -w -f /dev/rtc1" is not executed;
2 What should I do to apply this patch
Sorry for my English

1. The android framework will use the /dev/rtc0 to sync the time, maybe it is overridden by the android framework. (I am not sure, just guess)
2. you can reference the below link for rebuild kernel
    https://tinkerboarding.co.uk/wiki/index.php?title=Software#Android_6.0.1_kernel
    Before building image, please remember apply the patch. Since the patch modify only one line, you can modify the change manually.
    Edit the drivers/rtc/Makefile and comment this line: obj-$(CONFIG_RK808_RTC)  += rtc-rk808.o

Thanks for your help!
I thought that if the support is implemented in the kernel, it is enough to correct the file, for example /lib/udev/rules.d/50-udev-default.rules, or the other and all. And it turns out that it is necessary to edit the kernel.
Well, I will study wiki.
Reply
#6
Hi, All!
Patch applied. Thanks Jamess.
Kernel assembled.
Now in /dev I see only rtc0. When I put "hwclock -r -f /dev/rtc0", I see "Thu Feb 10 19:51:32 2000 0.000000 second".
But when I put hwclock -w -f /dev/rtc0", i see "hwclock: failed: No such file or directory"
How to set time in DS3231???
Reply


Forum Jump:


Users browsing this thread: Thaiche, 1 Guest(s)