Hi, has anyone run into RTC trouble with Rock 3a?

Excuse me for my poor English.

I bought a rock 3a, and its hardware revision is v1.31. Generally, it can work well.

However, its RTC won’t work after I attached the battery. I have tested that the battery is 3.1V and is good.

Its RTC won’t run after poweroff. The time of system will keep the same of when shutdown.
Has anyone run into the same trouble?

I test more and below is more information:

There was no network on my rock 3a. And I used command sudo date -s <my setup time> to set system time. Then I use sudo hwclock -w to write to hardware clock. Now the sudo hwclcok -r output is good.
Then I powered off
, when powered off, there is a kernel dump “rcu: INFO: rcu_sched detected stalls on CPUs/tasks:”:

#[  282.946452] mpp_rkvenc fdf40000.rkvenc: shutdown device                                                              
#[  282.946937] mpp_rkvenc fdf40000.rkvenc: shutdown success                                                             
#[  342.952385] rcu: INFO: rcu_sched detected stalls on CPUs/tasks:                                                      
#[  342.952958] rcu:     3-...0: (1 GPs behind) idle=33a/1/0x4000000000000000 softirq=7092/7093 fqs=5978                 
#[  342.953764] rcu:     (detected by 2, t=18002 jiffies, g=6513, q=62)                                                  
#[  342.954313] Task dump for CPU 3:                                                                                     
#[  342.954620] systemd-shutdow R  running task        0     1      0 0x0000000a                                         
#[  342.955264] Call trace:                                                                                              
#[  342.955513]  __switch_to+0xc4/0x128                                                                                  
#[  342.955834]            (null)                                                                                        

Then, I continued to unplug the power connector, waited for 5 mins, plugged in the power connector to turn on my rock 3a.

Now, when I used sudo date command, its output is approximately 2min after the time I turned off. However, command sudo hwclock -r output 2017-08-04 17:00:31.756261+08:00, RTC didn’t work.

@jack Is this problem a hardware problem?

Update at 2022-09-01:
Hi, @avaf mentioned the new updated RTC section of https://wiki.radxa.com/Rock3/Debian , now we know there is a working rtc device HYM8563 registered as /dev/rtc1.
How to make OS use rtc1 as default rtc device?
Can you make official image to use rtc1 as default? @Stephen

Their engineer said that it is not a ROCK 3A hardware problem, the issue lies in LINUX OS. And engineer is repairing it.

1 Like

I thinks this is not RTC hardware related. And we have fixed it.

Please use the latest ROCK 3A Debian/Ubuntu images and test again. Thanks.

https://github.com/radxa/debos-radxa/releases//latest

Yes, I have guessed that this rcu kernel dump is not related to RTC hardware either, though I was not sure about it.
The only reason that I attached this kernel dump at a RTC post was that this " rcu_sched detected stalls on CPUs/tasks" issue existed, and the “poweroff” process is necessary when I test RTC.

Hi, nearly half month past, has this new kernel uploaded to radxa apt repository? So we can use apt update and apt dist-upgrade to install this new kernel to fix the rcu issue.

Yes. You can. Try the following commands to upgrade kernel.

sudo rm /var/lib/apt/lists/apt.radxa.com* # optional
sudo apt update
sudo apt install -y linux-4.19-rock-3-latest

The latest version is 4.19.193-31.

I use the new kernel,but the issue still exist. kernel is 4.19.193-32-rockchip-g002dd37173cf.
Automatically reset the RTC time every time the system is start.

1 Like

rock@rock-3a:~$ dmesg | grep rtc
[ 0.987698] rockchip-vop2 fe040000.vop: [drm:vop2_crtc_atomic_enable] Update mode to 2560x1440p60, type: 11 for vp0
[ 2.284951] rk808-rtc rk808-rtc: registered as rtc0
[ 2.298538] rk808-rtc rk808-rtc: setting system clock to 2017-08-04 09:00:06 UTC (1501837206)

You have manually synced the hwclock with correct system time?

sudo hwclock -w

use hwclock to set time or read time is ok,but plug the power out then restart the system,the set time is reset.

1 Like

RTC port battary is right, plug out the type c power, the port have 3.1V ,the RTC battery is ok.

After setting the hardware clock and rebooting is the hwclock time correct but the system time is not?

1 Like

This is printed every time it starts, indicating that the RTC hardware time has been modified during the startup process, and then reading the hardware time has become 2017

I’m trying to figure out if the issue is at the OS level or the kernel.

Hi,
I have a same proplem.
after doing:

root@rock3a:~# dmesg | grep rtc
[ 0.749597] rk808-rtc rk808-rtc: registered as rtc0
[ 0.751404] rk808-rtc rk808-rtc: setting system clock to 2017-08-04 09:00:02 UTC (1501837202)
root@rock3a:~# date -s “2021-08-17 20:00:00”
root@rock3a:~# hwclock -w
root@rock3a:~# hwclock -r

I give again:
dmesg | grep rtc
[ 0.749597] rk808-rtc rk808-rtc: registered as rtc0
[ 0.751404] rk808-rtc rk808-rtc: setting system clock to 2017-08-04 09:00:02 UTC

I always get the same date.
So before turning off it did not save in the system clock.
I’m trying them all, I also deleted fake-hwclock, nothing, it doesn’t save the current date.
I hope someone finds a solution.

Check the polarity:

It’s ok.
but i believe it is the new version 1.3 and the RTC has not been tested.
For a moment he was adding in overlays = i2c1-hym8563
the only thing I found was the right date when I resent dmesg | grep rtc
but when restarting the factory again

hwclock -r

Should return a value, with or without RTC attached. As you showed above you have no return value.
My board is v1.2 which seems to have hw problems with i2c3 (DSI) and I don’t have any v1.3.

yes, my output is:
rock@rock-3a:~$ sudo hwclock -r
2022-03-14 20:03:07.635303+01:00
rock@rock-3a:~$ dmesg | grep rtc
[ 0.937942] rockchip-vop2 fe040000.vop: [drm:vop2_crtc_atomic_enable] Update mode to 1024x600p60, type: 11 for vp0
[ 1.937567] rk808-rtc rk808-rtc: registered as rtc0
[ 1.943397] rk808-rtc rk808-rtc: setting system clock to 2017-08-04 09:00:06 UTC (1501837206)
rock@rock-3a:~$

hwclock -r as you see it gives me the correct date after giving hwclock -w,
but dmesg as you see keeps marking 2017.
It’s normal?
Anyway I just changed the battery too, and above all I have to always put sudo both as user and as root otherwise hwclock -r tells me command not found.

No, it should read the saved system date from hwclock -w.

After reboot:
[ 0.864127] rk808-rtc rk808-rtc: registered as rtc0
[ 0.865899] rk808-rtc rk808-rtc: setting system clock to 2022-03-14 17:37:55 UTC (1647279475)