Page 1 of 1

Problem with RTC board

Posted: Wed Jan 20, 2021 9:00 pm
by blue1
I have installed the RTC board (v 1.3). However, I cannot make it work:

Code: Select all

/root# hwclock --verbose
hwclock from util-linux 2.35.1
System Time: 497.303743
Trying to open: /dev/rtc0
Using the rtc interface to the clock.
Assuming hardware clock is kept in UTC time.
Waiting for clock tick...
ioctl(3, RTC_UIE_ON, 0): Invalid argument
Waiting in loop for time from /dev/rtc0 to change
hwclock: ioctl(RTC_RD_TIME) to /dev/rtc0 to read the time failed: Invalid argument
...synchronization failed
In /var/log/messages, the kernel says:

Code: Select all

Jan  1 00:00:02 MiSTer user.info kernel: [    0.269018] rtc-m41t80 1-0068: registered as rtc0
Jan  1 00:00:02 MiSTer user.warn kernel: [    0.269645] rtc-ds1307: probe of 1-006f failed with error -5
Jan  1 00:00:02 MiSTer user.info kernel: [    0.269687] i2c-gpio i2c_gpio: using lines 2012 (SDA) and 2013 (SCL)
Jan  1 00:00:02 MiSTer user.err kernel: [    0.270815] rtc-m41t80 1-0068: hctosys: unable to read the hardware clock
FWIW, I have checked the CR1220 battery and it's ok.

Do I have a faulty board or is a kernel problem of some sorts?

Thanks

Re: Problem with RTC board

Posted: Thu Jan 21, 2021 5:49 pm
by legacypixels
If your clock has never been setup, it may have invalid data. Have you tried "hwclock -wu" a couple times?

Re: Problem with RTC board

Posted: Thu Jan 21, 2021 6:17 pm
by blue1
legacypixels wrote: Thu Jan 21, 2021 5:49 pm If your clock has never been setup, it may have invalid data. Have you tried "hwclock -wu" a couple times?
That solved it! Thanks!!!

Re: Problem with RTC board

Posted: Sat Mar 06, 2021 4:46 am
by -N2
Where are the instructions for setting up the RTC for the first time?

Re: Problem with RTC board

Posted: Sat Mar 06, 2021 6:39 am
by fenderc01

Re: Problem with RTC board

Posted: Sat Mar 06, 2021 7:47 am
by -N2
yeah I discovered you have to set the system time first manually before anything on that page will work.

Re: Problem with RTC board

Posted: Tue Apr 06, 2021 3:09 pm
by C-R-T
Hi! I have a problem too.

I go to the Linux console with F9, login with root as user, 1 as password. This is not a problem.

I try hwclock -wu - it says invalid argument
I try hwclock -u - it says the same.

I try JUST hwclock - same message.

This does not seem to work at all, or am I doing something wrong? My Mister is fully updated with update-all.sh.

Re: Problem with RTC board

Posted: Tue Apr 06, 2021 3:18 pm
by jca
Just run rtc.sh.

Re: Problem with RTC board

Posted: Tue Apr 06, 2021 4:09 pm
by C-R-T
Thanks, man! Another case of the wiki being outdated and wrong?

Re: Problem with RTC board

Posted: Tue Apr 06, 2021 7:49 pm
by jca
I think all the scripts are not even described anywhere.
I think the problems you had are due to the fact that on a newly installed board the clock contains garbage and must be set before you can use the -u function.
You can also set the time zone with the timezone.sh.

Re: Problem with RTC board

Posted: Tue Apr 06, 2021 7:53 pm
by -N2
jca wrote: Tue Apr 06, 2021 7:49 pm I think all the scripts are not even described anywhere.
I think the problems you had are due to the fact that on a newly installed board the clock contains garbage and must be set before you can use the -u function.
You can also set the time zone with the timezone.sh.
yeah pretty much, nothing would work till I manually set the time to something close to reality. after that it worked as intended.