How to use the RTC of BPI-CM6

image

Hardware used:CM6 and A button battery with a 1mm pitch PIN.

Connect the battery interface to the RTC interface of the CM6.

If you cannot use the hwclock command, use:

apt install util-linux-extra

Then use the command to query:

root@bananapicm6io:~# date -s 2028-08-08
2028年 08月 08日 星期二 00:00:00 CST
root@bananapicm6io:~#
root@bananapicm6io:~# hwclock -w
root@bananapicm6io:~#
root@bananapicm6io:~#
root@bananapicm6io:~# date -s 2021-01-01
2021年 01月 01日 星期五 00:00:00 CST
root@bananapicm6io:~#
root@bananapicm6io:~# hwclock -r | grep "2028-08-08" | wc -l
1
root@bananapicm6io:~# hwclock
2028-08-08 00:00:54.602891+08:00
root@bananapicm6io:~# date
2021年 01月 01日 星期五 00:01:04 CST

Finally, you can see that the RTC time setting was successfully queried using hwclock.

video demo: